TASK-208 Add validation for create log file
This commit is contained in:
@@ -656,12 +656,11 @@ class AuthSources
|
||||
|
||||
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)) {
|
||||
error_log('Log file does not exist: ' . $logFile);
|
||||
throw new Exception('Log file does not exist: ' . $logFile);
|
||||
file_put_contents($logFile, "Start\n");
|
||||
@chmod($logFile, 0644);
|
||||
}
|
||||
|
||||
if (!is_writable($logFile)) {
|
||||
|
||||
Reference in New Issue
Block a user