refresh githash.txt on login screen, removed cronjob githash.php part 2
This commit is contained in:
@@ -571,7 +571,7 @@ class Acl
|
||||
public function Login()
|
||||
{
|
||||
|
||||
include dirname(__DIR__).'/../cronjobs/githash.php';
|
||||
$this->refresh_githash();
|
||||
include dirname(__DIR__).'/../version.php';
|
||||
$this->app->Tpl->Set('XENTRALVERSION',"V.".$version_revision);
|
||||
|
||||
@@ -1297,4 +1297,22 @@ Allow from all
|
||||
// HTACCESS SECURITY END
|
||||
}
|
||||
|
||||
function refresh_githash() {
|
||||
$path = '../.git/';
|
||||
if (!is_dir($path)) {
|
||||
return;
|
||||
}
|
||||
$head = trim(file_get_contents($path . 'HEAD'));
|
||||
$refs = trim(substr($head,0,4));
|
||||
if ($refs == 'ref:') {
|
||||
$ref = substr($head,5);
|
||||
$hash = trim(file_get_contents($path . $ref));
|
||||
} else {
|
||||
$hash = $head;
|
||||
}
|
||||
if (!empty($hash)) {
|
||||
file_put_contents("../githash.txt", $hash);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user