2010-10-12 50 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";