diff options
author | Andrew Dolgov <[email protected]> | 2012-08-23 22:53:32 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-23 22:56:04 +0400 |
commit | 808dd053c6b14822b544ac0e76292f7d74445ec2 (patch) | |
tree | 0266980009a93496fd756d883849fef994d90f2b /classes | |
parent | 12806125152712ca04d42701cad473d51684801e (diff) |
implement web-based self updater (closes #395)
Diffstat (limited to 'classes')
-rw-r--r-- | classes/pref/prefs.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 5b472d5a9..576dd2f03 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -524,23 +524,28 @@ class Pref_Prefs extends Handler_Protected { print "<div class='error'>".__("Do not close this dialog until updating is finished. Backup your tt-rss directory before continuing.")."</div>"; - print "<pre class='selfUpdateList' id='self_update_log'>"; - print __("Ready to update.")."\n"; - print "</pre>"; + print "<ul class='selfUpdateList' id='self_update_log'>"; + print "<li>" . __("Ready to update.") . "</li>"; + print "</ul>"; print "<div class='dlgButtons'>"; print "<button id=\"self_update_start_btn\" dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('updateSelfDlg').start()\" >". __("Start update")."</button>"; - print "<button onclick=\"return dijit.byId('updateSelfDlg').close()\" dojoType=\"dijit.form.Button\">". + print "<button id=\"self_update_stop_btn\" onclick=\"return dijit.byId('updateSelfDlg').close()\" dojoType=\"dijit.form.Button\">". __("Close this window")."</button>"; print "</div>"; print "</form>"; } function performUpdate() { + $step = (int) $_REQUEST["step"]; + $params = json_decode($_REQUEST["params"], true); + $force = (bool) $_REQUEST["force"]; + if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) && CHECK_FOR_NEW_VERSION) { include "update_self.php"; - update_self($this->link, true); + + print json_encode(update_self_step($this->link, $step, $params, $force)); } } |