Rev 1199 | Rev 1206 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1199 | Rev 1201 | ||
---|---|---|---|
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 OIDplusException(_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'))); |
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 OIDplusException(_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'))); |
84 | } |
84 | } |
85 | 85 | ||
86 | _CheckParamExists($params, 'oid'); |
86 | _CheckParamExists($params, 'oid'); |
87 | 87 | ||
88 | $oid = $params['oid']; |
88 | $oid = $params['oid']; |