Changeset 76 for trunk/www/Application/View
- Timestamp:
- Aug 24, 2009, 8:53:09 PM (15 years ago)
- Location:
- trunk/www/Application/View
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Cluster.php
r74 r76 28 28 $Table->LoadValuesFromDatabase($this->Database); 29 29 $Output .= $Table->Show(); 30 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)31 {32 //$Output .= '<br /><div style="text-align: center;"><a href="?Action=BackupAdd">Zálohovat</a></dev>';33 }34 30 return($Output); 35 31 } -
trunk/www/Application/View/Include.php
r74 r76 1 1 <?php 2 2 3 include( 'Application/View/Page.php');4 include( 'Application/View/HomePage.php');5 include( 'Application/View/User.php');6 include( 'Application/View/Server.php');7 include( 'Application/View/Realm.php');8 include( 'Application/View/Emulator.php');9 include( 'Application/View/Task.php');10 include( 'Application/View/Backup.php');11 include( 'Application/View/Update.php');12 include( 'Application/View/Database.php');13 include( 'Application/View/News.php');14 include( 'Application/View/Client.php');15 include( 'Application/View/Debug.php');16 include( 'Application/View/Cluster.php');3 include(dirname(__FILE__).'/Page.php'); 4 include(dirname(__FILE__).'/HomePage.php'); 5 include(dirname(__FILE__).'/User.php'); 6 include(dirname(__FILE__).'/Server.php'); 7 include(dirname(__FILE__).'/Realm.php'); 8 include(dirname(__FILE__).'/Emulator.php'); 9 include(dirname(__FILE__).'/Task.php'); 10 include(dirname(__FILE__).'/Backup.php'); 11 include(dirname(__FILE__).'/Update.php'); 12 include(dirname(__FILE__).'/Database.php'); 13 include(dirname(__FILE__).'/News.php'); 14 include(dirname(__FILE__).'/Client.php'); 15 include(dirname(__FILE__).'/Debug.php'); 16 include(dirname(__FILE__).'/Cluster.php'); 17 17 18 18 ?> -
trunk/www/Application/View/Page.php
r74 r76 35 35 ' <a href="?Module=Emulator&Action=ItemList">Verze emulátoru</a>'. 36 36 '</span><div class="MenuItem2">'; 37 if($this->System->Modules['User']-> User['Id'] == $this->Config['Web']['UserAnonymousId'])37 if($this->System->Modules['User']->Data['Id'] == $this->Config['Web']['UserAnonymousId']) 38 38 { 39 39 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Module=User&Action=Login">Přihlášení</a>'; 40 40 if($this->Config['Web']['UserRegistrationEnabled']) $Output .= ' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Module=User&Action=Register">Registrace</a>'; 41 } else $Output .= $this->System->Modules['User']-> User['Name'].' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User&Action=Logout">Odhlásit</a>'.41 } else $Output .= $this->System->Modules['User']->Data['Name'].' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User&Action=Logout">Odhlásit</a>'. 42 42 ' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User&Action=Options">Nastavení</a>'; 43 43 $Output .= '</div></div>'; … … 64 64 { 65 65 $Output = '<table class="BasicTable"><tr>'; 66 if($this->System->Modules['User']-> User['Id'] != $this->Config['Web']['UserAnonymousId'])66 if($this->System->Modules['User']->Data['Id'] != $this->Config['Web']['UserAnonymousId']) 67 67 $Output .= '<td class="UserMenu">'.$this->UserMenu().'</td>'; 68 68 $Output .= '<td class="Content">'.$Content.'</td>'; … … 79 79 { 80 80 $Output = '<strong>Uživatelské menu</strong><br />'; 81 if($this->System->Modules['User']-> User['Id'] != $this->Config['Web']['UserAnonymousId'])81 if($this->System->Modules['User']->Data['Id'] != $this->Config['Web']['UserAnonymousId']) 82 82 { 83 83 $Output .= '<div><a href="?Module=Cluster&Action=ItemList">Uzly skupiny</a></div>'; … … 89 89 //$Output .= '<div><a href="?Action=UpdateList&Id='.$Server['Id'].'">Dostupné aktualizace</a></div>'; 90 90 91 if($this->System->Modules[' User']->User['Role'] == USER_ROLE_ADMINISTRATOR)91 if($this->System->Modules['Permission']->CheckPermission('News', 'Add')) 92 92 { 93 93 $Output .= '<div><a href="?Module=News&Action=Add">Přidat aktualitu</a></div>'; … … 107 107 else echo($Output); 108 108 } 109 110 function SystemMessage($Text) 111 { 112 return('<table align="center"><tr><td><div class="SystemMessage"><h3>Systémová zpráva</h3><div>'.$Text.'</div></div</td></tr></table>'); 113 //ShowFooter(); 114 //die(); 115 } 116 117 function AccessDenied() 118 { 119 return($this->GetOutput($this->SystemMessage($this->System->Translate('AccessDenied')))); 120 } 109 121 } 110 122 -
trunk/www/Application/View/Server.php
r73 r76 89 89 { 90 90 if($_GET['Filter'] == 'User') 91 $Table->Definition['Table'] = substr($Table->Definition['Table'], 0, -1).' WHERE User='.$this->System->Modules['User']-> User['Id'].')';91 $Table->Definition['Table'] = substr($Table->Definition['Table'], 0, -1).' WHERE User='.$this->System->Modules['User']->Data['Id'].')'; 92 92 } 93 93 $Table->OnRow = array($this, 'ShowListOnRow'); … … 101 101 } 102 102 $Output .= $Table->Show(); 103 if($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER)103 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 104 104 { 105 105 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server'); 106 106 $DbRow = $DbResult->fetch_row(); 107 107 $ServerCount = $DbRow[0]; 108 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']-> User['Id']);108 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 109 109 $DbRow = $DbResult->fetch_row(); 110 110 if(($ServerCount < $Config['MaxServerCount']) and ($DbRow[0] < $Config['MaxServerCountPerUser'])) … … 137 137 $Output .= $Form->ShowTable(); 138 138 $Output .= '<div style="text-align: center">'; 139 if((($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))139 if((($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->Data['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 140 140 { 141 141 $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> '; … … 168 168 169 169 $Output = ''; 170 if($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER)170 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 171 171 { 172 172 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server'); … … 175 175 if($ServerCount < $Config['MaxServerCount']) 176 176 { 177 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']-> User['Id']);177 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 178 178 $DbRow = $DbResult->fetch_row(); 179 179 if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů'); … … 196 196 197 197 $Output = ''; 198 if($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER)199 { 200 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']-> User['Id']);198 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 199 { 200 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->System->Modules['User']->Data['Id']); 201 201 $DbRow = $DbResult->fetch_row(); 202 202 if($DbRow[0] >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový server', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' serverů'); … … 210 210 $Form = new Form($this->System, $this->CreateFormClass, array()); 211 211 $Form->LoadValuesFromForm(); 212 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']-> User['Id'], 'Homepage' => $Form->Values['Homepage'], 'Database' => $Form->Values['Database'], 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()'));212 $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()')); 213 213 $LastInsertId = $this->Database->insert_id; 214 214 $Server = new Server($this->Database, $LastInsertId); … … 229 229 $Output = ''; 230 230 $Server = new Server($this->Database, $_POST['ServerId']); 231 if(($this->System->Modules['User']-> User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))231 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 232 232 { 233 233 $Form = new Form($this->System, $this->EditFormClass, array()); … … 251 251 $Output = ''; 252 252 $Server = new Server($this->Database, $_GET['Id']); 253 if(($this->System->Modules['User']-> User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))253 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 254 254 { 255 255 $Form = new Form($this->System, $this->EditFormClass); … … 265 265 { 266 266 $Output = ''; 267 if($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER)267 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 268 268 { 269 269 $Server = new Server($this->Database, $_GET['Id']); 270 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']-> User['Role'] >= USER_ROLE_ADMINISTRATOR))270 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 271 271 { 272 272 $Output .= $this->System->SystemMessage('Spuštění serveru', $Server->Start()); … … 281 281 { 282 282 $Output = ''; 283 if($this->System->Modules['User']-> User['Role'] >= USER_ROLE_USER)283 if($this->System->Modules['User']->Data['Role'] >= USER_ROLE_USER) 284 284 { 285 285 $Server = new Server($this->Database, $_GET['Id']); 286 if(($this->System->Modules['User']-> User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))286 if(($this->System->Modules['User']->Data['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->Data['Role'] >= USER_ROLE_ADMINISTRATOR)) 287 287 { 288 288 $Output .= $this->System->SystemMessage('Zastavení serveru', $Server->Stop()); -
trunk/www/Application/View/User.php
r71 r76 70 70 $Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']); 71 71 $Output = $this->System->SystemMessage('Přihlášení', $Result); 72 if($Result <> USER_LOGGED_IN)72 if($Result <> $this->System->Translate('UserLoggedIn')) 73 73 { 74 74 $Form->Values['Password'] = ''; … … 90 90 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); 91 91 $Output = $this->System->SystemMessage('Registrace nového účtu', $Result); 92 if($Result <> USER_REGISTRATED)92 if($Result <> $this->System->Translate('UserRegistrated')) 93 93 { 94 94 $Form->OnSubmit = '?Module=User&Action=UserRegisterSave'; … … 112 112 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 113 113 $Output = $this->System->SystemMessage('Obnova hesla', $Result); 114 if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)114 if($Result <> $this->System->Translate('UserPasswordRecoverySuccess')) 115 115 { 116 116 $Output .= $Form->ShowEditForm();
Note:
See TracChangeset
for help on using the changeset viewer.