Changeset 577 for trunk/Modules
- Timestamp:
- Sep 11, 2013, 10:37:54 PM (12 years ago)
- Location:
- trunk/Modules
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Dictionary/Dictionary.php
r569 r577 76 76 function DictionaryInsert() 77 77 { 78 global $User;79 80 78 $Output = ''; 81 if($ User->Licence(LICENCE_USER))79 if($this->System->User->Licence(LICENCE_USER)) 82 80 { 83 81 $Output .= '<form action="?action=save" method="post">'. … … 98 96 function DictionarySave() 99 97 { 100 global $User, $Config; 101 102 if($User->Licence(LICENCE_USER)) 98 if($this->System->User->Licence(LICENCE_USER)) 103 99 { 104 100 if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST)) … … 106 102 // Check if original text exists and determine entry id 107 103 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE '. 108 '`Text` = "'.$_POST['Original'].'" AND `Language`= '.$ Config['OriginalLanguage']);104 '`Text` = "'.$_POST['Original'].'" AND `Language`= '.$this->System->Config['OriginalLanguage']); 109 105 if($DbResult->num_rows > 0) 110 106 { … … 117 113 $Entry = $DbRow[0] + 1; 118 114 $this->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '. 119 '`User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", NULL, '.$ Config['OriginalLanguage'].');');115 '`User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", NULL, '.$this->System->Config['OriginalLanguage'].');'); 120 116 } 121 117 122 118 $DbResult = $this->Database->query('SELECT `Id` FROM `Dictionary` WHERE '. 123 '`Entry` = '.$Entry.' AND `Language`='.$_POST['Language'].' AND `User`='.$ User->Id);119 '`Entry` = '.$Entry.' AND `Language`='.$_POST['Language'].' AND `User`='.$this->System->User->Id); 124 120 if($DbResult->num_rows > 0) 125 121 { … … 129 125 } else 130 126 $this->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '. 131 '`User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$User->Id.', '.$_POST['Language'].')'); 127 '`User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'. 128 $_POST['Description'].'", '.$this->System->User->Id.', '.$_POST['Language'].')'); 132 129 $Output = ShowMessage('Záznam byl uložen!'); 133 130 } else $Output = ShowMessage('Nebyly zaslány všechny položky formuláře.', MESSAGE_CRITICAL); … … 138 135 function DictionaryRemove() 139 136 { 140 global $User; 141 142 if($User->Licence(LICENCE_USER)) 143 { 144 $this->Database->query('DELETE FROM `Dictionary` WHERE (`User`='.$User->Id.') AND (`Id`='.($_GET['id'] * 1).')'); 137 if($this->System->User->Licence(LICENCE_USER)) 138 { 139 $this->Database->query('DELETE FROM `Dictionary` WHERE (`User`='.$this->System->User->Id.') AND (`Id`='.($_GET['id'] * 1).')'); 145 140 $Output = ShowMessage('Záznam odstraněn.'); 146 141 } else $Output = ShowMessage('Nemáte oprávnění', MESSAGE_CRITICAL); … … 150 145 function DictionaryModify() 151 146 { 152 global $User, $Config; 153 154 if($User->Licence(LICENCE_USER)) 147 if($this->System->User->Licence(LICENCE_USER)) 155 148 { 156 149 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE `Id`='.($_GET['id'] * 1)); … … 159 152 $DbRow = $DbResult->fetch_assoc(); 160 153 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE (`User` IS NULL) '. 161 'AND (`Entry`='.$DbRow['Entry'].') AND (`Language`= '.$ Config['OriginalLanguage'].')');154 'AND (`Entry`='.$DbRow['Entry'].') AND (`Language`= '.$this->System->Config['OriginalLanguage'].')'); 162 155 $DbRow2 = $DbResult->fetch_assoc(); 163 156 $Output = '<form action="?action=save" method="post">'. … … 180 173 function DictionaryGroup() 181 174 { 182 global $ User, $TranslationTree;175 global $TranslationTree; 183 176 184 177 $Output = ''; … … 211 204 function DictionaryShow() 212 205 { 213 global $ User, $LanguageList, $Config;206 global $LanguageList; 214 207 215 208 $Output = '<form action="?" method="get" style="margin: 0px; padding: 0px;">'. … … 222 215 <input type="text" value="'.$Search.'" name="search" size="30" /> 223 216 <input type="submit" value="Vyhledat" />'; 224 if($User->Licence(LICENCE_USER)) $Output .= ' <a href="?action=insert">Vložit slovo</a>'; 217 if($this->System->User->Licence(LICENCE_USER)) 218 $Output .= ' <a href="?action=insert">Vložit slovo</a>'; 225 219 226 220 $Output .= '</td></tr>'. … … 252 246 '`T1`.`Entry`, `T2`.`Text` AS `Original`, `T1`.`Text` AS `Translated`, `T1`.`Description` '. 253 247 'FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` '. 254 'ON (`T2`.`Entry` = `T1`.`Entry`) AND (`T2`.`Language` = '.$ Config['OriginalLanguage'].') '.248 'ON (`T2`.`Entry` = `T1`.`Entry`) AND (`T2`.`Language` = '.$this->System->Config['OriginalLanguage'].') '. 255 249 'JOIN `Language` ON `Language`.`Id` = `T1`.`Language` '. 256 250 'JOIN `User` ON `User`.`ID` = `T1`.`User` '. … … 273 267 $TableColumns[] = array('Name' => 'Description', 'Title' => 'Popis'); 274 268 $TableColumns[] = array('Name' => 'UserName', 'Title' => 'Překladatel'); 275 if($ User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Akce');269 if($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Akce'); 276 270 $Order = GetOrderTableHeader($TableColumns, 'Original'); 277 271 $Output .= '<table class="BaseTable">'.$Order['Output']; … … 287 281 $Output .= '<td>'.$Line['Description'].'</td>'. 288 282 '<td><a href="user.php?user='.$Line['UserId'].'">'.$Line['UserName'].'</a></td>'; 289 if($ User->Licence(LICENCE_USER))290 { 291 if($Line['UserId'] == $ User->Id)283 if($this->System->User->Licence(LICENCE_USER)) 284 { 285 if($Line['UserId'] == $this->System->User->Id) 292 286 $Output .= '<td><a href="?action=remove&id='.$Line['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'. 293 287 ' <a href="?action=modify&id='.$Line['Id'].'">Upravit</a></td>'; … … 305 299 function Show() 306 300 { 307 global $LanguageList , $User;301 global $LanguageList; 308 302 309 303 $LanguageList = GetLanguageList(); … … 311 305 if(!isset($_SESSION['language'])) 312 306 { 313 if($ User->Licence(LICENCE_USER))307 if($this->System->User->Licence(LICENCE_USER)) 314 308 { 315 $_SESSION['language'] = $ User->Language;309 $_SESSION['language'] = $this->System->User->Language; 316 310 } else $_SESSION['language'] = ''; 317 311 } -
trunk/Modules/Export/Page.php
r572 r577 16 16 function ExportList() 17 17 { 18 global $User;19 20 18 $Output = '<a href="?Action=ViewList">Všechny</a>'; 21 if($ User->Licence(LICENCE_USER))19 if($this->System->User->Licence(LICENCE_USER)) 22 20 { 23 21 $Output .= ' <a href="?Action=ViewList&Filter=Others">Ostatních</a>'. … … 25 23 } 26 24 27 if($ User->Licence(LICENCE_USER))25 if($this->System->User->Licence(LICENCE_USER)) 28 26 $Output .= '<br/><div style="text-align: center;"><a href="?Action=Create">Vytvořit nový export</a></div><br/>'; 29 27 … … 31 29 if(array_key_exists('Filter', $_GET)) 32 30 { 33 if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$ User->Id;34 if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$ User->Id;31 if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id; 32 if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$this->System->User->Id; 35 33 } 36 34 … … 62 60 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=0">Zobrazit</a> '. 63 61 '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=7">Exportovat</a>'; 64 if($Export['User'] == $ User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>';65 if($ User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a>';62 if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 63 if($this->System->User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a>'; 66 64 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 67 65 '<td><a href="'.$this->System->Link('/user.php?user='.$Export['User']).'">'.$Export['UserName'].'</a></td>'. … … 80 78 function ExportCreate() 81 79 { 82 global $User; 83 84 if($User->Licence(LICENCE_USER)) 85 { 86 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id); 80 if($this->System->User->Licence(LICENCE_USER)) 81 { 82 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id); 87 83 $DbRow = $DbResult->fetch_row(); 88 84 if($DbRow[0] < $this->System->Config['MaxExportPerUser']) … … 101 97 function ExportCreateFinish() 102 98 { 103 global $User; 104 105 if($User->Licence(LICENCE_USER)) 99 if($this->System->User->Licence(LICENCE_USER)) 106 100 { 107 101 if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 108 102 { 109 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$ User->Id);103 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id); 110 104 $DbRow = $DbResult->fetch_row(); 111 105 if($DbRow[0] < $this->System->Config['MaxExportPerUser']) 112 106 { 113 $this->System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$ User->Id.', NOW(), 1, "'.$_POST['Description'].'")');107 $this->System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$this->System->User->Id.', NOW(), 1, "'.$_POST['Description'].'")'); 114 108 $ExportId = $this->System->Database->insert_id; 115 109 $Output = ShowMessage('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a>'); … … 125 119 function ExportDelete() 126 120 { 127 global $User; 128 129 if($User->Licence(LICENCE_USER)) 130 { 131 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$User->Id.')'); 121 if($this->System->User->Licence(LICENCE_USER)) 122 { 123 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$this->System->User->Id.')'); 132 124 if($DbResult->num_rows > 0) 133 125 { … … 149 141 function ExportViewTranslators() 150 142 { 151 global $TranslationTree , $User;143 global $TranslationTree; 152 144 153 145 $Output = ''; … … 155 147 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 156 148 $Export = $DbResult->fetch_assoc(); 157 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;149 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 158 150 else $Editable = false; 159 151 … … 251 243 function ExportViewGeneral() 252 244 { 253 global $User;254 255 245 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 256 246 $DisabledTextArea = array(false => ' readonly="yes"', true => ''); … … 258 248 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 259 249 $Export = $DbRows->fetch_assoc(); 260 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;250 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 261 251 else $Editable = false; 262 252 … … 291 281 function ExportViewLanguages() 292 282 { 293 global $TranslationTree , $User;283 global $TranslationTree; 294 284 295 285 $Output = ''; … … 297 287 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 298 288 $Export = $DbRows->fetch_assoc(); 299 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;289 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 300 290 else $Editable = false; 301 291 … … 382 372 function ExportViewGroups() 383 373 { 384 global $TranslationTree , $User;374 global $TranslationTree; 385 375 386 376 $Output = ''; … … 388 378 $DbRows = $this->System->Database->query('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 389 379 $Export = $DbRows->fetch_assoc(); 390 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;380 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 391 381 else $Editable = false; 392 382 … … 469 459 function ExportViewOutputFormat() 470 460 { 471 global $User;472 473 461 $Output = ''; 474 462 $DisabledInput = array(false => ' disabled="disabled"', true => ''); … … 479 467 { 480 468 $Export = $DbRows->fetch_assoc(); 481 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;469 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 482 470 else $Editable = false; 483 471 … … 516 504 function ExportViewVersion() 517 505 { 518 global $User;519 520 506 $Output = ''; 521 507 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 522 508 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 523 509 $Export = $DbRows->fetch_assoc(); 524 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;510 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 525 511 else $Editable = false; 526 512 -
trunk/Modules/FrontPage/FrontPage.php
r565 r577 28 28 function HandleLoginForm() 29 29 { 30 global $ User, $Message, $MessageType;30 global $Message, $MessageType; 31 31 32 32 if(array_key_exists('action', $_GET)) … … 36 36 if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST)) 37 37 { 38 $ User->Login($_POST['LoginUser'], $_POST['LoginPass']);39 if($ User->Role == LICENCE_ANONYMOUS)38 $this->System->User->Login($_POST['LoginUser'], $_POST['LoginPass']); 39 if($this->System->User->Role == LICENCE_ANONYMOUS) 40 40 { 41 41 $Message = 'Jméno nebo heslo bylo zadáno špatně.'; … … 43 43 } else 44 44 { 45 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$ User->Name.'</strong>!';45 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$this->System->User->Name.'</strong>!'; 46 46 $MessageType = MESSAGE_INFORMATION; 47 47 } … … 54 54 if($_GET['action'] == 'logout') 55 55 { 56 if($ User->Role != LICENCE_ANONYMOUS)56 if($this->System->User->Role != LICENCE_ANONYMOUS) 57 57 { 58 58 WriteLog('Odhlášení', LOG_TYPE_USER); 59 $ User->Logout();59 $this->System->User->Logout(); 60 60 $Message = 'Byl jsi odhlášen.'; 61 61 $MessageType = MESSAGE_INFORMATION; -
trunk/Modules/Import/Manage.php
r551 r577 95 95 function Show() 96 96 { 97 global $User;98 99 97 $Output = ''; 100 if($ User->Licence(LICENCE_ADMIN))98 if($this->System->User->Licence(LICENCE_ADMIN)) 101 99 { 102 100 if(array_key_exists('action', $_GET)) -
trunk/Modules/Log/Log.php
r569 r577 26 26 function DoAddItem($Message) 27 27 { 28 WriteLog($Message, LOG_TYPE_ERROR); 28 $this->WriteLog($Message, LOG_TYPE_ERROR); 29 } 30 31 function WriteLog($Text, $Type) 32 { 33 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 34 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 35 36 if(!is_null($this->System->User->Id)) $UserId = $this->System->User->Id; 37 else $UserId = 'NULL'; 38 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '. 39 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")'; 40 $this->System->Database->query($Query); 29 41 } 30 42 } -
trunk/Modules/Referrer/Referrer.php
r569 r577 57 57 function ShowList() 58 58 { 59 global $System, $User; 60 61 $Banner = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_big.jpg').'" '. 59 $Banner = '<a href="http://'.$this->System->Config['Web']['Host'].$this->System->Link('/').'">'. 60 '<img src="http://'.$this->System->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_big.jpg').'" '. 62 61 'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '. 63 62 'class="banner" height="60" width="468" /></a>'; 64 63 65 $BannerSmall = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_small.jpg').'" '. 64 $BannerSmall = '<a href="http://'.$this->System->Config['Web']['Host'].$this->System->Link('/').'">'. 65 '<img src="http://'.$this->System->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_small.jpg').'" '. 66 66 'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '. 67 67 'class="banner" height="31" width="88" /></a>'; … … 77 77 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />'; 78 78 79 if(!$ User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Show`=1) AND (`Parent` IS NULL)';79 if(!$this->System->User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Show`=1) AND (`Parent` IS NULL)'; 80 80 else $Where = ''; 81 81 $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '. … … 101 101 array('Name' => 'TotalHits', 'Title' => 'Příchodů'), 102 102 ); 103 if($ User->Licence(LICENCE_ADMIN))103 if($this->System->User->Licence(LICENCE_ADMIN)) 104 104 { 105 105 $TableColumns[] = array('Name' => 'Show', 'Title' => 'Viditelné'); … … 119 119 '<td>'.HumanDate($Line['MaxDateLast']).'</td>'. 120 120 '<td>'.$Line['TotalHits'].'</td>'; 121 if($ User->Licence(LICENCE_ADMIN))121 if($this->System->User->Licence(LICENCE_ADMIN)) 122 122 { 123 123 $Output .= … … 156 156 function Edit() 157 157 { 158 global $User; 159 160 if($User->Licence(LICENCE_ADMIN)) 158 if($this->System->User->Licence(LICENCE_ADMIN)) 161 159 { 162 160 if(array_key_exists('id', $_GET)) … … 182 180 function EditSave() 183 181 { 184 global $User; 185 186 if($User->Licence(LICENCE_ADMIN)) 182 if($this->System->User->Licence(LICENCE_ADMIN)) 187 183 { 188 184 if($_POST['Parent'] == '') $_POST['Parent'] = null; -
trunk/Modules/Team/Team.php
r575 r577 27 27 } 28 28 29 include_once(' img_level.php');29 include_once('../../img_level.php'); 30 30 31 31 class PageTeam extends Page … … 33 33 function ShowTeamList() 34 34 { 35 global $Config, $User;36 37 35 $Output = '<h3>Seznam překladatelských týmů</h3>'; 38 36 $Output .= 'Týmy jsou seskupení překladatelů, kteří se hlásí k něčemu společnému jako např. WoW serveru, způsobu překladu, ke stejnému hernímu spolku, aj. Být členem týmu samo o sobě nemá žádný zásadní důsledek a spíše to může pomoci se lépe orientovat mezi překladateli někomu, kdo sestavuje export.<br/>'; 39 37 40 if($ User->Licence(LICENCE_USER))38 if($this->System->User->Licence(LICENCE_USER)) 41 39 $Output .= '<br /><div style="text-align: center;"><a href="?action=create">Vytvořit překladatelský tým</a></div><br/>'; 42 40 … … 55 53 array('Name' => 'TimeCreate', 'Title' => 'Datum založení'), 56 54 ); 57 if($ User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Uživatelské akce');55 if($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Uživatelské akce'); 58 56 59 57 $Order = GetOrderTableHeader($TableColumns, 'NumberUser', 1); … … 75 73 '<td><a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a></td>'. 76 74 '<td>'.HumanDate($Team['TimeCreate']).'</td>'; 77 if($ User->Licence(LICENCE_USER))78 { 79 if($Team['Leader'] == $ User->Id) $Action = ' <a href="?action=modify&id='.$Team['Id'].'">Upravit</a>';75 if($this->System->User->Licence(LICENCE_USER)) 76 { 77 if($Team['Leader'] == $this->System->User->Id) $Action = ' <a href="?action=modify&id='.$Team['Id'].'">Upravit</a>'; 80 78 else $Action = ''; 81 if($Team['Id'] == $ User->Team) $Action = ' <a href="?action=leave">Opustit</a>';79 if($Team['Id'] == $this->System->User->Team) $Action = ' <a href="?action=leave">Opustit</a>'; 82 80 $Output .= '<td><a href="?action=gointeam&id='.$Team['Id'].'">Vstoupit</a>'.$Action.'</td>'; 83 81 } … … 92 90 function TeamJoin() 93 91 { 94 global $User; 95 96 if($User->Licence(LICENCE_USER)) 92 if($this->System->User->Licence(LICENCE_USER)) 97 93 { 98 94 if(array_key_exists('id', $_GET)) 99 95 { 100 $this->Database->query('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$ User->Id);96 $this->Database->query('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$this->System->User->Id); 101 97 $Output = ShowMessage('Vstoupil jsi do týmu.'); 102 98 WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], LOG_TYPE_USER); … … 116 112 function TeamCreateFinish() 117 113 { 118 global $User;119 120 114 $Output = ''; 121 if($ User->Licence(LICENCE_USER))115 if($this->System->User->Licence(LICENCE_USER)) 122 116 { 123 117 if(array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST)) … … 130 124 $this->Database->query('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`, `Leader`)'. 131 125 ' VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'. 132 $_POST['URL'].'", NOW(), '.$ User->Id.')');133 $this->Database->query('UPDATE `User` SET `Team` = '.$this->Database->insert_id.' WHERE `ID` = '.$ User->Id);126 $_POST['URL'].'", NOW(), '.$this->System->User->Id.')'); 127 $this->Database->query('UPDATE `User` SET `Team` = '.$this->Database->insert_id.' WHERE `ID` = '.$this->System->User->Id); 134 128 $Output .= ShowMessage('Překladatelský tým vytvořen.'); 135 129 WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], LOG_TYPE_USER); … … 146 140 function TeamModify() 147 141 { 148 global $User; 149 150 if($User->Licence(LICENCE_USER)) 142 if($this->System->User->Licence(LICENCE_USER)) 151 143 { 152 144 if(array_key_exists('id', $_GET)) 153 145 { 154 $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$ User->Id);146 $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$this->System->User->Id); 155 147 if($DbResult->num_rows > 0) 156 148 { … … 171 163 function TeamModifyFinish() 172 164 { 173 global $User;174 175 165 $Output = ''; 176 if($ User->Licence(LICENCE_USER))166 if($this->System->User->Licence(LICENCE_USER)) 177 167 { 178 168 if(array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST)) 179 169 { 180 $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$ User->Id);170 $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$this->System->User->Id); 181 171 if($DbResult->num_rows > 0) 182 172 { … … 200 190 function TeamCreate() 201 191 { 202 global $User; 203 204 if($User->Licence(LICENCE_USER)) 192 if($this->System->User->Licence(LICENCE_USER)) 205 193 { 206 194 $Output ='<form action="?action=finish_create" method="post">'. … … 217 205 function TeamShow() 218 206 { 219 global $User, $Config;220 221 207 $Output = ''; 222 208 if(array_key_exists('id', $_GET) and is_numeric($_GET['id'])) … … 243 229 'Popis: '.$Team['Description'].'<br /><br />'; 244 230 //$Output .= '<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> '; 245 if($ User->Licence(LICENCE_USER))231 if($this->System->User->Licence(LICENCE_USER)) 246 232 $Output .='<a href="?action=gointeam&id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />'; 247 233 $Output .='<fieldset><legend>Statistika</legend>'. 248 234 'Počet členů týmu: <a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a><br />'. 249 235 'Počet přeložených textů týmu: <strong>'.$Team['NumberTranslate'].'</strong><br />'. 250 'Průměrná úroveň překladatelů v týmu: <img src=" tmp/team/'.$Team['Name'].'/level.png" /><br /><br />'.251 '<strong>Stav dokončení týmu pro verzi '.$ Config['Web']['GameVersion'].'</strong><br />';252 253 $BuildNumber = GetBuildNumber($ Config['Web']['GameVersion']);236 'Průměrná úroveň překladatelů v týmu: <img src="'.$this->System->Link('/tmp/team/'.$Team['Name'].'/level.png').'" /><br /><br />'. 237 '<strong>Stav dokončení týmu pro verzi '.$this->System->Config['Web']['GameVersion'].'</strong><br />'; 238 239 $BuildNumber = GetBuildNumber($this->System->Config['Web']['GameVersion']); 254 240 255 241 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; … … 263 249 'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '. 264 250 'WHERE (`User` IN (SELECT `ID` FROM `User` WHERE `Team` = '.$Team['Id'].')) '. 265 'AND (`Complete` = 1) AND (`T`.`Language`!='.$ Config['OriginalLanguage'].') '.251 'AND (`Complete` = 1) AND (`T`.`Language`!='.$this->System->Config['OriginalLanguage'].') '. 266 252 'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 267 253 ') AS `C1`) AS `Translated`, '. 268 254 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 269 255 'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '. 270 'WHERE (`Language` = '.$ Config['OriginalLanguage'].') '.256 'WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].') '. 271 257 'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 272 258 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; … … 312 298 function TeamLeave() 313 299 { 314 global $User; 315 316 if($User->Licence(LICENCE_USER)) 317 { 318 $this->Database->query('UPDATE `User` SET `Team` = NULL WHERE `ID` = '.$User->Id); 300 if($this->System->User->Licence(LICENCE_USER)) 301 { 302 $this->Database->query('UPDATE `User` SET `Team` = NULL WHERE `ID` = '.$this->System->User->Id); 319 303 $Output = ShowMessage('Nyní nejste členem žádného týmu.'); 320 304 WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER); -
trunk/Modules/Translation/Form.php
r569 r577 30 30 function ShowForm() 31 31 { 32 global $ System, $Config, $User, $TranslationTree;32 global $TranslationTree; 33 33 34 34 $Output = ''; … … 43 43 $TextID = $_GET['ID'] * 1; 44 44 45 $DbResult = $ System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);45 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID); 46 46 $Line = $DbResult->fetch_assoc(); 47 47 if(!$Line) … … 49 49 $Output .= ShowMessage('Překlad nenalezen.', MESSAGE_CRITICAL); 50 50 } else 51 { 52 53 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1'); 51 { 52 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '. 53 '(`Language` = '.$this->System->Config['OriginalLanguage'].') AND '. 54 '(`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1'); 54 55 $LineAJ = $DbResult->fetch_assoc(); 55 56 if(!$LineAJ) … … 61 62 if($Line['User'] != '') 62 63 { 63 $IDUser = $ System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);64 $IDUser = $this->Database->query('SELECT * FROM `User` WHERE `ID` = '.$Line['User']); 64 65 $LineUser = $IDUser->fetch_array(); 65 66 } else … … 72 73 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 73 74 { 74 $DbResult = $ System->Database->query('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']);75 $DbResult = $this->Database->query('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']); 75 76 $Language = $DbResult->fetch_assoc(); 76 77 // echo $Language['Language'].' '.$Line['Take']; 77 78 78 $DbResult = $ System->Database->query('SELECT `Name` FROM `Language` WHERE `Id` ='.$Language['Language']);79 $DbResult = $this->Database->query('SELECT `Name` FROM `Language` WHERE `Id` ='.$Language['Language']); 79 80 $Lang = $DbResult->fetch_assoc(); 80 81 81 82 $Output .= 'Původní text: <strong>'. 82 83 84 83 ' ID <a href="form.php?group='.$GroupId.'&ID='.$Line['Take'].'">'.$Line['Take'].'</a></strong>'. 84 ' ('.$Lang['Name'].')'. 85 ' <br />'; 85 86 } 86 87 $Output .= 'Text: '; … … 95 96 '<br />'; 96 97 97 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`Complete` = 1)'); 98 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE '. 99 '(`Entry` = '.$Line['Entry'].') AND (`Language` <> '.$this->System->Config['OriginalLanguage'].') AND (`Complete` = 1)'); 98 100 $Version = $DbResult->fetch_row(); 99 101 $Version = $Version[0]; 100 102 if($Version > 0) 101 103 { 102 $Output .= '<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&user=0&state=2&entry='.$Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a> 104 $Output .= '<form action="comparison.php" method="get"><a href="TranslationList.php?group='. 105 $GroupId.'&user=0&state=2&entry='.$Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a> 103 106 <input type="hidden" name="group" value="'.$GroupId.'" /> 104 107 <input type="hidden" name="entry" value="'.$Line['Entry'].'" /> … … 107 110 <option value="-1">Vyberte text k porovnání</option> 108 111 <option value="-1">Zobrazit/porovnat všechny</option>'; 109 $DataID = $ System->Database->query('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].') AND (`Complete` = 1)');112 $DataID = $this->Database->query('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].') AND (`Complete` = 1)'); 110 113 while($Version = $DataID->fetch_array()) 111 114 { 112 if($Version['ID'] == $Line['Take']) $Output .= '<option value="'.$Version['ID'].'">'.$Version['ID'].' - '.$Version['User'].' (převzato)</option>'; 115 if($Version['ID'] == $Line['Take']) $Output .= '<option value="'. 116 $Version['ID'].'">'.$Version['ID'].' - '.$Version['User'].' (převzato)</option>'; 113 117 else 114 118 { … … 122 126 } else 123 127 { 124 $Output .= '<a href="TranslationList.php?group='.$GroupId.'&user=0&state=2&entry='.$Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a>'; 128 $Output .= '<a href="TranslationList.php?group='.$GroupId.'&user=0&state=2&entry='. 129 $Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a>'; 125 130 } 126 131 127 132 // Special characters: $B - New line, $N - Name, $C - profession 128 if($ User->Licence(LICENCE_USER))133 if($this->System->User->Licence(LICENCE_USER)) 129 134 { 130 135 $Output .= '<form action="save.php?group='.$GroupId.'" method="post"><div>'; … … 143 148 144 149 $Output .= '<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" /> 145 <input type="hidden" name="user" value="'.$ User->Id.'" />150 <input type="hidden" name="user" value="'.$this->System->User->Id.'" /> 146 151 <input type="hidden" name="ID" value="'.$TextID.'" /> 147 152 <table class="BaseTable"> … … 156 161 <td>'; 157 162 if($Line['Language'] <> 0) $Language = $Line['Language']; 158 else if($ User->Id != 0)159 { 160 $Language = $ User->Language;163 else if($this->System->User->Id != 0) 164 { 165 $Language = $this->System->User->Language; 161 166 } else $Language = 0; 162 if($ User->Licence(LICENCE_USER)) $Output .= WriteLanguages($Language);167 if($this->System->User->Licence(LICENCE_USER)) $Output .= WriteLanguages($Language); 163 168 else { 164 $DbResult3 = $ System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');169 $DbResult3 = $this->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1'); 165 170 if($DbResult3->num_rows > 0) 166 171 { … … 180 185 if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) { 181 186 //<span class="edit">barvou.</span> 182 $names = GetTranslatNames($Text, 0,array('Dictionary' => 'Text','TextCreature' => 'name'));187 $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextCreature' => 'name')); 183 188 } else { 184 $names = GetTranslatNames($Text, 0,array('Dictionary' => 'Text'));189 $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text')); 185 190 } 186 191 … … 190 195 if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) 191 196 { 192 if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR($Table == 'glue_strings')))197 if(($TextItem['Name'] == 'Text') and (($Table == 'global_strings') or ($Table == 'glue_strings'))) 193 198 $Output .= '<tr><th>'.$LineAJ['ShortCut'].'</th>'; 194 199 else $Output .= '<tr><th>'.$TextItem['Name'].'</th>'; 195 200 $Output .= '<td>'.str_replace("\n", '<br/>', $this->ColorNames(htmlspecialchars($LineAJ[$TextItem['Column']]),$names)).'</td> 196 201 <td>'; 197 if($User->Licence(LICENCE_USER)) $Output .= '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'; 202 if($this->System->User->Licence(LICENCE_USER)) 203 $Output .= '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'; 198 204 $Output .= htmlspecialchars($Line[$TextItem['Column']]); 199 if($ User->Licence(LICENCE_USER)) $Output .= '</textarea></td></tr>';205 if($this->System->User->Licence(LICENCE_USER)) $Output .= '</textarea></td></tr>'; 200 206 } 201 207 } else … … 204 210 } 205 211 $Output .= '</table></div>'; 206 if($ User->Licence(LICENCE_USER)) $Output .= '</form>';212 if($this->System->User->Licence(LICENCE_USER)) $Output .= '</form>'; 207 213 } 208 214 } … … 213 219 function Delete() 214 220 { 215 global $System, $User, $Config; 216 217 if($User->Licence(LICENCE_MODERATOR)) 221 if($this->System->User->Licence(LICENCE_MODERATOR)) 218 222 { 219 223 $TextID = $_GET['ID']; 220 $ System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> '.$Config['OriginalLanguage']);224 $this->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> '.$this->System->Config['OriginalLanguage']); 221 225 $Output = ShowMessage('Překlad byl smazán.'); 222 226 WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR); -
trunk/Modules/Translation/TranslationList.php
r561 r577 5 5 function ShowFilter($GroupId = 0) 6 6 { 7 global $ System, $TranslationTree, $Config;7 global $TranslationTree; 8 8 9 9 $Filter = array('SQL' => ''); … … 59 59 else $Selected = ''; 60 60 $Output .= '<option value="0"'.$Selected.'>Všechny</option>'; 61 $DbResult = $ System->Database->query('SELECT `Id`,`Name` FROM `Group` ORDER BY `Name`');61 $DbResult = $this->Database->query('SELECT `Id`,`Name` FROM `Group` ORDER BY `Name`'); 62 62 while($Group = $DbResult->fetch_assoc()) 63 63 { … … 72 72 if($Filter['Version'] != 0) 73 73 { 74 $DbResult = $ System->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE (`Imported` = 1) AND (`Id` ='.$Filter['Version'].')');74 $DbResult = $this->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE (`Imported` = 1) AND (`Id` ='.$Filter['Version'].')'); 75 75 if($DbResult->num_rows > 0) 76 76 { … … 83 83 else $Selected = ''; 84 84 $Output .= '<option value="0"'.$Selected.'>Všechny</option>'; 85 $DbResult = $ System->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE `Imported` = 1 ORDER BY `BuildNumber` DESC');85 $DbResult = $this->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE `Imported` = 1 ORDER BY `BuildNumber` DESC'); 86 86 while($Version = $DbResult->fetch_assoc()) 87 87 { … … 101 101 else $Selected = ''; 102 102 $Output .= '<option value="0"'.$Selected.'>Všechny</option>'; 103 $DbResult = $ System->Database->query('SELECT `Id`, `Name` FROM `Language` WHERE `Enabled` = 1 ORDER BY `Name`');103 $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `Language` WHERE `Enabled` = 1 ORDER BY `Name`'); 104 104 while($Language = $DbResult->fetch_assoc()) 105 105 { … … 118 118 else $Selected = ''; 119 119 $Output .= '<option value="0"'.$Selected.'>Všichni</option>'; 120 $DbResult = $ System->Database->query('SELECT `Id`, `Name` FROM `User` ORDER BY `Name`');120 $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `User` ORDER BY `Name`'); 121 121 while($User = $DbResult->fetch_assoc()) 122 122 { … … 153 153 { 154 154 if($Filter['State'] == 0) $Filter['SQL'] .= $UserFilter.$VersionFilter.''; 155 else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$ Config['OriginalLanguage'].') '.155 else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].') '. 156 156 'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '. 157 '(`Sub`.`Language` <> '.$ Config['OriginalLanguage'].')'.$LanguageFilter.$UserFilter.157 '(`Sub`.`Language` <> '.$this->System->Config['OriginalLanguage'].')'.$LanguageFilter.$UserFilter. 158 158 ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '. 159 159 '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 160 160 else if($Filter['State'] == 2) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Complete` = 1)'; 161 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$ Config['OriginalLanguage'].161 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage']. 162 162 ') AND (`T`.`Complete` = 0)'; 163 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$ Config['OriginalLanguage'].')';163 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].')'; 164 164 } 165 165 … … 191 191 function ShowTranslationList($Filter) 192 192 { 193 global $ System, $TranslationTree;193 global $TranslationTree; 194 194 195 195 $Output = $Filter['Output']; … … 208 208 209 209 // Get total item count 210 $DbResult = $ System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`');210 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`'); 211 211 $DbRow = $DbResult->fetch_row(); 212 212 $PageList = GetPageList($DbRow[0]); … … 226 226 $Order['Output']; 227 227 228 $DbResult = $ System->Database->query($Query.' '.$Order['SQL'].' '.$PageList['SQLLimit']);228 $DbResult = $this->Database->query($Query.' '.$Order['SQL'].' '.$PageList['SQLLimit']); 229 229 while($Line = $DbResult->fetch_assoc()) 230 230 { … … 243 243 function ShowGroupList($Filter) 244 244 { 245 global $ System, $TranslationTree;245 global $TranslationTree; 246 246 247 247 $Output = $Filter['Output']; … … 253 253 { 254 254 $Filter = $this->ShowFilter($Group['Id']); 255 $ID = $ System->Database->query('SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` AS `T` WHERE 1 '.$Filter['SQL']);255 $ID = $this->Database->query('SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` AS `T` WHERE 1 '.$Filter['SQL']); 256 256 $Line = $ID->fetch_row(); 257 257 $Output .= '<tr><td><a href="?group='.$Group['Id'].'">'.$Group['Name'].'</td><td>'.$Line[0].'</a></tr>'; … … 265 265 function ShowGroupTypeList() 266 266 { 267 global $System, $User; 268 269 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Group`'); 267 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Group`'); 270 268 $DbRow = $DbResult->fetch_row(); 271 269 $PageList = GetPageList($DbRow[0]); … … 285 283 $Output .= $Order['Output']; 286 284 287 $DbResult = $ System->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);285 $DbResult = $this->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 288 286 while($Group = $DbResult->fetch_assoc()) 289 287 { … … 297 295 $Output .= '</table>'. 298 296 '<br /><a title="Záznam změn po importu" href="log.php?type=11">Záznam změn v textech při importu</a><br/>'; 299 if($ User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">Přidat překladovou skupinu</a>';297 if($this->System->User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">Přidat překladovou skupinu</a>'; 300 298 return($Output); 301 299 } … … 303 301 function ShowMenu() 304 302 { 305 global $ User, $TranslationTree;303 global $TranslationTree; 306 304 307 305 $GroupId = GetParameter('group', 0, true); … … 321 319 '<td>Texty označené jako rozpracované.</td></tr>'; 322 320 323 if($ User->Licence(LICENCE_USER))321 if($this->System->User->Licence(LICENCE_USER)) 324 322 { 325 $Output .= '<tr><td><a title="Nedokončené texty" href="?group='.$GroupId.'&state=3&user='.$ User->Id.'">Moje nedokončené</a></td>323 $Output .= '<tr><td><a title="Nedokončené texty" href="?group='.$GroupId.'&state=3&user='.$this->System->User->Id.'">Moje nedokončené</a></td> 326 324 <td>Nedokončené texty přihlášeného uživatele</td></tr> 327 <tr><td><a title="Přeložené texty přihlášeného uživatele" href="?group='.$GroupId.'&state=2&user='.$ User->Id.'">Moje přeložené</a></td>325 <tr><td><a title="Přeložené texty přihlášeného uživatele" href="?group='.$GroupId.'&state=2&user='.$this->System->User->Id.'">Moje přeložené</a></td> 328 326 <td>Přeložené texty přihlášeného uživatele</td></tr>'; 329 327 } … … 348 346 function ShowGroupAdd() 349 347 { 350 global $User; 351 352 if($User->Licence(LICENCE_ADMIN)) 348 if($this->System->User->Licence(LICENCE_ADMIN)) 353 349 { 354 350 $Output = '<h3>Vložení nové překladové skupiny</h3>'. … … 368 364 function ShowGroupAddFinish() 369 365 { 370 global $User; 371 372 if($User->Licence(LICENCE_ADMIN)) 366 if($this->System->User->Licence(LICENCE_ADMIN)) 373 367 { 374 368 // TODO: Add group items manipulation oprations -
trunk/Modules/User/Options.php
r569 r577 5 5 function UserOptionsFrom() 6 6 { 7 global $User;8 9 7 $Output = '<form action="Options.php?action=save" method="post"> 10 8 <fieldset><legend>Nastavení uživatele</legend> 11 9 <table> 12 <tr><td>Email:</td><td><input type="text" name="Email" value="'.$ User->Email.'" /></td></tr>10 <tr><td>Email:</td><td><input type="text" name="Email" value="'.$this->System->User->Email.'" /></td></tr> 13 11 <tr><td>Původní heslo:</td><td><input type="password" name="OldPass" /></td></tr> 14 12 <tr><td>Nové heslo:</td><td><input type="password" name="NewPass" /></td></tr> 15 13 <tr><td>Nové heslo pro potvrzení: </td><td><input type="password" name="NewPass2" /></td></tr> 16 <tr><td>Normálně budu překládat do: </td><td>'.WriteLanguages($ User->Language).'</td></tr>14 <tr><td>Normálně budu překládat do: </td><td>'.WriteLanguages($this->System->User->Language).'</td></tr> 17 15 <tr><td>Po uložení překladu přesměrovat: </td><td>'; 18 16 $Output .= '<select name="redirecting">'. 19 17 '<option value="0">Nikam</option>'. 20 18 '<option value="1"'; 21 if($ User->Redirecting == '1') $Output .= ' selected="selected"';19 if($this->System->User->Redirecting == '1') $Output .= ' selected="selected"'; 22 20 $Output .= '>Na nepřeložené</option>'; 23 21 $Output .= '<option value="2"'; 24 if($ User->Redirecting == '2') $Output .= ' selected="selected"';22 if($this->System->User->Redirecting == '2') $Output .= ' selected="selected"'; 25 23 $Output .= '>Na další překlad</option>'; 26 24 $Output .= '<option value="3"'; 27 if($ User->Redirecting == '3') $Output .= ' selected="selected"';25 if($this->System->User->Redirecting == '3') $Output .= ' selected="selected"'; 28 26 $Output .= '>Na předchozí překlad</option>'; 29 27 $Output .= '</select>'; 30 28 31 29 $Output .= '</td></tr>'. 32 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection($ User->PreferredVersion).'</td></tr>'.30 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection($this->System->User->PreferredVersion).'</td></tr>'. 33 31 '<tr><td>Veřejný text profilu:</td><td>'. 34 '<textarea name="info" cols="60" rows="10">'.$ User->Info.'</textarea></td></tr>'.32 '<textarea name="info" cols="60" rows="10">'.$this->System->User->Info.'</textarea></td></tr>'. 35 33 '<tr><td colspan="2"><input type="submit" value="Uložit" /></td></tr>'. 36 34 '</table></fieldset>'. … … 47 45 { 48 46 $Output .= '<option value="'.$LineTeam['Id'].'"'; 49 if ($LineTeam['Id'] == $ User->Team) $Output .= ' selected="selected"';47 if ($LineTeam['Id'] == $this->System->User->Team) $Output .= ' selected="selected"'; 50 48 $Output .= '>'.$LineTeam['Name'].'</option>'; 51 49 } … … 58 56 function UserOptionsSave() 59 57 { 60 global $User;61 62 58 $Output = ''; 63 59 if(array_key_exists('Email', $_POST)) … … 78 74 if($NewPass == $NewPass2) 79 75 { 80 $DbResult = $System->Database->query('SELECT `Pass`, '.$ User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id);76 $DbResult = $System->Database->query('SELECT `Pass`, '.$this->System->User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$this->System->User->Id); 81 77 $DbRow = $DbResult->fetch_assoc(); 82 78 if($DbRow['Hash'] == $DbRow['Pass']) 83 79 { 84 80 // Update password 85 $Salt = $ User->GetPasswordSalt();86 $this->Database->query('UPDATE `User` SET `Pass` = '.$ User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id);81 $Salt = $this->System->User->GetPasswordSalt(); 82 $this->Database->query('UPDATE `User` SET `Pass` = '.$this->System->User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$this->System->User->Id); 87 83 $Output .= ShowMessage('Heslo změněno.'); 88 84 } else $Output .= ShowMessage('Staré heslo neodpovídá.', MESSAGE_CRITICAL); 89 85 } else $Output .= ShowMessage('Hesla se neshodují.', MESSAGE_CRITICAL); 90 86 } 91 $this->Database->update('User', '`ID` = '.$ User->Id, array('Email' => $Email,92 93 94 $Output .= ShowMessage('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$ User->Name.'</b>');87 $this->Database->update('User', '`ID` = '.$this->System->User->Id, array('Email' => $Email, 88 'Language' => $Language, 'Redirecting' => $Redirecting, 'Info' => $Info, 89 'PreferredVersion' => $PreferredVersion)); 90 $Output .= ShowMessage('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$this->System->User->Name.'</b>'); 95 91 WriteLog('Úprava nastavení!', LOG_TYPE_USER); 96 $ User->Load();92 $this->System->User->Load(); 97 93 } else $Output .= ShowMessage('Nezadány údaje.', MESSAGE_CRITICAL); 98 94 return($Output); -
trunk/Modules/User/Profile.php
r572 r577 5 5 function SendMail() 6 6 { 7 global $Config, $User;8 9 7 $Output = ''; 10 8 if(array_key_exists('text', $_POST)) 11 if($ User->Licence(LICENCE_ADMIN))9 if($this->System->User->Licence(LICENCE_ADMIN)) 12 10 { 13 11 $Text = $_POST['text']; … … 18 16 'Text: <strong>'.$Text.'</strong><br />'; 19 17 20 if(@mail($Email, $Subject, $Text, 'From: '.$ Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))18 if(@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].'\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) 21 19 { 22 20 $Output .= ShowMessage('Zpráva byla odeslána.'); -
trunk/Modules/User/User.php
r563 r577 21 21 function Start() 22 22 { 23 global $User; 24 23 25 $this->System->User = new User($this->System); 24 26 $this->System->RegisterPage('userlist.php', 'PageUserList'); 25 27 $this->System->RegisterPage('Options.php', 'PageUserOptions'); 26 28 $this->System->RegisterPage('registrace.php', 'PageUserRegistration'); … … 87 89 $this->Id = $User['ID']; 88 90 $this->Load(); 89 WriteLog('Login: '.$Name, LOG_TYPE_USER);91 $this->System->ModuleManager->Modules['Log']->WriteLog('Login: '.$Name, LOG_TYPE_USER); 90 92 $this->UpdateState(); 91 93 } else $this->Role = LICENCE_ANONYMOUS; -
trunk/Modules/User/UserList.php
r547 r577 1 1 <?php 2 2 3 4 include_once('img_level.php'); 3 include_once(dirname(__FILE__).'/../../img_level.php'); 5 4 6 5 class PageUserList extends Page
Note:
See TracChangeset
for help on using the changeset viewer.