Rev 1206 | Rev 1267 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1206 | Rev 1266 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | * @throws OIDplusException |
32 | * @throws OIDplusException |
33 | */ |
33 | */ |
34 | public function action(string $actionID, array $params): array { |
34 | public function action(string $actionID, array $params): array { |
35 | if ($actionID == 'create_ra') { |
35 | if ($actionID == 'create_ra') { |
36 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
36 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
37 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
37 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401); |
38 | } |
38 | } |
39 | 39 | ||
40 | _CheckParamExists($params, 'email'); |
40 | _CheckParamExists($params, 'email'); |
41 | _CheckParamExists($params, 'password1'); |
41 | _CheckParamExists($params, 'password1'); |
42 | _CheckParamExists($params, 'password2'); |
42 | _CheckParamExists($params, 'password2'); |
Line 98... | Line 98... | ||
98 | $email = $parts[1] ?? ''; |
98 | $email = $parts[1] ?? ''; |
99 | $out['title'] = _L('Manual creation of a RA'); |
99 | $out['title'] = _L('Manual creation of a RA'); |
100 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
100 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
101 | 101 | ||
102 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
102 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
103 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title']); |
103 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title'], 401); |
104 | } |
104 | } |
105 | 105 | ||
106 | $out['text'] .= '<form id="adminCreateRaFrom" action="javascript:void(0);" onsubmit="return OIDplusPageAdminCreateRa.adminCreateRaFormOnSubmit();">'; |
106 | $out['text'] .= '<form id="adminCreateRaFrom" action="javascript:void(0);" onsubmit="return OIDplusPageAdminCreateRa.adminCreateRaFormOnSubmit();">'; |
107 | $out['text'] .= '<div><label class="padding_label">'._L('E-Mail').':</label><input type="text" id="email" value="'.htmlentities($email).'"></div>'; |
107 | $out['text'] .= '<div><label class="padding_label">'._L('E-Mail').':</label><input type="text" id="email" value="'.htmlentities($email).'"></div>'; |
108 | $out['text'] .= '<div><label class="padding_label">'._L('Password').':</label><input type="password" id="password1" value=""/></div>'; |
108 | $out['text'] .= '<div><label class="padding_label">'._L('Password').':</label><input type="password" id="password1" value=""/></div>'; |