Subversion Repositories oidplus

Rev

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

Rev 1375 Rev 1422
Line 291... Line 291...
291
                                } else if (version_compare($local_installation, $newest_version) >= 0) {
291
                                } else if (version_compare($local_installation, $newest_version) >= 0) {
292
                                        $out['text'] .= '<p><font color="green">'._L('You are already using the latest version of OIDplus.').'</font></p>';
292
                                        $out['text'] .= '<p><font color="green">'._L('You are already using the latest version of OIDplus.').'</font></p>';
293
                                        $out['text'] .= '</div>';
293
                                        $out['text'] .= '</div>';
294
                                } else {
294
                                } else {
295
                                        if (($installType === 'svn-wc') || ($installType === 'git-wc')) {
295
                                        if (($installType === 'svn-wc') || ($installType === 'git-wc')) {
-
 
296
                                                if ($installType === 'svn-wc') {
-
 
297
                                                        $shell_diff_cmd = 'svn stat';
-
 
298
                                                } else if ($installType === 'git-wc') {
-
 
299
                                                        $shell_diff_cmd = 'git status -s';
-
 
300
                                                } else {
-
 
301
                                                        $shell_diff_cmd = '';
-
 
302
                                                }
-
 
303
 
-
 
304
                                                $can_access_shell = true;
-
 
305
                                                if ($shell_diff_cmd) {
-
 
306
                                                        $cout = [];
-
 
307
                                                        exec("svn stat", $cout, $ec);
-
 
308
                                                        if ($ec === 0) {
-
 
309
                                                                // TODO: should this also be shown when there is no update available?
-
 
310
                                                                if (trim(implode('',$cout)) !== '') {
-
 
311
                                                                        $out['text'] .= '<p><font color="red">'._L('WARNING: There are changes in your working copy which WILL be reverted if you continue!').'</font></p>';
-
 
312
                                                                        $out['text'] .= '<p><font color="red">'._L('Detected changes:').'</font></p>';
-
 
313
                                                                        $out['text'] .= '<p><font color="red"><pre>'.htmlentities(implode("\n",$cout)).'</pre></font></p>';
-
 
314
                                                                } else {
-
 
315
                                                                        $out['text'] .= '<p><font color="green">'._L('Working copy is clean.').'</font></p>';
-
 
316
                                                                }
-
 
317
                                                        } else {
-
 
318
                                                                $can_access_shell = false;
-
 
319
                                                        }
-
 
320
                                                }
-
 
321
 
296
                                                $out['text'] .= '<p><font color="blue">'._L('Please enter %1 into the SSH shell to update OIDplus to the latest version.','<code>'.$updateCommand.'</code>').'</font></p>';
322
                                                $out['text'] .= '<p><font color="blue">'._L('Please enter %1 into the SSH shell to update OIDplus to the latest version.','<code>'.$updateCommand.'</code>').'</font></p>';
-
 
323
                                                if ($can_access_shell) {
297
                                                $out['text'] .= '<p>'._L('Alternatively, click this button to execute the command through the web-interface (command execution and write permissions required).').'</p>';
324
                                                        $out['text'] .= '<p>'._L('Alternatively, click this button to execute the command through the web-interface (command execution and write permissions required).').'</p>';
298
                                        }
325
                                                }
-
 
326
                                        }
299
 
327
 
300
                                        $out['text'] .= '<p><input type="button" onclick="OIDplusPageAdminSoftwareUpdate.doUpdateOIDplus('.((int)substr($local_installation,4)+1).', '.substr($newest_version,4).')" value="'._L('Update NOW').'"></p>';
328
                                        $out['text'] .= '<p><input type="button" onclick="OIDplusPageAdminSoftwareUpdate.doUpdateOIDplus('.((int)substr($local_installation,4)+1).', '.substr($newest_version,4).')" value="'._L('Update NOW').'"></p>';
301
 
329
 
302
                                        // TODO: Open "system_file_check" without page reload.
330
                                        // TODO: Open "system_file_check" without page reload.
303
                                        // TODO: Only show link if the plugin is installed
331
                                        // TODO: Only show link if the plugin is installed