Subversion Repositories oidplus

Rev

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

Rev 790 Rev 800
Line 97... Line 97...
97
        public function gui($id, &$out, &$handled) {
97
        public function gui($id, &$out, &$handled) {
98
                if (explode('$',$id)[0] == 'oidplus:forgot_password') {
98
                if (explode('$',$id)[0] == 'oidplus:forgot_password') {
99
                        $handled = true;
99
                        $handled = true;
100
 
100
 
101
                        $out['title'] = _L('Forgot password');
101
                        $out['title'] = _L('Forgot password');
102
                        $out['icon'] = OIDplus::webpath(__DIR__).'forgot_password_big.png';
102
                        $out['icon'] = OIDplus::webpath(__DIR__,true).'img/forgot_password_icon.png';
103
 
103
 
104
                        try {
104
                        try {
105
                                $out['text'] .= '<p>'._L('Please enter the email address of your account, and information about the password reset will be sent to you.').'</p>
105
                                $out['text'] .= '<p>'._L('Please enter the email address of your account, and information about the password reset will be sent to you.').'</p>
106
                                  <form id="forgotPasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPagePublicForgotPassword.forgotPasswordFormOnSubmit();">
106
                                  <form id="forgotPasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPagePublicForgotPassword.forgotPasswordFormOnSubmit();">
107
                                    '._L('E-Mail').': <input type="text" id="email" value=""/><br><br>
107
                                    '._L('E-Mail').': <input type="text" id="email" value=""/><br><br>
Line 110... Line 110...
110
                                    <input type="submit" value="'._L('Send recovery information').'">
110
                                    <input type="submit" value="'._L('Send recovery information').'">
111
                                  </form>';
111
                                  </form>';
112
 
112
 
113
                        } catch (Exception $e) {
113
                        } catch (Exception $e) {
114
 
114
 
115
                                $out['icon'] = 'img/error_big.png';
115
                                $out['icon'] = 'img/error.png';
116
                                $out['text'] = '<p>'._L('Error: %1',htmlentities($e->getMessage())).'</p>';
116
                                $out['text'] = '<p>'._L('Error: %1',htmlentities($e->getMessage())).'</p>';
117
 
117
 
118
                        }
118
                        }
119
                } else if (explode('$',$id)[0] == 'oidplus:reset_password') {
119
                } else if (explode('$',$id)[0] == 'oidplus:reset_password') {
120
                        $handled = true;
120
                        $handled = true;
Line 122... Line 122...
122
                        $email = explode('$',$id)[1];
122
                        $email = explode('$',$id)[1];
123
                        $timestamp = explode('$',$id)[2];
123
                        $timestamp = explode('$',$id)[2];
124
                        $auth = explode('$',$id)[3];
124
                        $auth = explode('$',$id)[3];
125
 
125
 
126
                        $out['title'] = _L('Reset password');
126
                        $out['title'] = _L('Reset password');
127
                        $out['icon'] = OIDplus::webpath(__DIR__).'reset_password_big.png';
127
                        $out['icon'] = OIDplus::webpath(__DIR__,true).'img/reset_password_icon.png';
128
 
128
 
129
                        if (!OIDplus::authUtils()->validateAuthKey('reset_password;'.$email.';'.$timestamp, $auth)) {
129
                        if (!OIDplus::authUtils()->validateAuthKey('reset_password;'.$email.';'.$timestamp, $auth)) {
130
                                $out['icon'] = 'img/error_big.png';
130
                                $out['icon'] = 'img/error.png';
131
                                $out['text'] = _L('Invalid authorization. Is the URL OK?');
131
                                $out['text'] = _L('Invalid authorization. Is the URL OK?');
132
                        } else {
132
                        } else {
133
                                $out['text'] = '<p>'._L('E-Mail-Address: %1','<b>'.$email.'</b>').'</p>
133
                                $out['text'] = '<p>'._L('E-Mail-Address: %1','<b>'.$email.'</b>').'</p>
134
 
134
 
135
                                  <form id="resetPasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPagePublicForgotPassword.resetPasswordFormOnSubmit();">
135
                                  <form id="resetPasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPagePublicForgotPassword.resetPasswordFormOnSubmit();">