Subversion Repositories oidplus

Rev

Rev 1278 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1278 Rev 1293
Line 23... Line 23...
23
\defined('INSIDE_OIDPLUS') or die;
23
\defined('INSIDE_OIDPLUS') or die;
24
// phpcs:enable PSR1.Files.SideEffects
24
// phpcs:enable PSR1.Files.SideEffects
25
 
25
 
26
class OIDplusPageAdminCreateRa extends OIDplusPagePluginAdmin {
26
class OIDplusPageAdminCreateRa extends OIDplusPagePluginAdmin {
27
 
27
 
-
 
28
 
28
        /**
29
        /**
29
         * @param string $actionID
-
 
30
         * @param array $params
30
         * @param array $params
31
         * @return array
31
         * @return array
32
         * @throws OIDplusException
32
         * @throws OIDplusException
33
         */
33
         */
34
        public function action(string $actionID, array $params): array {
34
        private function action_Create(array $params): array {
35
                if ($actionID == 'create_ra') {
-
 
36
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
35
                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')), null, 401);
36
                        throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401);
38
                        }
37
                }
39
 
38
 
40
                        _CheckParamExists($params, 'email');
39
                _CheckParamExists($params, 'email');
Line 67... Line 66...
67
 
66
 
68
                        $ra = new OIDplusRA($email);
67
                $ra = new OIDplusRA($email);
69
                        $ra->register_ra($password1);
68
                $ra->register_ra($password1);
70
 
69
 
71
                        return array("status" => 0);
70
                return array("status" => 0);
-
 
71
        }
-
 
72
 
-
 
73
        /**
-
 
74
         * @param string $actionID
-
 
75
         * @param array $params
-
 
76
         * @return array
-
 
77
         * @throws OIDplusException
-
 
78
         */
-
 
79
        public function action(string $actionID, array $params): array {
-
 
80
                if ($actionID == 'create_ra') {
-
 
81
                        return $this->action_Create($params);
72
                } else {
82
                } else {
73
                        return parent::action($actionID, $params);
83
                        return parent::action($actionID, $params);
74
                }
84
                }
75
        }
85
        }
76
 
86