开发者

Codeigniter Routing Settings for Tank Auth

I'm using Tank-Auth for my application. And the only prob开发者_运维百科lem I have is activating and resetting passwords for accounts.

For login, register, logout; I have no problem with this codes;

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

But for activating accounts and resetting passwords, those codes are not working;

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

PS: The first segment after 'activate' is 'user id' and second segment is key like this: example.com/activate/2/4784322e48916efec1153c53d25453c7


The solution is changing url segments in the (auth) controller from this:

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

to this:

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

After this change, the routing for activate&reset_password is working with those rules

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜