Subversion Repositories oidplus

Rev

Rev 1267 | Rev 1283 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1267 Rev 1282
Line 44... Line 44...
44
                        OIDplus::getActiveCaptchaPlugin()->captchaVerify($params, 'captcha');
44
                        OIDplus::getActiveCaptchaPlugin()->captchaVerify($params, 'captcha');
45
 
45
 
46
                        OIDplus::logger()->log("V2:[WARN]RA(%1)", "A new password for '%1' was requested (forgot password)", $email);
46
                        OIDplus::logger()->log("V2:[WARN]RA(%1)", "A new password for '%1' was requested (forgot password)", $email);
47
 
47
 
48
                        $timestamp = time();
48
                        $timestamp = time();
49
                        $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:reset_password$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('reset_password;'.$email.';'.$timestamp));
49
                        $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:reset_password$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('93a16dbe-f4fb-11ed-b67e-3c4a92df8582:'.$email.'/'.$timestamp));
50
 
50
 
51
                        $message = $this->getForgotPasswordText($params['email']);
51
                        $message = $this->getForgotPasswordText($params['email']);
52
                        $message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message);
52
                        $message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message);
53
 
53
 
54
                        OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Password reset request', $message);
54
                        OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Password reset request', $message);
Line 67... Line 67...
67
                        $password2 = $params['password2'];
67
                        $password2 = $params['password2'];
68
                        $email = $params['email'];
68
                        $email = $params['email'];
69
                        $auth = $params['auth'];
69
                        $auth = $params['auth'];
70
                        $timestamp = $params['timestamp'];
70
                        $timestamp = $params['timestamp'];
71
 
71
 
72
                        if (!OIDplus::authUtils()->validateAuthKey('reset_password;'.$email.';'.$timestamp, $auth)) {
72
                        if (!OIDplus::authUtils()->validateAuthKey('93a16dbe-f4fb-11ed-b67e-3c4a92df8582:'.$email.'/'.$timestamp, $auth)) {
73
                                throw new OIDplusException(_L('Invalid auth key'));
73
                                throw new OIDplusException(_L('Invalid auth key'));
74
                        }
74
                        }
75
 
75
 
76
                        if ((OIDplus::config()->getValue('max_ra_pwd_reset_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_pwd_reset_time'))) {
76
                        if ((OIDplus::config()->getValue('max_ra_pwd_reset_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_pwd_reset_time'))) {
77
                                throw new OIDplusException(_L('Invitation expired!'));
77
                                throw new OIDplusException(_L('Invitation expired!'));