|
@@ -213,10 +213,11 @@ class Reg extends Base
|
|
|
public function action()
|
|
|
{
|
|
|
$account = Dever::config('base', 'project')->account;
|
|
|
+ $code = Dever::config('base', 'project')->nocode ? Dever::config('base', 'project')->nocode : state;
|
|
|
$baccount = ucfirst($account);
|
|
|
$method = 'check' . $baccount . 'Exists';
|
|
|
|
|
|
- $param['option_' . $account] = $this->$method();
|
|
|
+ $param['option_' . $account] = $this->$method($code);
|
|
|
|
|
|
if ($param['option_' . $account]) {
|
|
|
$param['add_' . $account] = $param['option_' . $account];
|
|
@@ -267,13 +268,48 @@ class Reg extends Base
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function forget_email()
|
|
|
+ {
|
|
|
+
|
|
|
+ $email = Dever::input('email');
|
|
|
+ if ($email) {
|
|
|
+ if (!preg_match(Dever::rule('email'), $email)) {
|
|
|
+ Dever::alert('请输入正确的邮箱');
|
|
|
+ }
|
|
|
+
|
|
|
+ $code = $this->code(false, false);
|
|
|
+
|
|
|
+ $email = base64_encode($email);
|
|
|
+
|
|
|
+ Dever::daemon('lib/email.forget?email=' . $email . '&code=' . $code, 'passport');
|
|
|
+
|
|
|
+ $this->refer();
|
|
|
+ } else {
|
|
|
+ Dever::alert('请输入邮箱');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function forget()
|
|
|
{
|
|
|
+ $signature = Dever::input('signature');
|
|
|
+ if (!$signature) {
|
|
|
+ Dever::alert('验证信息失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ $signature = Dever::decode($signature);
|
|
|
+ $temp = explode('|||', $signature);
|
|
|
+ $code = $temp[1];
|
|
|
+
|
|
|
+ $state = $this->code($code);
|
|
|
+ if (!$state) {
|
|
|
+ Dever::alert('验证信息失败');
|
|
|
+ }
|
|
|
$account = Dever::config('base', 'project')->account;
|
|
|
+ $code = Dever::config('base', 'project')->nocode ? Dever::config('base', 'project')->nocode : state;
|
|
|
$baccount = ucfirst($account);
|
|
|
$method = 'check' . $baccount . 'Exists';
|
|
|
|
|
|
- $param['option_' . $account] = $this->$method(0, true);
|
|
|
+ $param['option_' . $account] = $this->$method($code, true);
|
|
|
|
|
|
|
|
|
$user = Dever::load('passport/user-one', $param);
|
|
@@ -284,7 +320,7 @@ class Reg extends Base
|
|
|
$param['set_password'] = Dever::input('password');
|
|
|
$cpassword = Dever::input('cpassword');
|
|
|
|
|
|
- if (md5($param['set_password']) == $user['password']) {
|
|
|
+ if (sha1($param['set_password']) == $user['password']) {
|
|
|
Dever::alert('您的新密码和旧密码相同');
|
|
|
}
|
|
|
|