Re: Ver5.7のログイン画面のURLを変更する方法

2016年10月20日 at 23:09

お世話になります。
メモ。

週刊 concrete5 Vol. 308 の 22:29 から 22:39 までの録画部分で、
お伝えし忘れてました。
すいません。

最低限
/concrete/authentication/concrete/controller.php
/concrete/authentication/concrete/form.php

/application/authentication/concrete/controller.php
/application/authentication/concrete/form.php
にコピーし

/application/authentication/concrete/controller.php
をテキストエディタで開いきます。

──────────
/application/authentication/concrete/controller.php
──────────

2行目を
namespace Concrete\Authentication\Concrete;

namespace Application\Authentication\Concrete;
に変更。

171行目
'/login',

'/xxx', (新しいログイン URL)

203行目
$this->redirect('/login', $this->getAuthenticationType()->getAuthenticationTypeHandle(), 'password_sent');

$this->redirect('/xxx', $this->getAuthenticationType()->getAuthenticationTypeHandle(), 'password_sent');
に変更

331行目
$this->redirect('/login/callback/concrete', 'email_validated');

$this->redirect('/xxx/callback/concrete', 'email_validated');


334行目
$this->redirect('/login/callback/concrete', 'invalid_token');

$this->redirect('/xxx/callback/concrete', 'invalid_token');

など・・・。

同じく、
/application/authentication/concrete/form.php
の中を見て「/login」な記述があるところを新しい URL に変更してください。

他にもパスワード変更ページなども移設したい場合は
/concrete/authentication/concrete
内にある他のファイルをすべて
/application/authentication/concrete
配下にコピーして、/login の書いてある場所を書き換えてください。

よろしくお願いします。

Re: Ver5.7のログイン画面のURLを変更する方法

2016年10月21日 at 18:33
ありがとうございます。

週刊 concrete5 Vol. 308を見ながら編集しましたが、症状は変わりませんでした。
2つのパターンを試しました。
1.当初の予定通り、希望していた任意のフォルダの下でログインページを作り、ログインしようとした。
2.週刊 concrete5で紹介していると同一のファイル名で設定。

週刊の中にありました
・/concrete/controllers/single_pages/login.php
・/concrete/single_pages/login.php
・/concrete/authentication/concrete/controller.php
・/concrete/authentication/concrete/form.php
の4つをコピーして、変更を行いました。

結果は、
1.ログイン画面は出ましたが、ログインすると404エラーになりました。
2.同一のようにxxx.phpでログインしようと編集しましたが404エラーになりました。

1.の場合、サブフォルダを設定してのログインであったため、
・/application/authentication/concrete/controller.php
・/application/authentication/concrete/form.php
の編集に問題があるのでしょうか?

2.の場合、【管理画面 - ページとテーマ - シングルページより、希望 URL のページを追加する】後の編集でしょうか?

お手数をお掛けいたしますが、ご回答よろしくお願いいたします。