Changeset 343 for trunk/index.php
- Timestamp:
- Jan 17, 2012, 1:00:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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());
Note:
See TracChangeset
for help on using the changeset viewer.