【问题标题】:Codeigniter Routing Settings for Tank AuthTank Auth 的 Codeigniter 路由设置
【发布时间】:2011-04-24 11:06:03
【问题描述】:

我正在为我的应用程序使用 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”,第二段是这样的键:example.com/activate/2/4784322e48916efec1153c53d25453c7

【问题讨论】:

    标签: codeigniter routing tankauth


    【解决方案1】:

    解决方案是从以下位置更改 (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";
    

    【讨论】:

      猜你喜欢
      • 2011-11-06
      • 1970-01-01
      • 1970-01-01
      • 2011-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-26
      • 1970-01-01
      相关资源
      最近更新 更多