- Timestamp:
- Jan 17, 2012, 1:00:26 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogShow.php
r183 r343 11 11 function Show() 12 12 { 13 if(!$this->System->Mod ules['User']->CheckPermission('Log', 'Show')) return('Nemáte oprávnění');13 if(!$this->System->Models['User']->CheckPermission('Log', 'Show')) return('Nemáte oprávnění'); 14 14 $DbResult = $this->Database->select('Log', 'COUNT(*)'); 15 15 $RowTotal = $DbResult->fetch_array(); -
trunk/Model.php
r342 r343 4 4 define('PropertyText', 'Text'); 5 5 define('PropertyString', 'String'); 6 define('PropertyBoolean', 'Boolean'); 6 7 define('PropertyInteger', 'Integer'); 7 8 define('PropertyFloat', 'Float'); … … 15 16 var $Name; 16 17 var $Properties; 18 var $System; 17 19 18 function __construct($Database )20 function __construct($Database, $System) 19 21 { 20 22 $this->Database = &$Database; 23 $this->System = &$System; 21 24 $this->AddPropertyDateTime('TimeCreate'); 22 25 $this->AddPropertyOneToMany('UserCreate', 'User'); … … 54 57 { 55 58 $this->Properties[] = array('Name' => $Name, 'Type' => PropertyFloat); 59 } 60 61 function AddPropertyBoolean($Name) 62 { 63 $this->Properties[] = array('Name' => $Name, 'Type' => PropertyBoolean); 56 64 } 57 65 -
trunk/Modules/Module.php
r342 r343 14 14 var $Database; 15 15 var $Installed; 16 var $System; 16 17 17 function __construct($Database )18 function __construct($Database, $System) 18 19 { 19 20 $this->Database = &$Database; 21 $this->System = &$System; 20 22 } 21 23 … … 25 27 foreach($this->Models as $ModelName) 26 28 { 27 $Model = new $ModelName($this->Database );29 $Model = new $ModelName($this->Database, $this->System); 28 30 $Model->Install(); 29 31 unset($Model); … … 37 39 foreach($this->Models as $ModelName) 38 40 { 39 $Model = new $ModelName($this->Database );41 $Model = new $ModelName($this->Database, $this->System); 40 42 $Model->UnInstall(); 41 43 unset($Model); 42 44 } 43 45 $this->Database->query('UPDATE Module SET Installed=0 WHERE Name="'.$this->Name.'"'); 46 } 47 48 function Init() 49 { 44 50 } 45 51 } … … 49 55 var $Database; 50 56 var $Modules = array(); 57 var $Models = array(); 51 58 52 59 function __construct($Database) … … 55 62 } 56 63 64 function ModulePresent($Name) 65 { 66 return(array_key_exists($Name, $this->Modules)); 67 } 68 57 69 function Init($Installed = true) 58 70 { … … 63 75 while($Module = $DbResult->fetch_array()) 64 76 { 65 include_once( 'Modules/'.$Module['Name'].'/'.$Module['Name'].'.php');77 include_once(dirname(__FILE__).'/'.$Module['Name'].'/'.$Module['Name'].'.php'); 66 78 $ModuleClassName = 'Module'.$Module['Name']; 67 $this->Modules[$Module['Name']] = new $ModuleClassName($this->Database); 79 $this->Modules[$Module['Name']] = new $ModuleClassName($this->Database, $this); 80 $this->Modules[$Module['Name']]->Init(); 68 81 } 69 82 } … … 108 121 // Load list of modules on disk 109 122 $ModulesOnDisk = array(); 110 $Files = scandir( 'Modules');123 $Files = scandir(dirname(__FILE__)); 111 124 foreach($Files as $File) 112 if(is_dir( 'Modules/'.$File) and ($File != '.') and ($File != '..'))125 if(is_dir(dirname(__FILE__).'/'.$File) and ($File != '.') and ($File != '..')) 113 126 { 114 127 $ModulesOnDisk[] = $File; … … 120 133 { 121 134 DebugLog('Adding module '.$ModuleName.' to list'); 122 include_once( 'Modules/'.$ModuleName.'/'.$ModuleName.'.php');135 include_once(dirname(__FILE__).'/'.$ModuleName.'/'.$ModuleName.'.php'); 123 136 $ModuleClassName = 'Module'.$ModuleName; 124 137 if(class_exists($ModuleClassName)) 125 138 { 126 $Module = new $ModuleClassName($this->Database );139 $Module = new $ModuleClassName($this->Database, $this); 127 140 $this->Database->insert('Module', array('Name' => $Module->Name, 128 141 'Version' => $Module->Version, 'Creator' => $Module->Creator, -
trunk/Modules/Project/Project.php
r342 r343 6 6 class Project extends Model 7 7 { 8 function __construct($Database )8 function __construct($Database, $System) 9 9 { 10 parent::__construct($Database );10 parent::__construct($Database, $System); 11 11 $this->Name = 'Project'; 12 12 $this->AddPropertyDateTime('TimeSchedule'); … … 19 19 class ProjectComment extends Model 20 20 { 21 function __construct($Database )21 function __construct($Database, $System) 22 22 { 23 parent::__construct($Database );23 parent::__construct($Database, $System); 24 24 $this->Name = 'ProjectComment'; 25 25 $this->AddPropertyOneToMany('Project', 'Project'); … … 30 30 class ModuleProject extends Module 31 31 { 32 function __construct($Database )32 function __construct($Database, $System) 33 33 { 34 parent::__construct($Database );34 parent::__construct($Database, $System); 35 35 $this->Name = 'Project'; 36 36 $this->Version = '1.0'; … … 51 51 parent::UnInstall(); 52 52 } 53 54 function Init() 55 { 56 } 53 57 } 54 58 -
trunk/Modules/User/user.php
r341 r343 26 26 define('USER_EVENT_OPTIONS_CHANGED', 4); 27 27 28 class User extends OldModule28 class User extends Model 29 29 { 30 30 var $Dependencies = array('Log'); … … 34 34 var $AnonymousUserId = 98; 35 35 var $OnlineStateTimeout = 600; // in seconds 36 37 function __construct($Database, $System) 38 { 39 parent::__construct($Database, $System); 40 $this->Name = 'User'; 41 $this->AddPropertyString('Login'); 42 $this->AddPropertyString('Name'); 43 $this->AddPropertyString('Password'); 44 $this->AddPropertyString('Email'); 45 $this->AddPropertyString('LastIpAddress'); 46 $this->AddPropertyDateTime('LastLoginTime'); 47 $this->AddPropertyDateTime('RegistrationTime'); 48 $this->AddPropertyOneToMany('User', 'User'); 49 $this->AddPropertyBoolean('Locked'); 50 $this->AddPropertyInteger('ICQ'); 51 $this->AddPropertyString('PhoneNumber'); 52 $this->AddPropertyString('InitPassword'); 53 } 36 54 37 55 function Check() … … 266 284 } 267 285 286 class UserOnline extends Model 287 { 288 function __construct($Database, $System) 289 { 290 parent::__construct($Database, $System); 291 $this->Name = 'UserOnline'; 292 $this->AddPropertyOneToMany('User', 'User'); 293 $this->AddPropertyDateTime('ActivityTime'); 294 $this->AddPropertyDateTime('LoginTime'); 295 $this->AddPropertyString('SessionId'); 296 $this->AddPropertyString('IpAddress'); 297 $this->AddPropertyString('HostName'); 298 $this->AddPropertyString('ScriptName'); 299 } 300 } 301 268 302 class ModuleUser extends Module 269 303 { 270 function __construct($Database )271 { 272 parent::__construct($Database );304 function __construct($Database, $System) 305 { 306 parent::__construct($Database, $System); 273 307 $this->Name = 'User'; 274 308 $this->Version = '1.0'; … … 277 311 $this->Description = 'User management'; 278 312 $this->Dependencies = array(); 279 //$this->Models = array('User', 'UserOnline'); 280 } 313 $this->Models = array('User', 'UserOnline'); 314 } 315 316 function Init() 317 { 318 $this->System->Models['User'] = new User($this->Database, $this->System); 319 } 320 321 function Install() 322 { 323 parent::Install(); 324 } 325 326 function UnInstall() 327 { 328 parent::UnInstall(); 329 } 281 330 } 282 331 -
trunk/Modules/log.php
r340 r343 7 7 function NewRecord($Module, $Operation, $Value = '') 8 8 { 9 $this->Database->insert('Log', array('Time' => 'NOW()', 'User' => $this->System->Mod ules['User']->User['Id'], 'Module' => $Module, 'Operation' => $Operation, 'Value' => $Value));9 $this->Database->insert('Log', array('Time' => 'NOW()', 'User' => $this->System->Models['User']->User['Id'], 'Module' => $Module, 'Operation' => $Operation, 'Value' => $Value)); 10 10 //echo($this->Database->LastQuery); 11 11 } -
trunk/Modules/page.php
r340 r343 152 152 if($this->System->Config['Web']['UserSupport'] == 1) 153 153 { 154 if($this->System->Mod ules['User']->User['Id'] == $this->System->Modules['User']->AnonymousUserId)154 if($this->System->Models['User']->User['Id'] == $this->System->Models['User']->AnonymousUserId) 155 155 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=LoginForm">Přihlášení</a> <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserRegister">Registrace</a>'; 156 else $Output .= $this->System->Mod ules['User']->User['Name'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';156 else $Output .= $this->System->Models['User']->User['Name'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>'; 157 157 } else $Output .= ' '; 158 158 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; -
trunk/aktuality/index.php
r311 r343 27 27 { 28 28 case 'view': 29 if(!$this->System->Mod ules['User']->CheckPermission('News', 'Display', 'Item')) $Output .= 'Nemáte oprávnění';29 if(!$this->System->Models['User']->CheckPermission('News', 'Display', 'Item')) $Output .= 'Nemáte oprávnění'; 30 30 else 31 31 { … … 39 39 else $Author = $Row['Name']; 40 40 $Output .= '<div class="Panel"><div class="Title">'.$Row['Title'].' ('.HumanDate($Row['Date']).', '.$Author.')'; 41 if($this->System->Mod ules['User']->User['Id'] == $Row['User'])41 if($this->System->Models['User']->User['Id'] == $Row['User']) 42 42 { 43 43 $Output .= '<div class="Action">'; … … 69 69 while($DbRow = $DbResult->fetch_array()) 70 70 { 71 if($this->System->Mod ules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['Id']))71 if($this->System->Models['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['Id'])) 72 72 { 73 73 if($DbRow['Id'] == $Category) $Selected = ' selected="1"'; else $Selected = ''; … … 88 88 case 'add2': 89 89 $RemoteAddr = GetRemoteAddress(); 90 if($this->System->Mod ules['User']->CheckPermission('News', 'Insert', 'Group', $Category))90 if($this->System->Models['User']->CheckPermission('News', 'Insert', 'Group', $Category)) 91 91 { 92 92 //print_r($_FILES); … … 110 110 111 111 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 112 $this->Database->insert('News', array('Category' => $Category, 'Title' => $_POST['title'], 'Content' => $_POST['content'], 'Date' => 'NOW()', 'IP' => $RemoteAddr, 'Enclosure' => $Enclosures, 'Author' => $this->System->Mod ules['User']->User['Name'], 'User' => $this->System->Modules['User']->User['Id'], 'Link' => $_POST['link']));112 $this->Database->insert('News', array('Category' => $Category, 'Title' => $_POST['title'], 'Content' => $_POST['content'], 'Date' => 'NOW()', 'IP' => $RemoteAddr, 'Enclosure' => $Enclosures, 'Author' => $this->System->Models['User']->User['Name'], 'User' => $this->System->Models['User']->User['Id'], 'Link' => $_POST['link'])); 113 113 $Output .= 'Aktualita přidána!<br />Pokud budete chtít vaši aktualitu smazat, klikněte na odkaz Smazat v seznamu všech aktualit v kategorii.<br /><br />'; 114 114 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 119 119 $DbResult = $this->Database->query('SELECT * FROM News WHERE Id='.$_GET['id']); 120 120 $Row = $DbResult->fetch_array(); 121 if($this->System->Mod ules['User']->User['Id'] == $Row['User'])121 if($this->System->Models['User']->User['Id'] == $Row['User']) 122 122 { 123 123 $Row['Content'] = str_replace('<br />', '', $Row['Content']); … … 140 140 { 141 141 $Row = $DbResult->fetch_array(); 142 if($this->System->Mod ules['User']->User['Id'] == $Row['User'])142 if($this->System->Models['User']->User['Id'] == $Row['User']) 143 143 { 144 144 $_POST['content'] = str_replace("\n", '<br />', $_POST['content']); … … 152 152 $DbResult = $this->Database->query('SELECT * FROM News WHERE Id='.$_GET['id']); 153 153 $Row = $DbResult->fetch_array(); 154 if($this->System->Mod ules['User']->User['Id'] == $Row['User'])154 if($this->System->Models['User']->User['Id'] == $Row['User']) 155 155 { 156 156 if($Row['Enclosure'] != '') … … 168 168 break; 169 169 default: 170 if($this->System->Mod ules['User']->CheckPermission('News', 'Display', 'Group', $Category))170 if($this->System->Models['User']->CheckPermission('News', 'Display', 'Group', $Category)) 171 171 { 172 172 $News = new News($this->Database); … … 187 187 else $Author = $Row['Name']; 188 188 $Output .= '<div class="Panel"><div class="Title"><a href="?action=view&id='.$Row['Id'].'">'.$Row['Title'].'</a> ('.HumanDate($Row['Date']).', '.$Author.')'; 189 if($this->System->Mod ules['User']->User['Id'] == $Row['User'])189 if($this->System->Models['User']->User['Id'] == $Row['User']) 190 190 { 191 191 $Output .= '<div class="Action">'; -
trunk/aktuality/news.php
r340 r343 51 51 $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption']; 52 52 $Output .= '<div class="Action"><a href="aktuality/index.php?category='.$Category.'">Zobrazit</a>'; 53 if($this->System->Mod ules['User']->CheckPermission('News', 'Insert', 'Group', $Category))53 if($this->System->Models['User']->CheckPermission('News', 'Insert', 'Group', $Category)) 54 54 $Output .= ' <a href="aktuality/index.php?action=add&category='.$Category.'">Přidat</a>'; 55 55 $Output .= '</div></div><div class="Content">'; -
trunk/chat/history.php
r150 r343 19 19 global $MonthNames; 20 20 21 if(!$this->System->Mod ules['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');21 if(!$this->System->Models['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění'); 22 22 23 23 if(array_key_exists('date',$_GET)) $Date = $_GET['date']; else $Date = date('Y-m-d'); -
trunk/finance/clenove.php
r327 r343 11 11 $Finance = $this->System->Modules['Finance']; 12 12 $this->System->Modules['Finance']->LoadTariffs(); 13 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');13 if(!$this->System->Models['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění'); 14 14 15 15 $Output = 'Seznam účastníků:<br/>'; -
trunk/finance/import.php
r335 r343 9 9 function Show() 10 10 { 11 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');11 if(!$this->System->Models['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění'); 12 12 if(array_key_exists('Operation', $_GET)) 13 13 { -
trunk/finance/index.php
r294 r343 15 15 $Output .= '<a href="tarify.php">Tarify</a><br />'; 16 16 $Output .= '<a href="zarizeni.php">Výpis zařízení</a><br />'; 17 if($this->System->Mod ules['User']->CheckPermission('Finance', 'SubjectList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />';17 if($this->System->Models['User']->CheckPermission('Finance', 'SubjectList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />'; 18 18 $Output .= '<a href="spotreba.php">Spotřeba energie</a><br />'; 19 19 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/index.php?category=9">Investice v síti</a><br />'; -
trunk/finance/manage.php
r340 r343 9 9 function Show() 10 10 { 11 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');11 if(!$this->System->Models['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 12 12 13 13 if(array_key_exists('Operation', $_GET)) $Operation = $_GET['Operation']; else $Operation = ''; … … 274 274 function ShowMonthlyPayment() 275 275 { 276 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');276 if(!$this->System->Models['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 277 277 $Output = ''; 278 278 -
trunk/finance/user_state.php
r294 r343 15 15 if(array_key_exists('Subject', $_GET)) 16 16 { 17 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');17 if(!$this->System->Models['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 18 18 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id='.$_GET['Subject']); 19 19 $Subject = $DbResult->fetch_assoc(); 20 20 } else 21 21 { 22 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění');23 $UserId = $this->System->Mod ules['User']->User['Id'];22 if(!$this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 23 $UserId = $this->System->Models['User']->User['Id']; 24 24 $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$UserId.'))'); 25 25 $Subject = $DbResult->fetch_assoc(); -
trunk/finance/zivnost.php
r338 r343 76 76 function Show() 77 77 { 78 if(!$this->System->Mod ules['User']->CheckPermission('Finance', 'TradingStatus')) return('Nemáte oprávnění');78 if(!$this->System->Models['User']->CheckPermission('Finance', 'TradingStatus')) return('Nemáte oprávnění'); 79 79 $this->System->Modules['Finance']->LoadTariffs(1); 80 80 //TransformFinance(); -
trunk/global.php
r342 r343 20 20 include_once('Modules/Module.php'); 21 21 include_once('Model.php'); 22 include_once('Modules/User/user.php');23 22 24 23 $PrefixMultipliers = array … … 91 90 ); 92 91 93 class System extends OldModule 94 { 95 var $Modules = array(); 96 97 function ModulePresent($Name) 98 { 99 return(array_key_exists($Name, $this->Modules)); 100 } 101 92 class System extends ModularSystem 93 { 94 102 95 function AddModule($Module) 103 96 { … … 211 204 $Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery']; 212 205 213 $System = new System( );206 $System = new System($Database); 214 207 $System->Config = $Config; 215 $System->Database = &$Database; 208 //$System->Install(); 209 //$System->ReloadList(); 210 $System->Init(); 211 if(isset($_SERVER['REMOTE_ADDR'])) $System->Models['User']->Check(); 216 212 $System->AddModule(new Log()); 217 $System->AddModule(new User());218 if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check();219 213 $System->AddModule(new News()); 220 214 $System->AddModule(new Webcam()); … … 222 216 $System->AddModule(new Finance()); 223 217 $System->Modules['Finance']->LoadMonthParameters(0); 224 225 $System->ModularSystem = new ModularSystem($Database);226 $System->ModularSystem->Install();227 //$System->ModularSystem->ReloadList();228 $System->ModularSystem->Init();229 218 } 230 219 -
trunk/index.php
r305 r343 22 22 if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png'; 23 23 if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL']; 24 if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Mod ules['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))24 if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation']))) 25 25 $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />'; 26 26 } … … 61 61 //$Output .= 'Server běží: '.$this->GetServerUptime().' '; 62 62 63 if($this->System->Mod ules['User']->CheckPermission('Finance', 'DisplaySubjectState'))64 { 65 $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Mod ules['User']->User['Id'].'))');63 if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState')) 64 { 65 $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Models['User']->User['Id'].'))'); 66 66 if($DbResult->num_rows > 0) 67 67 { … … 78 78 { 79 79 $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />'; 80 if($this->System->Mod ules['User']->CheckPermission('Finance', 'MemberOptions'))80 if($this->System->Models['User']->CheckPermission('Finance', 'MemberOptions')) 81 81 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />'; 82 if($this->System->Mod ules['User']->CheckPermission('Finance', 'DisplaySubjectState'))82 if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState')) 83 83 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/user_state.php">Finance</a><br />'; 84 if($this->System->Mod ules['User']->CheckPermission('Network', 'RegistredHostList'))84 if($this->System->Models['User']->CheckPermission('Network', 'RegistredHostList')) 85 85 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/user_hosts.php">Počítače</a><br />'; 86 if($this->System->Mod ules['User']->CheckPermission('News', 'Insert'))86 if($this->System->Models['User']->CheckPermission('News', 'Insert')) 87 87 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />'; 88 if($this->System->Mod ules['User']->CheckPermission('EatingPlace', 'Edit'))88 if($this->System->Models['User']->CheckPermission('EatingPlace', 'Edit')) 89 89 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/menuedit.php">Editace jídelníčků</a><br />'; 90 if($this->System->Mod ules['User']->CheckPermission('Finance', 'Manage'))90 if($this->System->Models['User']->CheckPermission('Finance', 'Manage')) 91 91 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/manage.php">Správa financí</a><br />'; 92 if($this->System->Mod ules['User']->CheckPermission('Network', 'Administration'))92 if($this->System->Models['User']->CheckPermission('Network', 'Administration')) 93 93 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/administration.php">Správa sítě</a><br />'; 94 94 return($Output); … … 156 156 $Form = new Form('UserLogin'); 157 157 $Form->OnSubmit = '?Action=Login'; 158 $Result = $this->System->Mod ules['User']->Login($_POST['Username'], $_POST['Password']);158 $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']); 159 159 $Output .= $this->SystemMessage('Přihlášení', $Result); 160 160 if($Result <> USER_LOGGED_IN) … … 169 169 if($_GET['Action'] == 'Logout') 170 170 { 171 $Output .= $this->SystemMessage('Odhlášení', $this->System->Mod ules['User']->Logout());171 $Output .= $this->SystemMessage('Odhlášení', $this->System->Models['User']->Logout()); 172 172 } else 173 173 if($_GET['Action'] == 'UserOptions') 174 174 { 175 175 $UserOptions = new Form('UserOptions'); 176 $UserOptions->LoadValuesFromDatabase($this->System->Mod ules['User']->User['Id']);176 $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']); 177 177 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 178 178 $Output .= $UserOptions->ShowEditForm(); … … 182 182 $UserOptions = new Form('UserOptions', array()); 183 183 $UserOptions->LoadValuesFromForm(); 184 $UserOptions->SaveValuesToDatabase($this->System->Mod ules['User']->User['Id']);184 $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']); 185 185 $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.'); 186 186 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 187 $UserOptions->LoadValuesFromDatabase($this->System->Mod ules['User']->User['Id']);187 $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']); 188 188 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 189 189 $Output .= $UserOptions->ShowEditForm(); … … 198 198 if($_GET['Action'] == 'UserRegisterConfirm') 199 199 { 200 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Mod ules['User']->RegisterConfirm($_GET['User'], $_GET['H']));200 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Models['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 201 201 } else 202 202 if($_GET['Action'] == 'PasswordRecovery') … … 210 210 $Form = new Form('PasswordRecovery'); 211 211 $Form->LoadValuesFromForm(); 212 $Result = $this->System->Mod ules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);212 $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 213 213 $Output .= $this->SystemMessage('Obnova hesla', $Result); 214 214 if($Result <> USER_PASSWORD_RECOVERY_SUCCESS) … … 219 219 if($_GET['Action'] == 'PasswordRecoveryConfirm') 220 220 { 221 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Mod ules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));221 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 222 222 } else 223 223 if($_GET['Action'] == 'UserRegisterSave') … … 225 225 $Form = new Form('UserRegister', array()); 226 226 $Form->LoadValuesFromForm(); 227 $Result = $this->System->Mod ules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);227 $Result = $this->System->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']); 228 228 $Output .= $this->SystemMessage('Registrace nového účtu', $Result); 229 229 if($Result <> USER_REGISTRATED) … … 236 236 { 237 237 $UserOptions = new Form('MemberOptions'); 238 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Mod ules['User']->User['Member']);238 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']); 239 239 $DbRow = $DbResult->fetch_array(); 240 240 foreach($UserOptions->Definition['Items'] as $Index => $Item) … … 254 254 $UserOptions->Values['BillingPeriodNext'] = 2; 255 255 256 $DbResult = $this->Database->update('Member', 'Id='.$this->System->Mod ules['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));257 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Mod ules['User']->User['Member']);256 $DbResult = $this->Database->update('Member', 'Id='.$this->System->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext'])); 257 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Models['User']->User['Member']); 258 258 $Member = $DbResult->fetch_assoc(); 259 259 $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], array('Name' => $UserOptions->Values['Name'], 'AddressStreet' => $UserOptions->Values['AddressStreet'], 'AddressTown' => $UserOptions->Values['AddressTown'], 'AddressPSC' => $UserOptions->Values['AddressPSC'], 'IC' => $UserOptions->Values['IC'], 'DIC' => $UserOptions->Values['DIC'])); 260 260 $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.'); 261 261 $this->System->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', $UserOptions->Values['Name']); 262 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Mod ules['User']->User['Member']);262 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']); 263 263 $DbRow = $DbResult->fetch_array(); 264 264 foreach($UserOptions->Definition['Items'] as $Index => $Item) … … 290 290 else if($Panel['Module'] == 'UserOptions') 291 291 { 292 if($this->System->Modules['User']->User['Id'] != $this->System->Modules['User']->AnonymousUserId) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); 292 if($this->System->Models['User']->User['Id'] != $this->System->Models['User']->AnonymousUserId) 293 $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); 293 294 } else 294 295 if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel()); -
trunk/network/administration.php
r226 r343 9 9 function Show() 10 10 { 11 if(!$this->System->Mod ules['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění');11 if(!$this->System->Models['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění'); 12 12 $Output = ''; 13 13 if(array_key_exists('Action', $_GET)) -
trunk/network/restart.php
r197 r343 50 50 function Show() 51 51 { 52 if(!$this->System->Mod ules['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění');52 if(!$this->System->Models['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění'); 53 53 54 54 if(array_key_exists('Action', $_GET)) -
trunk/network/user_hosts.php
r245 r343 14 14 $Output = '<div align="center" style="font-size: small;"><table class="WideTable">'; 15 15 $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>CZFree adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>'; 16 $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = '.$this->System->Mod ules['User']->User['Member'].' ORDER BY NetworkDevice.Name');16 $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = '.$this->System->Models['User']->User['Member'].' ORDER BY NetworkDevice.Name'); 17 17 while($Device = $DbResult->fetch_assoc()) 18 18 { -
trunk/otevreno.php
r237 r343 34 34 function EditSubject($Id) 35 35 { 36 if($this->System->Mod ules['User']->CheckPermission('SubjectOpenTime', 'Edit'))36 if($this->System->Models['User']->CheckPermission('SubjectOpenTime', 'Edit')) 37 37 { 38 38 $Output = '<div class="Centred">'; … … 76 76 77 77 $Output = ''; 78 if($this->System->Mod ules['User']->CheckPermission('SubjectOpenTime', 'Edit'))78 if($this->System->Models['User']->CheckPermission('SubjectOpenTime', 'Edit')) 79 79 { 80 80 $this->Database->delete('SubjectOpenTimeDay', 'Subject='.$Id); … … 188 188 if($Subject['Photo'] != 0) $Output .= '<a href="FileDownload.php?Id='.$Subject['Photo'].'">Fotka</a> '; 189 189 190 if($this->System->Mod ules['User']->CheckPermission('SubjectOpenTime', 'Edit'))190 if($this->System->Models['User']->CheckPermission('SubjectOpenTime', 'Edit')) 191 191 $Output .= '<a href="?Action=Edit&Subject='.$Subject['Id'].'">Editovat</a><br />'; 192 192 $Output .= '<br />'; -
trunk/share/index.php
r148 r343 69 69 function Show() 70 70 { 71 if(!$this->System->Mod ules['User']->CheckPermission('Share', 'Display')) return('Nemáte oprávnění');71 if(!$this->System->Models['User']->CheckPermission('Share', 'Display')) return('Nemáte oprávnění'); 72 72 73 73 // If not only online checkbox checked -
trunk/style.php
r304 r343 142 142 <div id="Title">'.$Title.'</div> 143 143 <div class="Navigation"><span class="MenuItem"><strong>Navigace >></strong> '.$Navigation.'</span><div class="MenuItem2"> '; 144 //if($System->Mod ules['User']->User['Id'] == $System->Modules['User']->AnonymousUserId)144 //if($System->Models['User']->User['Id'] == $System->Models['User']->AnonymousUserId) 145 145 // $Output .= '<a href="'.$Config['Web']['RootFolder'].'?Action=LoginForm">Přihlášení</a> <a href="'.$Config['Web']['RootFolder'].'?Action=RegistrationForm">Registrace</a>'; 146 // else $Output .= $System->Mod ules['User']->User['Name'].' <a href="?Action=Logout">Odhlásit</a> <a href="?Action=UserOptions">Nastavení</a>';146 // else $Output .= $System->Models['User']->User['Name'].' <a href="?Action=Logout">Odhlásit</a> <a href="?Action=UserOptions">Nastavení</a>'; 147 147 $Output .= '</div></div>'; 148 148 echo($Output);
Note:
See TracChangeset
for help on using the changeset viewer.