diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-29 14:27:24 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-29 14:27:24 +0000 |
commit | c942e6441b0b69ba3793f9668c1ae8bf8393cba5 (patch) | |
tree | 510295d1f2baec0b37eb2a07520c2230dd94b538 /mod/updateclient/start.php | |
parent | ba1ceb336c2ec35816342c38017e8f3700308155 (diff) | |
download | elgg-c942e6441b0b69ba3793f9668c1ae8bf8393cba5.tar.gz elgg-c942e6441b0b69ba3793f9668c1ae8bf8393cba5.tar.bz2 |
Update client gets updates
git-svn-id: https://code.elgg.org/elgg/trunk@1569 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/updateclient/start.php')
-rw-r--r-- | mod/updateclient/start.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/mod/updateclient/start.php b/mod/updateclient/start.php index 8e5a5a4f7..25f7ffe98 100644 --- a/mod/updateclient/start.php +++ b/mod/updateclient/start.php @@ -9,11 +9,16 @@ * @link http://elgg.com/ */ + $DEFAULT_UPDATE_SERVER; + /** * Client update initialisation. */ function updateclient_init() { + global $DEFAULT_UPDATE_SERVER; + + $DEFAULT_UPDATE_SERVER = 'http://updates.elgg.org/services/api/rest.php'; // Register a page handler, so we can have nice URLs register_page_handler('updateclient','updateclient_page_handler'); @@ -68,7 +73,7 @@ */ function updateclient_notify_message($subject, $message) { - notify_user(2,1,$subject,$message); + return send_admin_message($subject, $message); } /** @@ -78,17 +83,18 @@ */ function updateclient_check_core() { - global $CONFIG; + global $CONFIG, $DEFAULT_UPDATE_SERVER; // Phone home and check core $url = get_plugin_setting('updateserver', 'updateclient'); + if (!$url) $url = $DEFAULT_UPDATE_SERVER; $result = send_api_get_call($url, array('method' => 'elgg.system.getlatestversion'), array()); if (($result) && ($result->status == 0)) { $result = $result->result; - + include_once($CONFIG->url . "version.php"); if ( @@ -100,11 +106,11 @@ updateclient_notify_message( elgg_echo('updateclient:message:title'), sprintf(elgg_echo('updateclient:message:body'), - $release['release'], - $release['version'], - $release['codename'], - $release['url'], - $release['notes'] + $result['release'], + $result['version'], + $result['codename'], + $result['url'], + $result['notes'] ) ); |