Changeset 600 for trunk/Modules/Log/Log.php
- Timestamp:
- Nov 25, 2013, 9:48:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Log/Log.php
r597 r600 54 54 define('LOG_TYPE_CZWOW', 13); 55 55 define('LOG_TYPE_ADMINISTRATION', 14); 56 define('LOG_TYPE_PAGE_NOT_FOUND', 15); 56 57 57 58 // TODO: Change global function to module class local method … … 193 194 $PageList['Output']; 194 195 if($this->System->User->Licence(LICENCE_ADMIN)) 195 $Output .= '<div><a href="'.$this->System->Link('/log.php?a=delerrlog').'">Vymázání chybových záznamů</a></div>'; 196 { 197 $Output .= '<div>Vymazat: <a href="'.$this->System->Link('/log.php?a=delerrlog&type='.LOG_TYPE_ERROR).'">Chybové záznamy</a> '. 198 '<a href="'.$this->System->Link('/log.php?a=delerrlog&type='.LOG_TYPE_PAGE_NOT_FOUND).'">Neznámé stránky</a></div>'; 199 } 196 200 } else $Output .= ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL); 197 201 … … 201 205 function DeleteErrorLog() 202 206 { 203 if($this->System->User->Licence(LICENCE_ADMIN)) 207 if($this->System->User->Licence(LICENCE_ADMIN) and 208 (($_GET['type'] == LOG_TYPE_ERROR) or ($_GET['type'] == LOG_TYPE_PAGE_NOT_FOUND))) 204 209 { 205 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR); 210 $DbResult = $this->System->Database->select('LogType', '*', 'Id='.$_GET['type']); 211 $LogType = $DbResult->fetch_assoc(); 212 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Log` WHERE `Type`='.$_GET['type']); 206 213 $DbRow = $DbResult->fetch_row(); 207 $this->System->Database->query('DELETE FROM `Log` WHERE `Type`='. LOG_TYPE_ERROR);208 $this->System->ModuleManager->Modules['Log']->WriteLog('Vymazán y chybové záznamy', LOG_TYPE_ADMINISTRATION);209 $Output = ShowMessage('Smazáno všech '.$DbRow[0].' chybových záznamů.');214 $this->System->Database->query('DELETE FROM `Log` WHERE `Type`='.$_GET['type']); 215 $this->System->ModuleManager->Modules['Log']->WriteLog('Vymazáno záznamů z '.$LogType['Description'].'.', LOG_TYPE_ADMINISTRATION); 216 $Output = ShowMessage('Smazáno všech '.$DbRow[0].' záznamů z '.$LogType['Description'].'.'); 210 217 $Output .= $this->ShowList(); 211 218 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.