Changeset 816 for trunk/admin
- Timestamp:
- Feb 22, 2015, 11:20:50 PM (10 years ago)
- Location:
- trunk/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/DefaultConfig.php
r603 r816 25 25 'ShowSQLError' => $IsDeveloper, 26 26 'LogSQLQuery' => $IsDeveloper, 27 28 27 'ShowPHPError' => $IsDeveloper, 28 'ShowRuntimeInfo' => $IsDeveloper, 29 29 'FormatOutput' => $IsDeveloper, 30 30 'ItemsPerPage' => 40, 31 31 'TempFolder' => 'tmp/', 32 32 'SourceFolder' => 'source/', 33 33 'GameVersion' => '3.3.5a', 34 34 'VisiblePagingItems' => 20, 35 35 'Timezone' => 'Europe/Prague', … … 39 39 ), 40 40 'ForbiddedUserNames' => array('addon', 'admin', 'administrator'), 41 41 'ExportTaskProcessPeriod' => 10, 42 42 'MaxExportPerUser' => 10, 43 43 'AoWoWExportId' => 1, 44 'OriginalLanguage' => 1, 45 44 'OriginalLanguage' => 1, 45 'SystemPassword' => '', 46 46 ); -
trunk/admin/UpdateTrace.php
r811 r816 2524 2524 $Manager->Execute('ALTER TABLE `User` ADD INDEX ( `PreferredVersion` )'); 2525 2525 $Manager->Execute('ALTER TABLE `User` ADD FOREIGN KEY ( `PreferredVersion` ) '. 2526 2526 'REFERENCES `ClientVersion` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;'); 2527 2527 $Manager->Execute('ALTER TABLE `User` ADD `Info` TEXT NOT NULL'); 2528 2528 } … … 2571 2571 { 2572 2572 $Manager->Execute('CREATE TABLE IF NOT EXISTS `WikiPage` ( 2573 2574 2575 2576 2577 2578 2579 2573 `Id` int(11) NOT NULL AUTO_INCREMENT, 2574 `Name` varchar(255) NOT NULL, 2575 `NormalizedName` varchar(255) NOT NULL, 2576 `VisibleInMenu` int(11) NOT NULL, 2577 PRIMARY KEY (`Id`), 2578 UNIQUE KEY `Name` (`Name`), 2579 KEY `VisibleInMenu` (`VisibleInMenu`) 2580 2580 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 2581 2581 2582 2582 $Manager->Execute('CREATE TABLE IF NOT EXISTS `WikiPageContent` ( 2583 2584 2585 2586 2587 2588 2589 2590 2583 `Id` int(11) NOT NULL AUTO_INCREMENT, 2584 `Page` int(11) NOT NULL, 2585 `Time` datetime NOT NULL, 2586 `Content` text NOT NULL, 2587 `User` int(11) NOT NULL, 2588 PRIMARY KEY (`Id`), 2589 KEY `User` (`User`), 2590 KEY `Page` (`Page`) 2591 2591 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 2592 2592 … … 2611 2611 function UpdateTo600($Manager) 2612 2612 { 2613 2613 $Manager->Execute("INSERT INTO `LogType` (`Id` ,`Name` ,`Color` ,`Description`) 2614 2614 VALUES (NULL , 'Nenalezené', 'teal', 'Nenalezené stránky');"); 2615 2615 } … … 2617 2617 function UpdateTo604($Manager) 2618 2618 { 2619 2619 $Manager->Execute("INSERT INTO `ClientVersion` (`Id` ,`Version` ,`BuildNumber` ,`ReleaseDate` ,`Title` ,`Imported`) 2620 2620 VALUES ( NULL , '5.2.0', '16650', '2013-03-05', 'The Thunder King', 0 2621 2621 ), ( NULL , '5.3.0', '16977', '2013-05-21', 'Escalation', 0 … … 2651 2651 function UpdateTo639($Manager) 2652 2652 { 2653 2653 $Manager->Execute('ALTER TABLE `ServerList` ADD `ClientVersion` INT NOT NULL , 2654 2654 ADD INDEX ( `ClientVersion` ) ;'); 2655 2655 $Manager->Execute('ALTER TABLE `ServerList` ADD FOREIGN KEY ( `ClientVersion` ) REFERENCES `ClientVersion` ( … … 2667 2667 function UpdateTo646($Manager) 2668 2668 { 2669 2669 $Manager->Execute('ALTER TABLE `Export` ADD `AllUsers` TINYINT( 1 ) NOT NULL ;'); 2670 2670 2671 2671 } … … 2673 2673 function UpdateTo666($Manager) 2674 2674 { 2675 2676 2675 $Manager->Execute('INSERT INTO `ExportOutputType` (`Id` ,`Name`) VALUES (\'10\' , \'Instalace - Instalační soubor pro klienta\');'); 2676 $Manager->Execute('INSERT INTO `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL , \'10\', \'84\');'); 2677 2677 } 2678 2678 2679 2679 function UpdateTo678($Manager) 2680 2680 { 2681 2681 $Manager->Execute('INSERT INTO `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL , \'10\', \'11\');'); 2682 2682 } 2683 2683 2684 2684 function UpdateTo695($Manager) 2685 2685 { 2686 2686 $Manager->Execute('CREATE TABLE IF NOT EXISTS `ExportGroupItem` (`Id` int(11) NOT NULL AUTO_INCREMENT,'. 2687 2687 '`Export` int(11) NOT NULL,`GroupItem` int(11) NOT NULL, PRIMARY KEY (`Id`), KEY `Export` (`Export`),'. 2688 2688 ' KEY `GroupItem` (`GroupItem`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'); 2689 2689 $Manager->Execute('ALTER TABLE `ExportGroupItem`'. 2690 2690 'ADD CONSTRAINT `ExportGroupItem_ibfk_1` FOREIGN KEY (`Export`) REFERENCES `Export` (`Id`),'. 2691 2691 'ADD CONSTRAINT `ExportGroupItem_ibfk_2` FOREIGN KEY (`GroupItem`) REFERENCES `GroupItem` (`Id`);'); … … 2694 2694 function UpdateTo712($Manager) 2695 2695 { 2696 2696 $Manager->Execute('CREATE TABLE IF NOT EXISTS `UserOnline` ( 2697 2697 `Id` int(11) NOT NULL AUTO_INCREMENT, 2698 2698 `User` int(11) DEFAULT NULL, … … 2711 2711 function UpdateTo716($Manager) 2712 2712 { 2713 2713 $Manager->Execute('ALTER TABLE `Export` ADD `Featured` TINYINT NOT NULL'); 2714 2714 } 2715 2715 2716 2716 function UpdateTo725($Manager) 2717 2717 { 2718 2718 $Manager->Execute('ALTER TABLE `UserOnline` ADD `StayLoggedHash` VARCHAR( 40 ) NOT NULL ;'); 2719 2719 } 2720 2720 2721 2721 function UpdateTo731($Manager) 2722 2722 { 2723 2723 $Manager->Execute('ALTER TABLE `ExportTask` ADD `Progress` TINYINT NOT NULL ;'); 2724 2724 } 2725 2725 2726 2726 function UpdateTo732($Manager) 2727 2727 { 2728 2728 $Manager->Execute('ALTER TABLE `ExportTask` CHANGE `Progress` `Progress` DOUBLE( 4, 2 ) NOT NULL ;'); 2729 2729 } 2730 2730 … … 2817 2817 2818 2818 $Updates = array( 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2819 498 => array('Revision' => 506, 'Function' => 'UpdateTo506'), 2820 506 => array('Revision' => 510, 'Function' => 'UpdateTo510'), 2821 510 => array('Revision' => 524, 'Function' => 'UpdateTo524'), 2822 524 => array('Revision' => 537, 'Function' => 'UpdateTo537'), 2823 537 => array('Revision' => 539, 'Function' => 'UpdateTo539'), 2824 539 => array('Revision' => 543, 'Function' => 'UpdateTo543'), 2825 543 => array('Revision' => 567, 'Function' => 'UpdateTo567'), 2826 567 => array('Revision' => 574, 'Function' => 'UpdateTo574'), 2827 574 => array('Revision' => 585, 'Function' => 'UpdateTo585'), 2828 585 => array('Revision' => 600, 'Function' => 'UpdateTo600'), 2829 600 => array('Revision' => 604, 'Function' => 'UpdateTo604'), 2830 604 => array('Revision' => 609, 'Function' => 'UpdateTo609'), 2831 609 => array('Revision' => 610, 'Function' => 'UpdateTo610'), 2832 610 => array('Revision' => 639, 'Function' => 'UpdateTo639'), 2833 639 => array('Revision' => 646, 'Function' => 'UpdateTo646'), 2834 646 => array('Revision' => 666, 'Function' => 'UpdateTo666'), 2835 666 => array('Revision' => 678, 'Function' => 'UpdateTo678'), 2836 678 => array('Revision' => 695, 'Function' => 'UpdateTo695'), 2837 695 => array('Revision' => 712, 'Function' => 'UpdateTo712'), 2838 712 => array('Revision' => 716, 'Function' => 'UpdateTo716'), 2839 716 => array('Revision' => 725, 'Function' => 'UpdateTo725'), 2840 725 => array('Revision' => 731, 'Function' => 'UpdateTo731'), 2841 731 => array('Revision' => 732, 'Function' => 'UpdateTo732'), 2842 732 => array('Revision' => 748, 'Function' => 'UpdateTo748'), 2843 2843 748 => array('Revision' => 787, 'Function' => 'UpdateTo787'), 2844 2844 787 => array('Revision' => 803, 'Function' => 'UpdateTo803'), -
trunk/admin/index.php
r734 r816 10 10 { 11 11 global $System, $Config; 12 13 14 $Output = '<h3>Volby pro správu</h3>'; 15 12 13 14 $Output = '<h3>Volby pro správu</h3>'; 15 16 16 $Output .= '<br />'. 17 17 '<a href="https://'.$Config['Web']['Host'].'/phpmyadmin/">Správa databáze</a><br/>'. … … 22 22 '<small>Procházení všech systémových záznamů akcí a událostí</small><br/><br/>'. 23 23 '<a href="'.$System->Link('/admin/?action=img_level').'">Generování obrázků úrovní překladatelů</a><br/>'. 24 '<small>Ihned provede přegenerování všech obrázků úrovní překladatelů</small><br/><br/>'. 24 '<small>Ihned provede přegenerování všech obrázků úrovní překladatelů</small><br/><br/>'. 25 25 '<a href="'.$System->Link('/news/?a=add').'">Přidání aktuality</a><br/>'. 26 '<small>Přidá aktualitu na hlavní stranu projektu</small><br/><br/>'. 26 '<small>Přidá aktualitu na hlavní stranu projektu</small><br/><br/>'. 27 27 '<a href="'.$System->Link('/admin/?action=testing').'">Testování</a><br/>'. 28 '<small>Testovací funkce</small><br/><br/>'. 28 '<small>Testovací funkce</small><br/><br/>'. 29 29 '<a href="'.$System->Link('/admin/?action=locale').'">Exportovat překlad rozhraní</a><br/>'. 30 30 '<small>Exportovat texty z PHP souborů pro překlad rozhraní</small><br/><br/>'. 31 31 '<a href="'.$System->Link('/admin/?action=uncomplete').'">Nastavit nekompletní texty</a><br/>'. 32 '<small>Nastaví questy, které jsou v popisu nebo objektu stejné jako nedokončené</small><br/><br/>'. 32 '<small>Nastaví questy, které jsou v popisu nebo objektu stejné jako nedokončené</small><br/><br/>'. 33 33 '<a href="'.$System->Link('/admin/?action=repairversion').'">Opravit špatně nastavené VersionEnd</a><br/>'. 34 '<small>Nastaví špatné version end a Take na originální text, které vzniklo v důsledku importu a špatně indexovaného indexu Take</small><br/><br/>'. 34 '<small>Nastaví špatné version end a Take na originální text, které vzniklo v důsledku importu a špatně indexovaného indexu Take</small><br/><br/>'. 35 35 '<a href="'.$System->Link('/admin/?action=dbcstructure').'">Připravit dbc strukturu</a><br/>'. 36 '<small>Otevře dbc soubory převedené do textové formy pro přípravu struktury pro import</small><br/><br/>'. 36 '<small>Otevře dbc soubory převedené do textové formy pro přípravu struktury pro import</small><br/><br/>'. 37 37 '<a href="'.$System->Link('/admin/?action=merge').'">Sjednocení textů</a><br/>'. 38 '<small>Sjednotí stejné originální texty v databázi</small><br/><br/>'; 38 '<small>Sjednotí stejné originální texty v databázi</small><br/><br/>'; 39 39 return($Output); 40 40 } … … 53 53 { 54 54 global $System; 55 56 $DbResult = $System->Database->query($Query); 55 56 $DbResult = $System->Database->query($Query); 57 57 } 58 58 59 59 function ShowPHPInfo() 60 60 { 61 return(phpinfo()); 61 return(phpinfo()); 62 62 } 63 63 … … 65 65 { 66 66 global $System; 67 67 68 68 $this->Title = T('Testing'); 69 69 $Output = '<a href="'.$System->Link('/admin/?action=phpinfo').'">PHP info</a><br/>'. … … 81 81 { 82 82 global $System; 83 84 85 .'`TextQuest` AS `gs_tran` ' 86 .'JOIN `TextQuest` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` ' 83 84 $DbResult = $System->Database->query('SELECT `gs_tran`.`ID`,`gs_tran`.`Details`,`gs_tran`.`Objectives` FROM ' 85 .'`TextQuest` AS `gs_tran` ' 86 .'JOIN `TextQuest` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` ' 87 87 .'AND `gs_orig`.`Language` =0 ' 88 88 .'WHERE `gs_tran`.`Language` !=0 ' … … 92 92 .' OR ( `gs_tran`.`Details` != `gs_orig`.`Details` AND "" = `gs_tran`.`Details` )' 93 93 .' OR (`gs_tran`.`Objectives` = `gs_orig`.`Objectives` AND "" != `gs_orig`.`Objectives` ))' 94 ); 94 ); 95 95 $Output = 'Questy: <br />'; 96 97 98 $Output .= $quest['ID'].', '; 99 100 96 while($quest = $DbResult->fetch_assoc()) 97 { 98 $Output .= $quest['ID'].', '; 99 $System->Database->query('UPDATE `TextQuest` SET `complete` = 0 WHERE ID='.$quest['ID']); 100 } 101 101 $Output .= '<br / ><br / >Questy nastaveny jako nedokončené!'; 102 102 return($Output); 103 } 103 } 104 104 105 105 function RepairVersionEnd() … … 107 107 global $System,$TranslationTree; 108 108 $Output = ''; 109 foreach($TranslationTree as $Group) 109 foreach($TranslationTree as $Group) 110 110 // $Group = $TranslationTree[1]; 111 111 { 112 112 113 113 $sql = 'SELECT `T`.`ID`,`T`.`Take`,`sub1`.`ID` as `origID`,T.`VersionStart`,T.`VersionEnd`,`sub1`.`VersionStart` as OrigStart,sub1.`VersionEnd` as `OrigEnd` FROM `'.$Group['TablePrefix'] .'` as `T` '. 114 114 ' JOIN `'.$Group['TablePrefix'].'` as `sub1` ON `sub1`.`Language` = 0 AND `T`.`Entry` = `sub1`.`Entry` AND `T`.`VersionStart` = `sub1`.`VersionStart` '. 115 ' WHERE `T`.`Take` != `sub1`.`ID` AND `T`.`Language` != 0'. 116 // ' WHERE `T`.`Language` != 0 AND `T`.`VersionEnd` != `sub1`.`VersionEnd` AND `T`.`Take` NOT IN'. 115 ' WHERE `T`.`Take` != `sub1`.`ID` AND `T`.`Language` != 0'. 116 // ' WHERE `T`.`Language` != 0 AND `T`.`VersionEnd` != `sub1`.`VersionEnd` AND `T`.`Take` NOT IN'. 117 117 // '(Select `ID` FROM `'.$Group['TablePrefix'].'` as `sub2` WHERE `sub2`.`Language` = 0 AND `T`.`Entry` = `sub2`.`Entry` AND `T`.`VersionStart` = `sub2`.`VersionStart`)'. 118 ' '; //LIMIT 1000 118 ' '; //LIMIT 1000 119 119 //echo $sql; 120 120 $DbResult = $System->Database->query($sql); 121 121 echo ': <br />'.$Group['TablePrefix'].': <br />'; 122 123 124 echo ($line['ID'].', '); 125 126 122 while($line = $DbResult->fetch_assoc()) 123 { 124 echo ($line['ID'].', '); 125 $System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line['OrigEnd'].', `Take` = '.$line['origID'].' WHERE ID='.$line['ID']); 126 } 127 127 echo '<br / >Verze '.$Group['TablePrefix'].' opraveny!'; 128 128 } 129 129 return('Hotovo!'); 130 } 130 } 131 131 132 132 function StripText($Text) { … … 134 134 $Text = str_replace(' ', '', $Text); 135 135 return ($Text); 136 } 136 } 137 137 138 138 function MergeSameText() … … 140 140 global $System,$TranslationTree; 141 141 $Output = ''; 142 foreach($TranslationTree as $Group) 142 foreach($TranslationTree as $Group) 143 143 // $Group = $TranslationTree[1]; 144 144 { 145 145 146 146 $sql = 'SELECT * FROM `'.$Group['TablePrefix'] .'` as `T` '. 147 147 // ' JOIN `'.$Group['TablePrefix'].'` as `sub1` ON `sub1`.`Language` = 0 AND `T`.`Entry` = `sub1`.`Entry` AND `T`.`VersionStart` < `sub1`.`VersionStart` '. 148 ' WHERE `T`.`Language` = 0 '. 149 ' ORDER BY `T`.`VersionStart`'; //LIMIT 1000 148 ' WHERE `T`.`Language` = 0 '. 149 ' ORDER BY `T`.`VersionStart`'; //LIMIT 1000 150 150 //echo $sql; 151 151 $DbResult = $System->Database->query($sql); 152 152 echo ': <br />'.$Group['TablePrefix'].': '; 153 154 153 while($line = $DbResult->fetch_assoc()) 154 { 155 155 $sql = 'SELECT * FROM `'.$Group['TablePrefix'] .'` as `T` '. 156 ' WHERE `T`.`Language` = 0 AND `T`.`VersionStart` > '.$line['VersionEnd'].' AND `T`.`Entry` = '.$line['Entry']. 157 ' ORDER BY `T`.`VersionStart` LIMIT 1'; //LIMIT 1000 156 ' WHERE `T`.`Language` = 0 AND `T`.`VersionStart` > '.$line['VersionEnd'].' AND `T`.`Entry` = '.$line['Entry']. 157 ' ORDER BY `T`.`VersionStart` LIMIT 1'; //LIMIT 1000 158 158 // echo $sql; 159 160 159 $DbResult2 = $System->Database->query($sql); 160 if($DbResult2->num_rows > 0) { 161 161 $line2 = $DbResult2->fetch_assoc(); 162 163 $Same = true; 162 163 $Same = true; 164 164 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 165 if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']])) 165 if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']])) 166 166 $Same = false; 167 } 167 } 168 168 if ($Same) { 169 169 echo $line['ID'].'='.$line2['ID'].' ('; 170 //$System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE ID='.$line2['ID']);170 // $System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE ID='.$line2['ID']); 171 171 172 172 $sql = 'SELECT * FROM `'.$Group['TablePrefix'] .'` as `T` '. 173 ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') '; 174 175 173 ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') '; 174 $DbResult3 = $System->Database->query($sql); 175 while($line3 = $DbResult3->fetch_assoc()) { 176 176 echo $line3['ID'].' '; 177 177 $System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].', `VersionStart` = '.$line['VersionStart'].', `Take` = '.$line['ID'].' WHERE ID='.$line3['ID']); 178 178 } 179 179 180 181 180 $System->Database->query('DELETE FROM`'.$Group['TablePrefix'].'` WHERE ID='.$line2['ID']); 181 $System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].' WHERE ID='.$line['ID']); 182 182 echo '), '; 183 183 } 184 } 185 184 } 185 } 186 186 echo 'Texty '.$Group['TablePrefix'].' sjednoceny!'; 187 187 } 188 188 return('Hotovo!'); 189 } 189 } 190 190 191 191 function DbcStructure() { … … 193 193 $Output = ''; 194 194 if (array_key_exists('GameVersion', $_GET)) { 195 $_SESSION['GameVersion'] = $_GET['GameVersion']; 196 } 197 if (!array_key_exists('GameVersion', $_SESSION)) 198 $_SESSION['GameVersion'] = $System->Config['Web']['GameVersion']; 199 195 $_SESSION['GameVersion'] = $_GET['GameVersion']; 196 } 197 if (!array_key_exists('GameVersion', $_SESSION)) 198 $_SESSION['GameVersion'] = $System->Config['Web']['GameVersion']; 199 200 200 $Output .= '<br />Nastavená verze: '.$_SESSION['GameVersion'].'<br />'; 201 201 202 202 if (array_key_exists('GroupItem', $_GET)) { 203 203 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$_SESSION['GameVersion'].'"'); 204 $Version = $DbResult->fetch_assoc(); 204 $Version = $DbResult->fetch_assoc(); 205 205 $System->Database->query('INSERT INTO `GroupItemDBC` (`Id` ,`ClientVersion` ,`GroupItem` ,`ColumnIndex`)VALUES (NULL , \''.$Version['Id'].'\', \''.$_GET['GroupItem'].'\', \''.$_GET['ColumnIndex'].'\')'); 206 206 $Output .= 'vloženo <br />'; 207 } 207 } 208 208 if (array_key_exists('id', $_GET)) { 209 209 $Group = $TranslationTree[$_GET['id']]; … … 214 214 // } 215 215 // $Output .= '<input type="submit" value="uložit"></form>'; 216 217 216 217 218 218 $File = new FileStream(); 219 219 220 220 $File->OpenFile(dirname(__FILE__).'/../source/'.$_SESSION['GameVersion'].'/dbc/'.$Group['DBCFileName'].'.dbc.csv'); 221 221 222 222 //while(!$File->EOF()) 223 223 224 224 $Output .= '<table class="BaseTable">'; 225 225 $Output .= '<tr><td>'; 226 226 $Line = $File->ReadLine(); 227 227 228 228 for ($i=0;$i<substr_count($Line,',');$i++) { 229 229 $Output .= $i; … … 236 236 $Output .= '</td><td>'; 237 237 } 238 238 239 239 $Output .= '</td></tr><tr><td>'; 240 240 … … 251 251 } else { 252 252 253 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion`'); 254 while($Version = $DbResult->fetch_assoc()) 253 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion`'); 254 while($Version = $DbResult->fetch_assoc()) 255 255 { 256 256 $Output .= '<a href="'.$System->Link('/admin/?action=dbcstructure&GameVersion='.$Version['Version']).'">'.$Version['Version'].'</a> '; 257 257 258 } 258 } 259 259 $Output .= '<br /><br />'; 260 260 261 foreach($TranslationTree as $Group) 261 foreach($TranslationTree as $Group) 262 262 { 263 263 if ($Group['DBCFileName'] <> '') 264 264 $Output .= '<a href="'.$System->Link('/admin/?action=dbcstructure&id='.$Group['Id']).'">'.$Group['DBCFileName'].'</a><br/>'; 265 265 266 } 267 } 268 269 270 return($Output); 271 } 266 } 267 } 268 269 270 return($Output); 271 } 272 272 273 273 function ShowLocale() 274 274 { 275 276 277 278 279 280 281 282 283 284 275 global $LocaleManager, $System; 276 277 $LocaleManager->UpdateAll(dirname(dirname(__FILE__))); 278 $Output = 'Překlad rozhraní přegenerován'; 279 $Output .= '<table class="BaseTable"><tr><th>Originál</th><th>Překlad</th></tr>'; 280 foreach($LocaleManager->CurrentLocale->Texts->Data as $Index => $Item) 281 $Output .= '<tr><td>'.$Index.'</td><td>'.$Item.'</td></tr>'; 282 $Output .= '</table>'; 283 $Output .= 'Překladové soubory zaktualizovány'; 284 return($Output); 285 285 } 286 286 287 287 function Show() 288 288 { 289 289 $this->Title = T('Administration'); 290 290 $Output = ''; 291 291 if($this->System->User->Licence(LICENCE_ADMIN)) … … 305 305 else if($_GET['action'] == 'merge') $Output .= $this->MergeSameText(); 306 306 else $Output .= $this->ShowMenu(); 307 } else $Output .= $this->ShowMenu(); 307 } else $Output .= $this->ShowMenu(); 308 308 } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 309 309 return($Output); 310 310 } 311 } 311 } 312 312 $Page = new PageAdmin($System); 313 313 ShowPageClass($Page); -
trunk/admin/install.php
r805 r816 20 20 { 21 21 global $UpdateManager; 22 22 23 23 $YesNo = array(false => 'Ne', true => 'Ano'); 24 24 $Output = '<h3>Správa instance</h3>'. … … 43 43 function PrepareConfig($Config) 44 44 { 45 45 $Output = ''; 46 46 if(!file_exists('../includes/config.php') and !is_writable('../includes')) 47 47 $Output .= 'Varování: Konfigurační soubor nebude možné zapsat, protože složka includes není povolená pro zápis!'; 48 48 if(file_exists('../includes/config.php') and !is_writable('../includes/config.php')) 49 49 $Output .= 'Varování: Konfigurační soubor nebude možné zapsat, protože soubor config.php není povolen pro zápis!'; 50 50 $Output .= '<h3>Nastavení systému</h3>'. 51 51 '<form action="" method="post">'. 52 '<table>'. 52 '<table>'. 53 53 '<tr><td>Systémové heslo:</td><td> <input type="password" name="SystemPassword" value=""/></td></tr>'. 54 54 '<tr><td>Adresa serveru:</td><td> <input type="text" name="Host" value="'.$Config['Database']['Host'].'"/></td></tr>'. … … 62 62 '<tr><td>Počet položek navigace stránkování:</td><td> <input type="text" name="VisiblePagingItems" value="'.$Config['Web']['VisiblePagingItems'].'"/></td></tr>'. 63 63 '<tr><td>Počet řádků tabulek na stránku:</td><td> <input type="text" name="ItemsPerPage" value="'.$Config['Web']['ItemsPerPage'].'"/></td></tr>'. 64 64 65 65 '<tr><td colspan="2"><input type="submit" name="configure_save" value="Nastavit"/></td></tr>'. 66 '</table>'. 66 '</table>'. 67 67 '</form>'; 68 68 return($Output); … … 72 72 { 73 73 $Config = $DefaultConfig; 74 if(array_key_exists('SystemPassword', $_POST) and ($_POST['SystemPassword'] != '')) 75 74 if(array_key_exists('SystemPassword', $_POST) and ($_POST['SystemPassword'] != '')) 75 $Config['SystemPassword'] = sha1($_POST['SystemPassword']); 76 76 if(array_key_exists('Host', $_POST)) $Config['Database']['Host'] = $_POST['Host']; 77 77 if(array_key_exists('User', $_POST)) $Config['Database']['User'] = $_POST['User']; 78 if(array_key_exists('Password', $_POST) and ($_POST['Password'] != '')) 79 78 if(array_key_exists('Password', $_POST) and ($_POST['Password'] != '')) 79 $Config['Database']['Password'] = $_POST['Password']; 80 80 if(array_key_exists('Schema', $_POST)) $Config['Database']['Database'] = $_POST['Schema']; 81 81 if(array_key_exists('Title', $_POST)) $Config['Web']['Title'] = $_POST['Title']; … … 88 88 file_put_contents('../includes/config.php', $ConfigText); 89 89 $Output .= 'Konfigurace nastavena<br/>'; 90 return($Output); 90 return($Output); 91 91 } 92 92 … … 137 137 'MaxExportPerUser' => 10, 138 138 'AoWoWExportId' => 1, 139 'OriginalLanguage' => 1, 139 'OriginalLanguage' => 1, 140 140 'SystemPassword' => '".$Config['SystemPassword']."', 141 141 );"; … … 145 145 function LoginPanel() 146 146 { 147 148 149 150 151 152 153 '</form>'; 154 147 $Output = '<h3>Přihlášení k instalaci</h3>'. 148 '<form action="" method="post">'. 149 '<table>'. 150 '<tr><td>Systémové heslo:</td><td> <input type="password" name="SystemPassword" value=""/></td></tr>'. 151 '</table>'. 152 '<input type="submit" name="login" value="Přihlásit"/>'. 153 '</form>'; 154 return($Output); 155 155 } 156 156 … … 166 166 if(isset($Config)) 167 167 { 168 169 170 171 172 173 } else 174 168 if(!array_key_exists('SystemPassword', $_SESSION)) $_SESSION['SystemPassword'] = ''; 169 if(array_key_exists('login', $_POST)) $_SESSION['SystemPassword'] = $_POST['SystemPassword']; 170 if(sha1($_SESSION['SystemPassword']) != $Config['SystemPassword']) 171 { 172 $Output .= LoginPanel(); 173 } else 174 { 175 175 $System = new System(); 176 176 $System->Init(); … … 183 183 if(array_key_exists('logout', $_POST)) 184 184 { 185 186 185 $_SESSION['SystemPassword'] = ''; 186 $Output .= 'Odhlášen'; 187 187 $Output .= LoginPanel(); 188 188 } else … … 208 208 { 209 209 $Output .= ConfigSave($Config); 210 $Output .= ControlPanel(); 211 } else 210 $Output .= ControlPanel(); 211 } else 212 212 if(array_key_exists('configure', $_POST)) 213 213 { … … 215 215 } else 216 216 { 217 $Output .= ControlPanel(); 218 } 219 220 } else 217 $Output .= ControlPanel(); 218 } 219 } 220 } else 221 221 { 222 222 if(array_key_exists('configure_save', $_POST)) 223 223 { 224 224 $Output .= ConfigSave($DefaultConfig); 225 $Output .= 'Pokračujte k přihlášení <a href="">zde</a>'; 225 $Output .= 'Pokračujte k přihlášení <a href="">zde</a>'; 226 226 } else { 227 227 $Output .= PrepareConfig($DefaultConfig); 228 228 } 229 229 }
Note:
See TracChangeset
for help on using the changeset viewer.