Subversion Repositories oidplus

Rev

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

Rev 800 Rev 801
Line 116... Line 116...
116
 
116
 
117
                                // All OK! Now write file
117
                                // All OK! Now write file
118
 
118
 
119
                                $tmp_filename = 'update_'.generateRandomString(10).'.tmp.php';
119
                                $tmp_filename = 'update_'.generateRandomString(10).'.tmp.php';
120
                                $local_file = OIDplus::localpath().$tmp_filename;
120
                                $local_file = OIDplus::localpath().$tmp_filename;
121
                                $web_file = OIDplus::webpath().$tmp_filename;
121
                                $web_file = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).$tmp_filename;
122
 
122
 
123
                                @file_put_contents($local_file, $cont);
123
                                @file_put_contents($local_file, $cont);
124
 
124
 
125
                                if (!file_exists($local_file) || (@file_get_contents($local_file) !== $cont)) {
125
                                if (!file_exists($local_file) || (@file_get_contents($local_file) !== $cont)) {
126
                                        throw new OIDplusException(_L('Update file could not written. Probably there are no write-permissions to the root folder.'));
126
                                        throw new OIDplusException(_L('Update file could not written. Probably there are no write-permissions to the root folder.'));
Line 148... Line 148...
148
                if ($parts[0] == 'oidplus:software_update') {
148
                if ($parts[0] == 'oidplus:software_update') {
149
                        @set_time_limit(0);
149
                        @set_time_limit(0);
150
 
150
 
151
                        $handled = true;
151
                        $handled = true;
152
                        $out['title'] = _L('Software update');
152
                        $out['title'] = _L('Software update');
153
                        $out['icon']  = OIDplus::webpath(__DIR__,true).'img/main_icon.png';
153
                        $out['icon']  = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png';
154
 
154
 
155
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
155
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
156
                                $out['icon'] = 'img/error.png';
156
                                $out['icon'] = 'img/error.png';
157
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
157
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
158
                                return;
158
                                return;
Line 249... Line 249...
249
 
249
 
250
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
250
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
251
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
251
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
252
 
252
 
253
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
253
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
254
                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
254
                        $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png';
255
                } else {
255
                } else {
256
                        $tree_icon = null; // default icon (folder)
256
                        $tree_icon = null; // default icon (folder)
257
                }
257
                }
258
 
258
 
259
                $json[] = array(
259
                $json[] = array(