Subversion Repositories oidplus

Rev

Rev 1086 | Rev 1143 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1086 Rev 1116
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 OIDplusPageRaEditContactData extends OIDplusPagePluginRa {
26
class OIDplusPageRaEditContactData extends OIDplusPagePluginRa {
27
 
27
 
-
 
28
        /**
-
 
29
         * @param string $actionID
-
 
30
         * @param array $params
-
 
31
         * @return int[]
-
 
32
         * @throws OIDplusException
-
 
33
         */
28
        public function action($actionID, $params) {
34
        public function action(string $actionID, array $params): array {
29
                if ($actionID == 'change_ra_data') {
35
                if ($actionID == 'change_ra_data') {
30
                        _CheckParamExists($params, 'email');
36
                        _CheckParamExists($params, 'email');
31
 
37
 
32
                        $email = $params['email'];
38
                        $email = $params['email'];
33
 
39
 
Line 67... Line 73...
67
 
73
 
68
                        OIDplus::db()->query("UPDATE ###ra SET updated = ".OIDplus::db()->sqlDate()." WHERE email = ?", array($email));
74
                        OIDplus::db()->query("UPDATE ###ra SET updated = ".OIDplus::db()->sqlDate()." WHERE email = ?", array($email));
69
 
75
 
70
                        return array("status" => 0);
76
                        return array("status" => 0);
71
                } else {
77
                } else {
72
                        throw new OIDplusException(_L('Unknown action ID'));
78
                        return parent::action($actionID, $params);
73
                }
79
                }
74
        }
80
        }
75
 
81
 
-
 
82
        /**
-
 
83
         * @param bool $html
-
 
84
         * @return void
-
 
85
         */
76
        public function init($html=true) {
86
        public function init(bool $html=true) {
77
                // Nothing
87
                // Nothing
78
        }
88
        }
79
 
89
 
-
 
90
        /**
-
 
91
         * @param string $id
-
 
92
         * @param array $out
-
 
93
         * @param bool $handled
-
 
94
         * @return void
-
 
95
         * @throws OIDplusException
-
 
96
         */
80
        public function gui($id, &$out, &$handled) {
97
        public function gui(string $id, array &$out, bool &$handled) {
81
                if (explode('$',$id)[0] == 'oidplus:edit_ra') {
98
                if (explode('$',$id)[0] == 'oidplus:edit_ra') {
82
                        $handled = true;
99
                        $handled = true;
83
 
100
 
84
                        $ra_email = explode('$',$id)[1];
101
                        $ra_email = explode('$',$id)[1];
85
 
102
 
Line 134... Line 151...
134
                                $out['text'] .= '<p><a href="#" onclick="return OIDplusPagePublicRaBaseUtils.deleteRa('.js_escape($ra_email).',\'oidplus:system\')">'._L('Delete profile').'</a> '._L('(objects stay active)').'</p>';
151
                                $out['text'] .= '<p><a href="#" onclick="return OIDplusPagePublicRaBaseUtils.deleteRa('.js_escape($ra_email).',\'oidplus:system\')">'._L('Delete profile').'</a> '._L('(objects stay active)').'</p>';
135
                        }
152
                        }
136
                }
153
                }
137
        }
154
        }
138
 
155
 
-
 
156
        /**
-
 
157
         * @param array $json
-
 
158
         * @param string|null $ra_email
-
 
159
         * @param bool $nonjs
-
 
160
         * @param string $req_goto
-
 
161
         * @return bool
-
 
162
         * @throws OIDplusException
-
 
163
         */
139
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
164
        public function tree(array &$json, string $ra_email=null, bool $nonjs=false, string $req_goto=''): bool {
140
                if (!$ra_email) return false;
165
                if (!$ra_email) return false;
141
                if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false;
166
                if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false;
142
 
167
 
143
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
168
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
144
                        $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png';
169
                        $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png';
Line 153... Line 178...
153
                );
178
                );
154
 
179
 
155
                return true;
180
                return true;
156
        }
181
        }
157
 
182
 
-
 
183
        /**
-
 
184
         * @param string $request
-
 
185
         * @return array|false
-
 
186
         */
158
        public function tree_search($request) {
187
        public function tree_search(string $request) {
159
                return false;
188
                return false;
160
        }
189
        }
161
}
190
}