示例#1
0
文件: passwd.php 项目: lughong/shop
 /**
  *	根据用户点击找回密码的url来寻找是哪一个email
  *	并且检查是否过期,是否被使用过了
  */
 protected function _checkCode($code)
 {
     $code = htmlspecialchars($code);
     $info = Code::getCodeInfoByCode($code);
     if ($info) {
         $info = $info[0];
         if ($info['is_use'] == 'no' && $info['expire'] > time()) {
             return true;
         }
     }
     LuS::set('email_save_msg', "该链接已使用或已过期!!!点我重新验证!");
     LuS::set('email_save_url', url("login", "passwd::index"));
     $url = url("login", "passwd::prompt");
     header("location:{$url}");
     throw new Exception('exit');
 }