Put a cache for noalyss version
This commit is contained in:
parent
39eb388b0b
commit
303edf25a9
2 changed files with 28 additions and 2 deletions
|
|
@ -4279,4 +4279,8 @@ function check_password_strength(p_pass_domid,p_result_domid,details)
|
|||
{
|
||||
alert_box(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
|
|
@ -102,7 +102,29 @@ if ( $version < DBVERSIONREPO )
|
|||
if ( $User->isAdmin() == 1)
|
||||
{
|
||||
if (SITE_UPDATE !="") {
|
||||
$update=@file_get_contents(SITE_UPDATE);
|
||||
$file=$_ENV['TMP']."/version_noalyss".domaine;
|
||||
if (file_exists($file)) {
|
||||
$date_time=new \DateTime();
|
||||
$file_tmstamp=filemtime($file);
|
||||
|
||||
$delta= $date_time->getTimestamp() - $file_tmstamp;
|
||||
// 172800 = 2 days in second
|
||||
if ( $delta > 172800 ) {
|
||||
$update=@file_get_contents(SITE_UPDATE);
|
||||
$f_file= fopen($file,"w+");
|
||||
fwrite($f_file,$update);
|
||||
fclose($f_file);
|
||||
} else {
|
||||
$update=@file_get_contents($file);
|
||||
}
|
||||
|
||||
} else {
|
||||
$update=@file_get_contents(SITE_UPDATE);
|
||||
$f_file= fopen($file,"w+");
|
||||
fwrite($f_file,$update);
|
||||
fclose($f_file);
|
||||
}
|
||||
|
||||
if ($update > $version_noalyss ) {
|
||||
echo '<div id="version_div" class="inner_box" style="width:25%;margin-left:10%;margin-top:3px;">';
|
||||
echo '<p class="notice">';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue