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 108... | Line 108... | ||
108 | $origin = explode('$',$id)[2]; |
108 | $origin = explode('$',$id)[2]; |
109 | 109 | ||
110 | $out['title'] = _L('Invite a Registration Authority'); |
110 | $out['title'] = _L('Invite a Registration Authority'); |
111 | 111 | ||
112 | if (!OIDplus::config()->getValue('ra_invitation_enabled')) { |
112 | if (!OIDplus::config()->getValue('ra_invitation_enabled')) { |
113 | $out['icon'] = 'img/error_big.png'; |
113 | $out['icon'] = 'img/error.png'; |
114 | $out['text'] = '<p>'._L('Invitations are disabled by the administrator.').'</p>'; |
114 | $out['text'] = '<p>'._L('Invitations are disabled by the administrator.').'</p>'; |
115 | return; |
115 | return; |
116 | } |
116 | } |
117 | 117 | ||
118 | $out['icon'] = OIDplus::webpath(__DIR__).'invite_ra_big.png'; |
118 | $out['icon'] = OIDplus::webpath(__DIR__,true).'img/invite_icon.png'; |
119 | 119 | ||
120 | try { |
120 | try { |
121 | $this->inviteSecurityCheck($email); |
121 | $this->inviteSecurityCheck($email); |
122 | $cont = $this->getInvitationText($email); |
122 | $cont = $this->getInvitationText($email); |
123 | 123 | ||
Line 130... | Line 130... | ||
130 | <input type="submit" value="'._L('Send invitation').'"> |
130 | <input type="submit" value="'._L('Send invitation').'"> |
131 | </form>'; |
131 | </form>'; |
132 | 132 | ||
133 | } catch (Exception $e) { |
133 | } catch (Exception $e) { |
134 | 134 | ||
135 | $out['icon'] = 'img/error_big.png'; |
135 | $out['icon'] = 'img/error.png'; |
136 | $out['text'] = _L('Error: %1',$e->getMessage()); |
136 | $out['text'] = _L('Error: %1',$e->getMessage()); |
137 | 137 | ||
138 | } |
138 | } |
139 | } else if (explode('$',$id)[0] == 'oidplus:activate_ra') { |
139 | } else if (explode('$',$id)[0] == 'oidplus:activate_ra') { |
140 | $handled = true; |
140 | $handled = true; |
Line 144... | Line 144... | ||
144 | $auth = explode('$',$id)[3]; |
144 | $auth = explode('$',$id)[3]; |
145 | 145 | ||
146 | $out['title'] = _L('Register as Registration Authority'); |
146 | $out['title'] = _L('Register as Registration Authority'); |
147 | 147 | ||
148 | if (!OIDplus::config()->getValue('ra_invitation_enabled')) { |
148 | if (!OIDplus::config()->getValue('ra_invitation_enabled')) { |
149 | $out['icon'] = 'img/error_big.png'; |
149 | $out['icon'] = 'img/error.png'; |
150 | $out['text'] = '<p>'._L('Invitations are disabled by the administrator.').'</p>'; |
150 | $out['text'] = '<p>'._L('Invitations are disabled by the administrator.').'</p>'; |
151 | return; |
151 | return; |
152 | } |
152 | } |
153 | 153 | ||
154 | $out['icon'] = OIDplus::webpath(__DIR__).'activate_ra_big.png'; |
154 | $out['icon'] = OIDplus::webpath(__DIR__,true).'img/activate_icon.png'; |
155 | 155 | ||
156 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($email)); |
156 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($email)); |
157 | if ($res->any()) { |
157 | if ($res->any()) { |
158 | $out['text'] = _L('This RA is already registered and does not need to be invited.'); |
158 | $out['text'] = _L('This RA is already registered and does not need to be invited.'); |
159 | } else { |
159 | } else { |
160 | if (!OIDplus::authUtils()->validateAuthKey('activate_ra;'.$email.';'.$timestamp, $auth)) { |
160 | if (!OIDplus::authUtils()->validateAuthKey('activate_ra;'.$email.';'.$timestamp, $auth)) { |
161 | $out['icon'] = 'img/error_big.png'; |
161 | $out['icon'] = 'img/error.png'; |
162 | $out['text'] = _L('Invalid authorization. Is the URL OK?'); |
162 | $out['text'] = _L('Invalid authorization. Is the URL OK?'); |
163 | } else { |
163 | } else { |
164 | // TODO: like in the FreeOID plugin, we could ask here at least for a name for the RA |
164 | // TODO: like in the FreeOID plugin, we could ask here at least for a name for the RA |
165 | $out['text'] = '<p>'._L('E-Mail-Address').': <b>'.$email.'</b></p> |
165 | $out['text'] = '<p>'._L('E-Mail-Address').': <b>'.$email.'</b></p> |
166 | 166 |