Rev 1231 | Rev 1267 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1231 | Rev 1266 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | */ |
45 | */ |
46 | public function action(string $actionID, array $params): array { |
46 | public function action(string $actionID, array $params): array { |
47 | 47 | ||
48 | if ($actionID == 'import_xml_file') { |
48 | if ($actionID == 'import_xml_file') { |
49 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
49 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
50 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
50 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null,401); |
51 | } |
51 | } |
52 | 52 | ||
53 | if (!isset($_FILES['userfile'])) { |
53 | if (!isset($_FILES['userfile'])) { |
54 | throw new OIDplusException(_L('Please choose a file.')); |
54 | throw new OIDplusException(_L('Please choose a file.')); |
55 | } |
55 | } |
Line 78... | Line 78... | ||
78 | "count_warnings" => $count_warnings |
78 | "count_warnings" => $count_warnings |
79 | ); |
79 | ); |
80 | } |
80 | } |
81 | } else if ($actionID == 'import_oidinfo_oid') { |
81 | } else if ($actionID == 'import_oidinfo_oid') { |
82 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
82 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
83 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
83 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401); |
84 | } |
84 | } |
85 | 85 | ||
86 | _CheckParamExists($params, 'oid'); |
86 | _CheckParamExists($params, 'oid'); |
87 | 87 | ||
88 | $oid = $params['oid']; |
88 | $oid = $params['oid']; |
Line 192... | Line 192... | ||
192 | $handled = true; |
192 | $handled = true; |
193 | $out['title'] = _L('List OIDs in your system which are missing at oid-info.com'); |
193 | $out['title'] = _L('List OIDs in your system which are missing at oid-info.com'); |
194 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
194 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
195 | 195 | ||
196 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
196 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
197 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title']); |
197 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title'], 401); |
198 | } |
198 | } |
199 | 199 | ||
200 | $query = self::QUERY_LIST_OIDINFO_OIDS_V1; |
200 | $query = self::QUERY_LIST_OIDINFO_OIDS_V1; |
201 | 201 | ||
202 | $payload = array( |
202 | $payload = array( |
Line 463... | Line 463... | ||
463 | $handled = true; |
463 | $handled = true; |
464 | $out['title'] = _L('List OIDs at oid-info.com which are missing in your system'); |
464 | $out['title'] = _L('List OIDs at oid-info.com which are missing in your system'); |
465 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
465 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
466 | 466 | ||
467 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
467 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
468 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title']); |
468 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title'], 401); |
469 | } |
469 | } |
470 | 470 | ||
471 | $query = self::QUERY_LIST_OIDINFO_OIDS_V1; |
471 | $query = self::QUERY_LIST_OIDINFO_OIDS_V1; |
472 | 472 | ||
473 | $payload = array( |
473 | $payload = array( |
Line 599... | Line 599... | ||
599 | $handled = true; |
599 | $handled = true; |
600 | $out['title'] = _L('Data Transfer'); |
600 | $out['title'] = _L('Data Transfer'); |
601 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
601 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
602 | 602 | ||
603 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
603 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
604 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title']); |
604 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title'], 401); |
605 | } |
605 | } |
606 | 606 | ||
607 | $out['text'] = '<noscript>'; |
607 | $out['text'] = '<noscript>'; |
608 | $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>'; |
608 | $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>'; |
609 | $out['text'] .= '</noscript>'; |
609 | $out['text'] .= '</noscript>'; |