Merge pull request #5435 from annando/htaccess

Automatically create a .htaccess when not existing
This commit is contained in:
Tobias Diekershoff 2018-07-21 07:48:15 +02:00 committed by GitHub
commit eded252a40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,6 +112,13 @@ class Cron
Config::set('system', 'last_cron_hourly', time()); Config::set('system', 'last_cron_hourly', time());
} }
// Ensure to have a .htaccess file.
// this is a precaution for systems that update automatically
$basepath = $a->get_basepath();
if (!file_exists($basepath . '/.htaccess')) {
copy($basepath . '/.htaccess-dist', $basepath . '/.htaccess');
}
// Poll contacts // Poll contacts
self::pollContacts($parameter, $generation); self::pollContacts($parameter, $generation);