Exemple #1
0
 public static function cleanLog($blnClearAll = false)
 {
     global $_CONF;
     if (Setting::getValueByName("audit_enable")) {
         if ($blnClearAll) {
             $strSql = "DELETE FROM pcms_audit_log WHERE accountId = '%s'";
             $strSql = sprintf($strSql, $_CONF['app']['account']->getId());
         } else {
             $strDate = Date::toMySql(time() - 60 * 60 * 24 * Setting::getValueByName("audit_rotation"));
             $strSql = "DELETE FROM pcms_audit_log WHERE created < '%s' AND accountId = '%s'";
             $strSql = sprintf($strSql, $strDate, $_CONF['app']['account']->getId());
         }
         parent::select($strSql);
     }
 }
 public function duplicate()
 {
     self::$__object = "AuditLog";
     self::$__table = "pcms_audit_log";
     return parent::duplicate();
 }