4

アプリケーションにTank-Authを使用しています。そして、私が抱えている唯一の問題は、アカウントのパスワードをアクティブにしてリセットすることです。

ログイン、登録、ログアウト; このコードには問題はありません。

$route['login'] = "/auth/login";
$route['logout'] = "/auth/logout";
$route['register'] = "/auth/register";

ただし、アカウントをアクティブ化してパスワードをリセットする場合、これらのコードは機能しません。

$route['activate/:num/:any'] = "/auth/activate/$1/$2";
$route['reset_password/:num/:any'] = "/auth/reset_password/$1/$2";

PS:「アクティブ化」の後の最初のセグメントは「ユーザーID」であり、2番目のセグメントは次のようなキーです:example.com/activate/2/4784322e48916efec1153c53d25453c7

4

1 に答える 1

3

解決策は、(auth)コントローラーのURLセグメントを次のように変更することです。

    $user_id        = $this->uri->segment(3);
    $new_pass_key    = $this->uri->segment(4);

これに:

    $user_id        = $this->uri->segment(2);
    $new_pass_key    = $this->uri->segment(3);

この変更後、activate&reset_passwordのルーティングはこれらのルールで機能します

$route['activate/:num/:any'] = "/auth/activate/$1/$2";
$route['reset_password/:num/:any'] = "/auth/reset_password/$1/$2";
于 2010-10-13T21:41:44.050 に答える