|
|
@@ -361,6 +361,12 @@ class DBG {
|
|
|
}
|
|
|
|
|
|
public static function isLogActiveByAdmin() {
|
|
|
+ static $_isLogActiveByAdmin = null;
|
|
|
+ if (null !== $_isLogActiveByAdmin) return $_isLogActiveByAdmin;
|
|
|
+ $_isLogActiveByAdmin = self::_isLogActiveByAdmin();
|
|
|
+ return $_isLogActiveByAdmin;
|
|
|
+ }
|
|
|
+ public static function _isLogActiveByAdmin() {
|
|
|
if (!User::logged()) return false;
|
|
|
if (!User::getID()) return false;
|
|
|
return self::hasUserDebug(User::getID());
|
|
|
@@ -368,7 +374,7 @@ class DBG {
|
|
|
public static function hasUserDebug($idUser, $idAdmin = null) {
|
|
|
$prefix = ('production' == V::get('P5_ENV', 'production', $_SERVER)) ? "" : "dev-";
|
|
|
if (!$idAdmin) {
|
|
|
- $output = (int)@shell_exec("ls -1 /tmp/{$prefix}se-user_debug-{$idUser}-by_admin-*.log | wc -l");
|
|
|
+ $output = (int)@shell_exec("ls -1 /tmp/{$prefix}se-user_debug-{$idUser}-by_admin-*.log 2>/dev/null | wc -l");
|
|
|
return $output > 0;
|
|
|
}
|
|
|
return file_exists("/tmp/{$prefix}se-user_debug-{$idUser}-by_admin-{$idAdmin}.log");
|