Check updates

This commit is contained in:
Gamonoid
2016-12-06 18:14:19 +01:00
parent ef72f8daa3
commit 7528e5eabd
2 changed files with 13 additions and 0 deletions

View File

@@ -31,3 +31,5 @@ if(!defined('WK_HTML_PATH')){
}
define('ALL_CLIENT_BASE_PATH', '/vagrant/deployment/clients/');
define('CHECK_UPDATE_URL', 'https://icehrm.com/a.php?a=checkUpdate&');

View File

@@ -95,6 +95,17 @@ if(empty($user)){
header("Location:".HOME_LINK_ADMIN);
}
if(defined('CHECK_UPDATE_URL')){
//Check for updates
$versionSplit = explode(".",VERSION);
$updateUrl = CHECK_UPDATE_URL."type=".$versionSplit[count($versionSplit) - 1].
"&cversion=".VERSION;
$updateData = file_get_contents($updateUrl);
if(!empty($updateData) && $updateData['status'] == "SUCCESS"){
SessionUtils::saveSessionObject('updateData', json_decode($updateData, true));
}
}
}else{
if(empty($user->default_module)){
header("Location:".HOME_LINK_OTHERS);