Subversion Repositories oidplus

Rev

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

Rev 786 Rev 800
Line 53... Line 53...
53
 
53
 
54
        public function gui($id, &$out, &$handled) {
54
        public function gui($id, &$out, &$handled) {
55
                if ($id === 'oidplus:srv_registration') {
55
                if ($id === 'oidplus:srv_registration') {
56
                        $handled = true;
56
                        $handled = true;
57
                        $out['title'] = _L('System registration settings');
57
                        $out['title'] = _L('System registration settings');
58
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
58
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
59
 
59
 
60
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
60
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
61
                                $out['icon'] = 'img/error_big.png';
61
                                $out['icon'] = 'img/error.png';
62
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
62
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
63
                                return;
63
                                return;
64
                        }
64
                        }
65
 
65
 
66
                        if (file_exists(__DIR__ . '/info$'.OIDplus::getCurrentLang().'.html')) {
66
                        if (file_exists(__DIR__ . '/info$'.OIDplus::getCurrentLang().'.html')) {
Line 128... Line 128...
128
                        }
128
                        }
129
                }
129
                }
130
                if ($id === 'oidplus:srvreg_status') {
130
                if ($id === 'oidplus:srvreg_status') {
131
                        $handled = true;
131
                        $handled = true;
132
                        $out['title'] = _L('Registration live status');
132
                        $out['title'] = _L('Registration live status');
133
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
133
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
134
 
134
 
135
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
135
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
136
                                $out['icon'] = 'img/error_big.png';
136
                                $out['icon'] = 'img/error.png';
137
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
137
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
138
                                return;
138
                                return;
139
                        }
139
                        }
140
 
140
 
141
                        $query = self::QUERY_LIVESTATUS_V1;
141
                        $query = self::QUERY_LIVESTATUS_V1;
Line 182... Line 182...
182
                        curl_close($ch);
182
                        curl_close($ch);
183
 
183
 
184
                        $json = @json_decode($res, true);
184
                        $json = @json_decode($res, true);
185
 
185
 
186
                        if (!$json) {
186
                        if (!$json) {
187
                                $out['icon'] = 'img/error_big.png';
187
                                $out['icon'] = 'img/error.png';
188
                                $out['text'] = _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
188
                                $out['text'] = _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
189
                                return;
189
                                return;
190
                        }
190
                        }
191
 
191
 
192
                        if (isset($json['error']) || ($json['status'] < 0)) {
192
                        if (isset($json['error']) || ($json['status'] < 0)) {
193
                                $out['icon'] = 'img/error_big.png';
193
                                $out['icon'] = 'img/error.png';
194
                                if (isset($json['error'])) {
194
                                if (isset($json['error'])) {
195
                                        $out['text'] = _L('Received error status code: %1',$json['error']);
195
                                        $out['text'] = _L('Received error status code: %1',$json['error']);
196
                                } else {
196
                                } else {
197
                                        $out['text'] = _L('Received error status code: %1',$json['status']);
197
                                        $out['text'] = _L('Received error status code: %1',$json['status']);
198
                                }
198
                                }
Line 476... Line 476...
476
        }
476
        }
477
 
477
 
478
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
478
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
479
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
479
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
480
 
480
 
481
                if (file_exists(__DIR__.'/treeicon.png')) {
481
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
482
                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
482
                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
483
                } else {
483
                } else {
484
                        $tree_icon = null; // default icon (folder)
484
                        $tree_icon = null; // default icon (folder)
485
                }
485
                }
486
 
486
 
487
                $json[] = array(
487
                $json[] = array(