Changeset 78 for trunk/www/Application
- Timestamp:
- Sep 11, 2009, 8:18:38 AM (15 years ago)
- Location:
- trunk/www/Application
- Files:
-
- 3 added
- 5 deleted
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/Controller/Backup.php
r73 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class BackupController extends Controller -
trunk/www/Application/Controller/Client.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class ClientController extends Controller -
trunk/www/Application/Controller/Cluster.php
r76 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class ClusterController extends Controller -
trunk/www/Application/Controller/Debug.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class DebugController extends Controller -
trunk/www/Application/Controller/Emulator.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class EmulatorController extends Controller -
trunk/www/Application/Controller/HomePage.php
r76 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 4 include_once(dirname(__FILE__).'/../View/Page.php'); 5 include_once(dirname(__FILE__).'/../View/HomePage.php'); 2 6 3 7 class HomePageController extends Controller -
trunk/www/Application/Controller/News.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class NewsController extends Controller -
trunk/www/Application/Controller/Realm.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class RealmController extends Controller -
trunk/www/Application/Controller/Server.php
r74 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class ServerController extends Controller -
trunk/www/Application/Controller/Task.php
r72 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class TaskController extends Controller … … 6 8 { 7 9 $Page = new PageView($this->System); 8 $View = new TaskView($this->System); 9 return($Page->GetOutput($View->ItemList())); 10 if($this->System->Modules['Permission']->Check('Task', 'ItemList')) 11 { 12 $View = new TaskView($this->System); 13 return($Page->GetOutput($View->ItemList())); 14 } else return($Page->AccessDenied()); 10 15 } 11 16 … … 13 18 { 14 19 $Page = new PageView($this->System); 15 $View = new TaskView($this->System); 16 return($Page->GetOutput($View->ErrorLog())); 20 if($this->System->Modules['Permission']->Check('Task', 'ErrorLog')) 21 { 22 $View = new TaskView($this->System); 23 return($Page->GetOutput($View->ErrorLog())); 24 } else return($Page->AccessDenied()); 17 25 } 18 26 … … 20 28 { 21 29 $Page = new PageView($this->System); 22 $View = new TaskView($this->System); 23 return($Page->GetOutput($View->StandardLog())); 30 if($this->System->Modules['Permission']->Check('Task', 'StandardLog')) 31 { 32 $View = new TaskView($this->System); 33 return($Page->GetOutput($View->StandardLog())); 34 } else return($Page->AccessDenied()); 24 35 } 25 36 } -
trunk/www/Application/Controller/Update.php
r73 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 2 4 3 5 class UpdateController extends Controller -
trunk/www/Application/Controller/User.php
r76 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Controller.php'); 4 include_once(dirname(__FILE__).'/../View/Page.php'); 5 include_once(dirname(__FILE__).'/../View/User.php'); 2 6 3 7 class UserController extends Controller -
trunk/www/Application/Model/Backup.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Backup extends Model -
trunk/www/Application/Model/Cluster.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Cluster extends Model -
trunk/www/Application/Model/ClusterList.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class ClusterList extends Model -
trunk/www/Application/Model/Emulator.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Emulator extends Model -
trunk/www/Application/Model/History.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class History extends Model -
trunk/www/Application/Model/Log.php
r76 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Log extends Model -
trunk/www/Application/Model/MangosConfigurationFile.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class MangosConfigurationFile extends Model -
trunk/www/Application/Model/MangosDebug.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class MangosDebug extends Model -
trunk/www/Application/Model/Permission.php
r76 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Permission extends Model -
trunk/www/Application/Model/Platform.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Platform extends Model -
trunk/www/Application/Model/Realm.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Realm extends Model -
trunk/www/Application/Model/Server.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Server extends Model -
trunk/www/Application/Model/Shell.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Shell extends Model -
trunk/www/Application/Model/Task.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 2 4 3 5 class Task extends Model -
trunk/www/Application/Model/User.php
r75 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/Model.php'); 4 include_once(dirname(__FILE__).'/../../Base/Mail.php'); 5 include_once(dirname(__FILE__).'/Log.php'); 2 6 3 7 class User extends Model … … 7 11 var $DefaultRole = 2; 8 12 var $OnlineStateTimeout = 600; // in seconds 9 10 var $Roles = array('Unknown', 'Anonymous', 'User', 'Administrator');11 13 12 14 function PasswordHash($Name, $Password) … … 31 33 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 32 34 if($Query->num_rows == 0) 33 $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $this->Config['Web']['UserAnonymousId'], 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 'ScriptName' => $_SERVER['PHP_SELF']));35 $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $this->Config['Web']['UserAnonymousId'], 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => $this->System->GetRemoteAddress(), 'HostName' => gethostbyaddr($this->System->GetRemoteAddress()), 'ScriptName' => $_SERVER['PHP_SELF'])); 34 36 //echo($this->Database->LastQuery); 35 37 … … 51 53 // Refresh time of last access 52 54 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()')); 53 54 //$this->LoadPermission($this->Data['Role']);55 56 // Role and permission57 //$this->LoadRoles();58 55 } 59 56 … … 79 76 else 80 77 { 81 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => $this->PasswordHash($Login, $Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1 , 'Role' => 2));78 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => $this->PasswordHash($Login, $Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1)); 82 79 $UserId = $this->Database->insert_id; 83 80 84 $Subject = FromUTF8('Registrace nového účtu', 'iso2'); 85 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."/</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte."; 86 $AdditionalHeaders = "To: ".$Name." <".$Email.">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 87 mail($Email, $Subject, $Message, $AdditionalHeaders); 81 $Mail = new Mail(); 82 $Mail->Content = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'/">http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder']."/</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'">http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte."; 83 $Mail->Subject = 'Registrace nového účtu'; 84 $Mail->RecipientName = $Name; 85 $Mail->RecipientAddress = $Email; 86 $Mail->SenderName = $this->Config['Web']['Title']; 87 $Mail->SenderAddress = 'noreplay@zdechov.net'; 88 $Mail->Send(); 89 88 90 $Result = $this->System->Translate('UserRegistrated'); 89 91 $this->System->Modules['Log']->NewRecord('User', 'NewRegistration', $Login); … … 142 144 } 143 145 144 function LoadRoles()145 {146 $this->Roles = array();147 $DbResult = $this->Database->select('UserRole', '*');148 while($DbRow = $DbResult->fetch_array())149 $this->Roles[] = $DbRow;150 }151 152 function LoadPermission($Role)153 {154 $this->Data['Permission'] = array();155 $DbResult = $this->Database->query('SELECT `UserRolePermission`.*, `PermissionOperation`.`Description` FROM `UserRolePermission` JOIN `PermissionOperation` ON `PermissionOperation`.`Id` = `UserRolePermission`.`Operation` WHERE `UserRolePermission`.`Role` = '.$Role);156 if($DbResult->num_rows > 0)157 while($DbRow = $DbResult->fetch_array())158 $this->Data['Permission'][$DbRow['Operation']] = $DbRow;159 }160 161 function PermissionMatrix()162 {163 $Result = array();164 $DbResult = $this->Database->query('SELECT `UserRolePermission`.*, `PermissionOperation`.`Description`, `UserRole`.`Title` FROM `UserRolePermission` LEFT JOIN `PermissionOperation` ON `PermissionOperation`.`Id` = `UserRolePermission`.`Operation` LEFT JOIN `UserRole` ON `UserRole`.`Id` = `UserRolePermission`.`Role`');165 while($DbRow = $DbResult->fetch_array())166 {167 $Value = '';168 if($DbRow['Read']) $Value .= 'R';169 if($DbRow['Write']) $Value .= 'W';170 $Result[$DbRow['Description']][$DbRow['Title']] = $Value;171 }172 return($Result);173 }174 175 function CheckGroupPermission($GroupId, $OperationId)176 {177 // Check group-group relation178 $DbResult = $this->Database->select('PermissionGroupAssignment', '*', '`Group`="'.$GroupId.'" AND `Type`="Group"');179 while($DbRow = $DbResult->fetch_array())180 {181 if($this->CheckGroupPermission($DbRow['GroupOrOperation'], $OperationId) == true) return(true);182 }183 184 // Check group-operation relation185 $DbResult = $this->Database->select('PermissionGroupAssignment', '*', '`Group`="'.$GroupId.'" AND `GroupOrOperation`="'.$OperationId.'" AND `Type`="Operation"');186 if($DbResult->num_rows > 0) return(true);187 return(false);188 }189 190 function CheckPermission($Module, $Operation, $ItemType = '', $ItemIndex = 0)191 {192 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$Module.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"');193 if($DbResult->num_rows > 0)194 {195 $DbRow = $DbResult->fetch_array();196 $OperationId = $DbRow['Id'];197 198 // Check user-operation relation199 $DbResult = $this->Database->select('PermissionUserAssignment', '*', '`User`="'.$this->Data['Id'].'" AND `GroupOrOperation`="'.$OperationId.'" AND `Type`="Operation"');200 if($DbResult->num_rows > 0) return(true);201 202 // Check user-group relation203 $DbResult = $this->Database->select('PermissionUserAssignment', 'GroupOrOperation', '`User`="'.$this->Data['Id'].'" AND `Type`="Group"');204 while($DbRow = $DbResult->fetch_array())205 {206 if($this->CheckGroupPermission($DbRow['GroupOrOperation'], $OperationId) == true) return(true);207 }208 return(false);209 } else return(false);210 }211 212 146 function PasswordRecoveryRequest($Login, $Email) 213 147 { 214 global $Config;215 216 148 $DbResult = $this->Database->select('User', 'Login, Name, Id, Email, Password', '`Login`="'.$Login.'" AND `Email`="'.$Email.'"'); 217 149 if($DbResult->num_rows > 0) … … 220 152 $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7); 221 153 222 $Subject = 'Obnova hesla'; 223 $Message = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br />\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".$Row['Login']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte."; 224 $AdditionalHeaders = "To: ".$Row['Name']." <".$Row['Email'].">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 225 mail($Row['Email'], $Subject, $Message, $AdditionalHeaders); 154 $Mail = new Mail(); 155 $Mail->Subject = 'Obnova hesla'; 156 $Mail->Content = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'">http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder']."</a>.<br />\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".$Row['Login']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte."; 157 $Mail->RecipientName = $Row['Name']; 158 $Mail->RecipientAddress = $Row['Email']; 159 $Mail->SenderName = $this->Config['Web']['Title']; 160 $Mail->SenderAddress = 'noreplay@zdechov.net'; 161 $Mail->Send(); 162 226 163 $Output = $this->System->Translate('UserPasswordRecoverySuccess'); 227 164 $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email); … … 246 183 return($Output); 247 184 } 248 249 function ServerCount()250 {251 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->Data['Id']);252 $DbRow = $DbResult->fetch_row();253 return($DbRow[0]);254 }255 256 function RealmCount()257 {258 $Total = 0;259 $DbResult = $this->Database->query('SELECT Id FROM Server WHERE User='.$this->User['Id']);260 while($DbRow = $DbResult->fetch_assoc())261 {262 $Server = new Server($this->Database, $DbRow['Id']);263 $Total += $Server->RealmCount();264 }265 return($Total);266 }267 185 } 268 186 -
trunk/www/Application/View/Backup.php
r69 r78 1 1 <?php 2 2 3 class BackupView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class BackupView extends View 4 6 { 5 7 var $ItemListFormClass = array( -
trunk/www/Application/View/Client.php
r77 r78 1 1 <?php 2 2 3 class ClientView extends Module 3 include_once(dirname(__FILE__).'/../../Base/Module.php'); 4 5 class ClientView extends View 4 6 { 5 7 var $ItemListFormClass = array( -
trunk/www/Application/View/Cluster.php
r76 r78 1 1 <?php 2 2 3 class ClusterView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class ClusterView extends View 4 6 { 5 7 var $ItemListFormClass = array( -
trunk/www/Application/View/Database.php
r69 r78 1 1 <?php 2 2 3 class DatabaseView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class DatabaseView extends View 4 6 { 5 7 function Import() -
trunk/www/Application/View/Debug.php
r72 r78 1 1 <?php 2 2 3 class DebugView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class DebugView extends View 4 6 { 5 7 var $ItemListFormClass = array( -
trunk/www/Application/View/Emulator.php
r77 r78 1 1 <?php 2 2 3 class EmulatorView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class EmulatorView extends View 4 6 { 5 7 var $ItemFormClass = array( -
trunk/www/Application/View/HomePage.php
r73 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 include_once(dirname(__FILE__).'/../Model/Platform.php'); 2 5 3 6 class HomePageView extends View -
trunk/www/Application/View/News.php
r72 r78 1 1 <?php 2 2 3 class NewsView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class NewsView extends View 4 6 { 5 7 var $ItemFormClass = array( … … 43 45 while($DbRow = $DbResult->fetch_assoc()) 44 46 { 45 $Output .= '<div><strong>'.$DbRow['Title'].'</strong>('. HumanDate($DbRow['Time']).')<br />'.$DbRow['Content'].'</div>';47 $Output .= '<div><strong>'.$DbRow['Title'].'</strong>('.$DbRow['Time'].')<br />'.$DbRow['Content'].'</div>'; 46 48 } 47 49 $Output .= '</td>'; -
trunk/www/Application/View/Page.php
r77 r78 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 include_once(dirname(__FILE__).'/News.php'); 2 5 3 6 class PageView extends View … … 56 59 '<li>Správce: '.$this->Config['Web']['Admin'].'</li>'. 57 60 '<li>E-mail: '.$this->Config['Web']['AdminEmail'].'</li>'; 58 if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '. HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B</li>';61 if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '.$this->System->AddPrefixMultipliers(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B</li>'; 59 62 $Output .= '</ul></div></body></html>'; 60 63 return($Output); -
trunk/www/Application/View/Realm.php
r77 r78 1 1 <?php 2 2 3 class RealmView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class RealmView extends View 4 6 { 5 7 var $ItemFormClass = array( -
trunk/www/Application/View/Server.php
r77 r78 1 1 <?php 2 2 3 class ServerView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class ServerView extends View 4 6 { 5 7 var $ItemFormClass = array( … … 256 258 $Form->LoadValuesFromDatabase($_GET['Id']); 257 259 $Form->Values['ServerId'] = $_GET['Id']; 258 $Form->OnSubmit = '? Action=ServerSave';260 $Form->OnSubmit = '?Module=Server&Action=Save'; 259 261 $Output .= $Form->ShowEditForm(); 260 262 } else $Output = $this->System->SystemMessage('Nastavení serveru', 'Nemáte oprávnění'); -
trunk/www/Application/View/Task.php
r72 r78 1 1 <?php 2 2 3 class TaskView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class TaskView extends View 4 6 { 5 7 var $ItemListFormClass = array( … … 26 28 global $Config; 27 29 28 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 30 $Output = '<h4>Fronta úloh</h4>'; 31 $Table = new Table($this->ItemListFormClass); 32 $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)'; 34 $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => ''); 35 $Table->LoadValuesFromDatabase($this->Database); 36 $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => ''); 37 foreach($Table->Values as $Index => $Item) 29 38 { 30 $Output = '<h4>Fronta úloh</h4>'; 31 $Table = new Table($this->ItemListFormClass); 32 $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)'; 34 $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => ''); 35 $Table->LoadValuesFromDatabase($this->Database); 36 $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => ''); 37 foreach($Table->Values as $Index => $Item) 38 { 39 $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&Action=ErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&Action=StandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 unset($Table->Values[$Index]['Id']); 41 } 42 $Output .= $Table->Show(); 43 $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>'; 44 } else $Output = USER_BAD_ROLE; 39 $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&Action=ErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&Action=StandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 unset($Table->Values[$Index]['Id']); 41 } 42 $Output .= $Table->Show(); 43 $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>'; 45 44 return($Output); 46 45 } -
trunk/www/Application/View/Update.php
r69 r78 1 1 <?php 2 2 3 class UpdateView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class UpdateView extends View 4 6 { 5 7 function ItemList() -
trunk/www/Application/View/User.php
r77 r78 1 1 <?php 2 2 3 class UserView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class UserView extends View 4 6 { 5 7 var $OptionsFormClass = array( … … 142 144 { 143 145 $UserOptions = new Form($this->System, $this->OptionsFormClass); 144 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']-> User['Id']);146 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Data['Id']); 145 147 $UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave'; 146 148 $Output = $UserOptions->ShowEditForm(); … … 152 154 $UserOptions = new Form($this->System, $this->OptionsFormClass, array()); 153 155 $UserOptions->LoadValuesFromForm(); 154 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']-> User['Id']);156 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->Data['Id']); 155 157 $Page = new PageView($this->System); 156 158 $Output = $Page->SystemMessage('Nastavení', 'Nastavení uloženo.'); 157 159 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 158 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']-> User['Id']);160 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Data['Id']); 159 161 $UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave'; 160 162 $Output .= $UserOptions->ShowEditForm();
Note:
See TracChangeset
for help on using the changeset viewer.