TASK-208 Add validation for create log file
This commit is contained in:
@@ -656,12 +656,11 @@ class AuthSources
|
|||||||
|
|
||||||
private function log($link, $text)
|
private function log($link, $text)
|
||||||
{
|
{
|
||||||
$logFile = PATH_DATA . 'logs/ldapAdvanced.log';
|
$logFile = PATH_DATA . 'logs/ldap.log';
|
||||||
|
|
||||||
// Validate log file exists and is writable
|
|
||||||
if (!file_exists($logFile)) {
|
if (!file_exists($logFile)) {
|
||||||
error_log('Log file does not exist: ' . $logFile);
|
file_put_contents($logFile, "Start\n");
|
||||||
throw new Exception('Log file does not exist: ' . $logFile);
|
@chmod($logFile, 0644);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_writable($logFile)) {
|
if (!is_writable($logFile)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user