Changeset 93 for trunk/www/Application/View
- Timestamp:
- Aug 15, 2013, 11:17:26 PM (11 years ago)
- Location:
- trunk/www/Application/View
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Backup.php
r92 r93 22 22 function ItemList() 23 23 { 24 global $Config;25 26 24 $ServerId = $_GET['Id']; 27 25 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 28 26 { 29 $Server = new Server($this-> Database, $_GET['Id']);27 $Server = new Server($this->System, $_GET['Id']); 30 28 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 31 29 { … … 61 59 else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 62 60 { 63 $Backup = new Backup($this-> Database, $_GET['Id']);64 $Server = new Server($this-> Database, $Backup->Backup['Server']);61 $Backup = new Backup($this->System, $_GET['Id']); 62 $Server = new Server($this->System, $Backup->Backup['Server']); 65 63 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 66 64 { … … 79 77 else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 80 78 { 81 $Backup = new Backup($this-> Database, $_GET['Id']);82 $Server = new Server($this-> Database, $Backup->Backup['Server']);79 $Backup = new Backup($this->System, $_GET['Id']); 80 $Server = new Server($this->System, $Backup->Backup['Server']); 83 81 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 84 82 { … … 95 93 else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 96 94 { 97 $Server = new Server($this-> Database, $_GET['Id']);95 $Server = new Server($this->System, $_GET['Id']); 98 96 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 99 97 { 100 $Backup = new Backup($this-> Database, 0);98 $Backup = new Backup($this->System, 0); 101 99 $Output = $this->SystemMessage('Ruční zálohování', $Backup->Create($Server->Id)); 102 100 $Output .= $this->ShowTaskList(); … … 106 104 } 107 105 } 108 109 ?> -
trunk/www/Application/View/Client.php
r92 r93 26 26 function ItemList() 27 27 { 28 global $Config;29 30 28 $Output = '<h4>Verze herního klienta</h4>'; 31 29 $Table = new Table($this->ItemListFormClass, $this->System); … … 36 34 } 37 35 } 38 39 ?> -
trunk/www/Application/View/Cluster.php
r81 r93 37 37 } 38 38 } 39 40 ?> -
trunk/www/Application/View/Database.php
r78 r93 10 10 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 11 11 { 12 $Server = new Server($this-> Database, $_GET['Id']);12 $Server = new Server($this->System, $_GET['Id']); 13 13 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 14 14 { … … 21 21 } 22 22 } 23 24 ?> -
trunk/www/Application/View/Debug.php
r92 r93 37 37 function ItemList() 38 38 { 39 global $Config;40 41 39 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 42 40 { 43 $Realm = new Realm($this-> Database, $_GET['Id']);41 $Realm = new Realm($this->System, $_GET['Id']); 44 42 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 45 43 { … … 61 59 function Item() 62 60 { 63 global $System;64 65 61 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 66 62 { 67 $Realm = new Realm($this-> Database, $_GET['Id']);63 $Realm = new Realm($this->System, $_GET['Id']); 68 64 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 69 65 { 70 66 $Output = '<div>Ladící informace serveru</div>'; 71 67 72 $MangosDebug = new MangosDebug($this-> Database, $this->System);68 $MangosDebug = new MangosDebug($this->System, $this->System); 73 69 $Form = new Form($this->System, $this->ItemFormClass); 74 70 if($Form->LoadValuesFromDatabase($_GET['Id'])) … … 127 123 } 128 124 } 129 130 ?> -
trunk/www/Application/View/Emulator.php
r92 r93 36 36 function ItemList() 37 37 { 38 global $Config;39 40 38 $Output = '<h4>Seznam verzí emulátoru</h4>'; 41 39 $Table = new Table($this->ItemListFormClass, $this->System); … … 59 57 { 60 58 $Id = $_GET['Id']; 61 //$Server = new Server($this-> Database, $Id);59 //$Server = new Server($this->System, $Id); 62 60 $Output = '<h4>Podrobnosti emulátoru</h4>'; 63 61 $Form = new Form($this->System, $this->ItemFormClass); … … 65 63 $Output .= $Form->ShowTable(); 66 64 $Output .= '<div style="text-align: center">'; 67 $Emulator = new Emulator($this-> Database, $Id);65 $Emulator = new Emulator($this->System, $Id); 68 66 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 69 67 { … … 106 104 if(array_key_exists('Id', $_GET)) 107 105 { 108 $Emulator = new Emulator($this-> Database, $_GET['Id']);106 $Emulator = new Emulator($this->System, $_GET['Id']); 109 107 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 110 108 { … … 122 120 if(array_key_exists('Id', $_GET)) 123 121 { 124 $Emulator = new Emulator($this-> Database, $_GET['Id']);122 $Emulator = new Emulator($this->System, $_GET['Id']); 125 123 if($this->System->Modules['Permission']->Check('Emulator', 'Download', $Emulator->Id)) 126 124 { … … 134 132 } 135 133 } 136 137 ?> -
trunk/www/Application/View/HomePage.php
r78 r93 47 47 function State() 48 48 { 49 $Platform = new Platform($this-> Database);49 $Platform = new Platform($this->System); 50 50 $State = $Platform->State(); 51 51 $Output = '<h4>Stav systému</h4>'. … … 64 64 } 65 65 } 66 67 ?> -
trunk/www/Application/View/News.php
r78 r93 51 51 } 52 52 } 53 54 ?> -
trunk/www/Application/View/Page.php
r78 r93 102 102 function GetOutput($Content) 103 103 { 104 global $Config;105 106 104 $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle). 107 105 $this->CenterPanel($Content); 108 106 $Output .= $this->ShowFooter(); 109 if($ Config['Web']['FormatHTML'] == true) echo($this->FormatOutput($Output));107 if($this->Config['Web']['FormatHTML'] == true) echo($this->FormatOutput($Output)); 110 108 else echo($Output); 111 109 } … … 123 121 } 124 122 } 125 126 ?> -
trunk/www/Application/View/Realm.php
r92 r93 105 105 function ItemList() 106 106 { 107 global $Config;108 109 107 if(array_key_exists('Id', $_GET)) $ServerId = $_GET['Id']; 110 108 111 $Realm = new Realm($this-> Database, 0);109 $Realm = new Realm($this->System, 0); 112 110 //$Realm->UpdateServerList(); 113 111 $Output = '<h4>Seznam světů</h4>'; … … 131 129 //$DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm WHERE Server='.$this->System->Modules['User']->User['Id']); 132 130 //$DbRow = $DbResult->fetch_row(); 133 if(($RealmCount < $ Config['MaxRealmPerServerCount']))131 if(($RealmCount < $this->Config['MaxRealmPerServerCount'])) 134 132 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Realm&Action=Add">Vytvořit nový svět</a></dev>'; 135 133 } … … 139 137 function Item() 140 138 { 141 global $Config;142 143 139 $Id = $_GET['Id']; 144 $Realm = new Realm($this-> Database, $Id);140 $Realm = new Realm($this->System, $Id); 145 141 //if(isset($Server->Server)) 146 142 //{ … … 179 175 function Add() 180 176 { 181 global $Config;182 183 177 if(array_key_exists('Id', $_GET)) 184 178 { … … 190 184 $DbRow = $DbResult->fetch_row(); 191 185 $RealmCount = $DbRow[0]; 192 if($RealmCount < $Config['MaxRealmCount']) 193 { 194 if($this->System->Modules['User']->RealmCount() >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' světů'); 186 if($RealmCount < $this->Config['MaxRealmCount']) 187 { 188 if($this->System->Modules['User']->RealmCount() >= $this->Config['MaxServerCountPerUser']) 189 $Output .= $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '. 190 $this->Config['MaxServerCountPerUser'].' světů'); 195 191 else 196 192 { … … 209 205 function Create() 210 206 { 211 global $Config;212 213 207 if(array_key_exists('Id', $_GET)) 214 208 { … … 216 210 if($this->System->Modules['Permission']->Check('Realm', 'Add')) 217 211 { 218 if($this->System->Modules['User']->RealmCount() >= $Config['MaxServerCountPerUser']) $Output = $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' světů'); 212 if($this->System->Modules['User']->RealmCount() >= $this->Config['MaxServerCountPerUser']) 213 $Output = $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '. 214 $this->Config['MaxServerCountPerUser'].' světů'); 219 215 else 220 216 { … … 223 219 $DbRow = $DbResult->fetch_row(); 224 220 $NewPortWorldd = $DbRow[0] + 1; 225 if($NewPortWorldd < $ Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd'];221 if($NewPortWorldd < $this->Config['BaseNetworkPortWorldd']) $NewPortWorldd = $this->Config['BaseNetworkPortWorldd']; 226 222 227 223 $Form = new Form($this->System, $this->CreateFormClass, array()); … … 229 225 $this->Database->insert('Realm', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'Server' => $ServerId, 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => $Form->Values['Database'], 'NetworkPortWorldd' => $NewPortWorldd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); 230 226 $LastInsertId = $this->Database->insert_id; 231 $Realm = new Realm($this-> Database, $LastInsertId);227 $Realm = new Realm($this->System, $LastInsertId); 232 228 $Realm->CreateDatabase(); 233 229 $Output = $this->System->SystemMessage('Vytvoření světu', $Realm->ImportDatabase(true)); … … 246 242 { 247 243 $Output = ''; 248 $Realm = new Realm($this-> Database, $_POST['RealmId']);244 $Realm = new Realm($this->System, $_POST['RealmId']); 249 245 if($this->System->Modules['Permission']->Check('Realm', 'Save', $Realm->Id)) 250 246 { … … 257 253 $Form->OnSubmit = '?Module=Realm&Action=Save'; 258 254 259 $Realm = new Realm($this-> Database, $_POST['RealmId']);255 $Realm = new Realm($this->System, $_POST['RealmId']); 260 256 $Realm->SaveConfiguration(); 261 257 $Form->Values['RealmId'] = $RealmId; … … 268 264 { 269 265 $Output = ''; 270 $Realm = new Realm($this-> Database, $_GET['Id']);266 $Realm = new Realm($this->System, $_GET['Id']); 271 267 if($this->System->Modules['Permission']->Check('Realm', 'Edit', $Realm->Id)) 272 268 { … … 283 279 { 284 280 $Output = ''; 285 $Realm = new Realm($this-> Database, $_GET['Id']);281 $Realm = new Realm($this->System, $_GET['Id']); 286 282 if($this->System->Modules['Permission']->Check('Realm', 'EditDetailed', $Realm->Id)) 287 283 { 288 284 $Form = new Form($this->System, $this->SettingDetailedFormClass); 289 $EmulatorConfig = new MangosConfigurationFile($this-> Database);285 $EmulatorConfig = new MangosConfigurationFile($this->System); 290 286 $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf'); 291 287 $Form->Values = array(); … … 302 298 { 303 299 $Output = ''; 304 $Realm = new Realm($this-> Database, $_POST['RealmId']);300 $Realm = new Realm($this->System, $_POST['RealmId']); 305 301 if($this->System->Modules['Permission']->Check('Realm', 'SaveDetailed', $Realm->Id)) 306 302 { 307 303 $Form = new Form($this->System, $this->SettingDetailedFormClass, array()); 308 304 $Form->LoadValuesFromForm(); 309 $EmulatorConfig = new MangosConfigurationFile($this-> Database);305 $EmulatorConfig = new MangosConfigurationFile($this->System); 310 306 $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf'); 311 307 foreach($Form->Definition['Items'] as $Index => $Item) … … 322 318 $Form->OnSubmit = '?Module=Realm&Action=SaveDetailed'; 323 319 324 $Realm = new Realm($this-> Database, $_POST['RealmId']);320 $Realm = new Realm($this->System, $_POST['RealmId']); 325 321 $Realm->SaveConfiguration(); 326 322 $Form->Values['RealmId'] = $RealmId; … … 333 329 { 334 330 $Output = ''; 335 $Realm = new Realm($this-> Database, $_GET['Id']);331 $Realm = new Realm($this->System, $_GET['Id']); 336 332 if($this->System->Modules['Permission']->Check('Realm', 'Start', $Realm->Id)) 337 333 { … … 346 342 { 347 343 $Output = ''; 348 $Realm = new Realm($this-> Database, $_GET['Id']);344 $Realm = new Realm($this->System, $_GET['Id']); 349 345 if($this->System->Modules['Permission']->Check('Realm', 'Stop', $Realm->Id)) 350 346 { … … 358 354 function InitDatabase() 359 355 { 360 global $Config;361 362 356 if(array_key_exists('Id', $_GET)) 363 357 { 364 358 $RealmId = $_GET['Id']; 365 $Realm = new Realm($this-> Database, $RealmId);359 $Realm = new Realm($this->System, $RealmId); 366 360 if($this->System->Modules['Permission']->Check('Realm', 'InitDatabase', $Realm->Id)) 367 361 { … … 377 371 } 378 372 } 379 380 ?> -
trunk/www/Application/View/Server.php
r81 r93 84 84 function ItemList() 85 85 { 86 global $Config;87 88 86 $Output = '<h4>Seznam serverů</h4>'; 89 87 $Table = new Table($this->ItemListFormClass, $this->System); … … 110 108 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 111 109 $DbRow = $DbResult->fetch_row(); 112 if(($ServerCount < $ Config['MaxServerCount']) and ($DbRow[0] < $Config['MaxServerCountPerUser']))110 if(($ServerCount < $this->Config['MaxServerCount']) and ($DbRow[0] < $this->Config['MaxServerCountPerUser'])) 113 111 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Server&Action=Add">Vytvořit nový server</a></div>'; 114 112 } … … 118 116 function Item() 119 117 { 120 global $Config;121 122 118 $Id = $_GET['Id']; 123 $Server = new Server($this-> Database, $Id);119 $Server = new Server($this->System, $Id); 124 120 if(isset($Server->Server)) 125 121 { … … 132 128 $Form->Definition['Items']['AccountCount'] = array('Type' => 'String', 'Caption' => 'Počet účtů', 'Default' => ''); 133 129 $ServerStatus = $Server->GetState(); 134 $Form->Values['Realmlist'] = $ Config['Web']['Host'].':'.$Form->Values['NetworkPortRealmd'];130 $Form->Values['Realmlist'] = $this->Config['Web']['Host'].':'.$Form->Values['NetworkPortRealmd']; 135 131 unset($Form->Definition['Items']['NetworkPortRealmd']); 136 132 $Form->Values['Uptime'] = $this->System->AddPrefixMultipliers($ServerStatus['Uptime'], '', 4, 'Time'); … … 167 163 function Add() 168 164 { 169 global $Config;170 171 165 $Output = ''; 172 166 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) … … 175 169 $DbRow = $DbResult->fetch_row(); 176 170 $ServerCount = $DbRow[0]; 177 if($ServerCount < $ Config['MaxServerCount'])171 if($ServerCount < $this->Config['MaxServerCount']) 178 172 { 179 173 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 180 174 $DbRow = $DbResult->fetch_row(); 181 if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů'); 175 if($DbRow[0] >= $this->Config['MaxServerCountPerUser']) 176 $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '. 177 $this->Config['MaxServerCountPerUser'].' serverů'); 182 178 else 183 179 { … … 195 191 function Create() 196 192 { 197 global $Config;198 199 193 $Output = ''; 200 194 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) … … 202 196 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 203 197 $DbRow = $DbResult->fetch_row(); 204 if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů'); 198 if($DbRow[0] >= $this->Config['MaxServerCountPerUser']) 199 $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '. 200 $this->Config['MaxServerCountPerUser'].' serverů'); 205 201 else 206 202 { … … 208 204 $DbRow = $DbResult->fetch_row(); 209 205 $NewPortRealmd = $DbRow[0] + 1; 210 if($NewPortRealmd < $ Config['BaseNetworkPortRealmd']) $NewPortRealmd = $Config['BaseNetworkPortRealmd'];206 if($NewPortRealmd < $this->Config['BaseNetworkPortRealmd']) $NewPortRealmd = $this->Config['BaseNetworkPortRealmd']; 211 207 212 208 $Form = new Form($this->System, $this->CreateFormClass, array()); … … 214 210 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->Data['Id'], 'Homepage' => $Form->Values['Homepage'], 'Database' => $Form->Values['Database'], 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); 215 211 $LastInsertId = $this->Database->insert_id; 216 $Server = new Server($this-> Database, $LastInsertId);212 $Server = new Server($this->System, $LastInsertId); 217 213 $Server->CreateDatabase(); 218 214 $Output .= $this->System->SystemMessage('Vytvoření serveru', $Server->ImportDatabase(true)); … … 230 226 { 231 227 $Output = ''; 232 $Server = new Server($this-> Database, $_POST['ServerId']);228 $Server = new Server($this->System, $_POST['ServerId']); 233 229 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 234 230 { … … 241 237 $Form->OnSubmit = '?Action=ServerSave'; 242 238 243 $Server = new Server($this-> Database, $_POST['ServerId']);239 $Server = new Server($this->System, $_POST['ServerId']); 244 240 $Server->SaveConfiguration(); 245 241 $Form->Values['ServerId'] = $ServerId; … … 252 248 { 253 249 $Output = ''; 254 $Server = new Server($this-> Database, $_GET['Id']);250 $Server = new Server($this->System, $_GET['Id']); 255 251 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 256 252 { … … 269 265 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 270 266 { 271 $Server = new Server($this-> Database, $_GET['Id']);267 $Server = new Server($this->System, $_GET['Id']); 272 268 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 273 269 { … … 285 281 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 286 282 { 287 $Server = new Server($this-> Database, $_GET['Id']);283 $Server = new Server($this->System, $_GET['Id']); 288 284 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 289 285 { … … 310 306 $Form = new Form($this->System, $this->GameAccountNewFormClass); 311 307 $Form->LoadValuesFromForm(); 312 $Server = new Server($this-> Database, $Form->Values['ServerId']);308 $Server = new Server($this->System, $Form->Values['ServerId']); 313 309 $Output = $this->System->SystemMessage('Vytvoření herního účtu', $Server->NewAccount($Form->Values['Name'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Expansion'])); 314 310 $Output .= '<a href="?Module=Server&Action=GameAccountRegister&Id='.$Form->Values['ServerId'].'">Zpět k zadání údajů</a>'; … … 322 318 Header('Content-Type: text/plain'); 323 319 Header('Content-Disposition: attachment; filename="realmlist.wtf"'); 324 $Server = new Server($this-> Database, $_GET['Id']);320 $Server = new Server($this->System, $_GET['Id']); 325 321 $Output = array( 326 322 'set realmlist '.$this->Config['Web']['Host'].':'.$Server->Server['NetworkPortRealmd'], … … 337 333 if(array_key_exists('Id', $_GET)) 338 334 { 339 $Server = new Server($this-> Database, $_GET['Id'] * 1);335 $Server = new Server($this->System, $_GET['Id'] * 1); 340 336 echo($Server->GetPatchList()); 341 337 } else echo('Zadané id serveru nenalezeno.'); … … 371 367 } 372 368 } 373 374 ?> -
trunk/www/Application/View/Task.php
r92 r93 26 26 function ItemList() 27 27 { 28 global $Config;29 30 28 $Output = '<h4>Fronta úloh</h4>'; 31 29 $Table = new Table($this->ItemListFormClass, $this->System); 32 30 $Table->OnRow = array($this, 'ShowListOnRow'); 33 $Table->Definition['Table'] = '(SELECT Id, (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='.$this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)'; 31 $Table->Definition['Table'] = '(SELECT Id, (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='. 32 $this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)'; 34 33 $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => ''); 35 34 $Table->LoadValuesFromDatabase($this->Database); … … 65 64 } 66 65 } 67 68 ?> -
trunk/www/Application/View/Update.php
r92 r93 7 7 function ItemList() 8 8 { 9 global $Config;10 11 9 $ServerId = $_GET['Id']; 12 10 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 13 11 { 14 $Server = new Server($this-> Database, $_GET['Id']);12 $Server = new Server($this->System, $_GET['Id']); 15 13 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 16 14 { 17 $Server = new Server($this-> Database, $ServerId);15 $Server = new Server($this->System, $ServerId); 18 16 $Output = '<h4>Seznam dostupných aktulizací</h4>'; 19 17 $Output .= 'Před provedením aktualizace bude server zastaven a provedena záloha databáze.'; … … 41 39 else if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 42 40 { 43 $Server = new Server($this-> Database, $_GET['Server']);41 $Server = new Server($this->System, $_GET['Server']); 44 42 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 45 43 { … … 51 49 } 52 50 } 53 54 ?> -
trunk/www/Application/View/User.php
r80 r93 53 53 function Login() 54 54 { 55 global $Config;56 57 55 $Form = new Form($this->System, $this->LoginFormClass); 58 56 $Form->OnSubmit = '?Module=User&Action=LoginFinish'; 59 57 $Output = $Form->ShowEditForm(); 60 58 $Output .= '<div class="Centred">'; 61 if($ Config['Web']['UserRegistrationEnabled'])59 if($this->Config['Web']['UserRegistrationEnabled']) 62 60 $Output .= '<a href="?Module=User&Action=Register">Registrovat se</a> '; 63 61 $Output .= '<a href="?Module=User&Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; … … 85 83 function RegisterSave() 86 84 { 87 global $Config; 88 89 if($Config['Web']['UserRegistrationEnabled']) 85 if($this->Config['Web']['UserRegistrationEnabled']) 90 86 { 91 87 $Form = new Form($this->System, $this->RegisterFormClass, array()); … … 96 92 if($Result <> $this->System->Translate('UserRegistrated')) 97 93 { 98 $Form->OnSubmit = '?Module=User&Action= UserRegisterSave';94 $Form->OnSubmit = '?Module=User&Action=RegisterSave'; 99 95 $Output = $Form->ShowEditForm(); 100 96 } … … 166 162 function Register() 167 163 { 168 global $Config; 169 170 if($Config['Web']['UserRegistrationEnabled']) 164 if($this->Config['Web']['UserRegistrationEnabled']) 171 165 { 172 166 $Form = new Form($this->System, $this->RegisterFormClass); 173 167 $Form->LoadValuesFromForm(); 174 $Form->OnSubmit = '?Module=User&Action= UserRegisterSave';168 $Form->OnSubmit = '?Module=User&Action=RegisterSave'; 175 169 $Output = 'Vyplňte správně požadované údaje. Na zadaný email vám bude zaslán aktivační email.'; 176 170 $Output .= $Form->ShowEditForm(); … … 181 175 function RegisterConfirm() 182 176 { 183 global $Config; 184 185 if($Config['Web']['UserRegistrationEnabled']) 177 if($this->Config['Web']['UserRegistrationEnabled']) 186 178 { 187 179 $Page = new PageView($this->System); … … 192 184 } 193 185 } 194 195 ?>
Note:
See TracChangeset
for help on using the changeset viewer.