Check updates
This commit is contained in:
@@ -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&');
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user