2010-10-12 51 views
4

我正在为我的应用程序使用Tank-Auth。我唯一的问题是激活并重置账户密码。Tank Auth的Codeigniter路由设置

用于登录,注册,注销;这些代码我没有问题;

$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”和第二区段是这样的键:example.com/activate/2/4784322e48916efec1153c53d25453c7

回答

3

溶液改变URL段在从这个(AUTH)控制器:

$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); 

在此之后更改,路由激活& reset_password正在使用这些规则

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