Changeset 383 for trunk/Modules/FrontPage/FrontPage.php
- Timestamp:
- Jan 23, 2012, 10:37:31 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FrontPage/FrontPage.php
r378 r383 15 15 if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png'; 16 16 if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL']; 17 if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Mod els['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))17 if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation']))) 18 18 $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />'; 19 19 } … … 54 54 //$Output .= 'Server běží: '.$this->GetServerUptime().' '; 55 55 56 if($this->System->Mod els['User']->CheckPermission('Finance', 'DisplaySubjectState'))57 { 58 $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Mod els['User']->User['Id'].'))');56 if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState')) 57 { 58 $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Modules['User']->Models['User']->User['Id'].'))'); 59 59 if($DbResult->num_rows > 0) 60 60 { … … 71 71 { 72 72 $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />'; 73 if($this->System->Mod els['User']->CheckPermission('Finance', 'MemberOptions'))73 if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'MemberOptions')) 74 74 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />'; 75 if($this->System->Mod els['User']->CheckPermission('Finance', 'DisplaySubjectState'))75 if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState')) 76 76 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/uzivatel/">Finance</a><br />'; 77 if($this->System->Mod els['User']->CheckPermission('Network', 'RegistredHostList'))77 if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'RegistredHostList')) 78 78 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/registrovane-pocitace/">Počítače</a><br />'; 79 if($this->System->Mod els['User']->CheckPermission('News', 'Insert'))79 if($this->System->Modules['User']->Models['User']->CheckPermission('News', 'Insert')) 80 80 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />'; 81 if($this->System->Mod els['User']->CheckPermission('EatingPlace', 'Edit'))81 if($this->System->Modules['User']->Models['User']->CheckPermission('EatingPlace', 'Edit')) 82 82 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/edit/">Editace jídelníčků</a><br />'; 83 if($this->System->Mod els['User']->CheckPermission('Finance', 'Manage'))83 if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'Manage')) 84 84 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/sprava/">Správa financí</a><br />'; 85 if($this->System->Mod els['User']->CheckPermission('Network', 'Administration'))85 if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'Administration')) 86 86 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/sprava/">Správa sítě</a><br />'; 87 87 return($Output); … … 149 149 $Form = new UserLoginView($this->Database); 150 150 $Form->OnSubmit = '?Action=Login'; 151 $Result = $this->System->Mod els['User']->Login($_POST['Username'], $_POST['Password']);151 $Result = $this->System->Modules['User']->Models['User']->Login($_POST['Username'], $_POST['Password']); 152 152 $Output .= $this->SystemMessage('Přihlášení', $Result); 153 153 if($Result <> USER_LOGGED_IN) … … 162 162 if($_GET['Action'] == 'Logout') 163 163 { 164 $Output .= $this->SystemMessage('Odhlášení', $this->System->Mod els['User']->Logout());164 $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Models['User']->Logout()); 165 165 } else 166 166 if($_GET['Action'] == 'UserOptions') 167 167 { 168 168 $UserOptions = new UserOptionsView($this->Database); 169 $UserOptions->LoadValuesFromDatabase($this->System->Mod els['User']->User['Id']);169 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']); 170 170 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 171 171 $Output .= $UserOptions->ShowEditForm(); … … 175 175 $UserOptions = new UserOptionsView($this->Dstabase, array()); 176 176 $UserOptions->LoadValuesFromForm(); 177 $UserOptions->SaveValuesToDatabase($this->System->Mod els['User']->User['Id']);177 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->Models['User']->User['Id']); 178 178 $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.'); 179 179 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 180 $UserOptions->LoadValuesFromDatabase($this->System->Mod els['User']->User['Id']);180 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']); 181 181 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; 182 182 $Output .= $UserOptions->ShowEditForm(); … … 191 191 if($_GET['Action'] == 'UserRegisterConfirm') 192 192 { 193 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Mod els['User']->RegisterConfirm($_GET['User'], $_GET['H']));193 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->Models['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 194 194 } else 195 195 if($_GET['Action'] == 'PasswordRecovery') … … 203 203 $Form = new PasswordRecoveryView($this->Database); 204 204 $Form->LoadValuesFromForm(); 205 $Result = $this->System->Mod els['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);205 $Result = $this->System->Modules['User']->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 206 206 $Output .= $this->SystemMessage('Obnova hesla', $Result); 207 207 if($Result <> USER_PASSWORD_RECOVERY_SUCCESS) … … 212 212 if($_GET['Action'] == 'PasswordRecoveryConfirm') 213 213 { 214 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Mod els['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));214 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 215 215 } else 216 216 if($_GET['Action'] == 'UserRegisterSave') … … 218 218 $Form = new UserRegisterView($this->Database, array()); 219 219 $Form->LoadValuesFromForm(); 220 $Result = $this->System->Mod els['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);220 $Result = $this->System->Modules['User']->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']); 221 221 $Output .= $this->SystemMessage('Registrace nového účtu', $Result); 222 222 if($Result <> USER_REGISTRATED) … … 229 229 { 230 230 $UserOptions = new MemberOptionsView($this->Database); 231 $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 els['User']->User['Member']);231 $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->Modules['User']->Models['User']->User['Member']); 232 232 $DbRow = $DbResult->fetch_array(); 233 233 foreach($UserOptions->Items as $Index => $Item) … … 247 247 $UserOptions->Values['BillingPeriodNext'] = 2; 248 248 249 $DbResult = $this->Database->update('Member', 'Id='.$this->System->Mod els['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));250 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Mod els['User']->User['Member']);249 $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['User']->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext'])); 250 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Modules['User']->Models['User']->User['Member']); 251 251 $Member = $DbResult->fetch_assoc(); 252 252 $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'])); 253 253 $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.'); 254 254 $this->System->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', $UserOptions->Values['Name']); 255 $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 els['User']->User['Member']);255 $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->Modules['User']->Models['User']->User['Member']); 256 256 $DbRow = $DbResult->fetch_array(); 257 257 foreach($UserOptions->Items as $Index => $Item) … … 288 288 else if($Panel['Module'] == 'UserOptions') 289 289 { 290 if($this->System->Mod els['User']->User['Id'] != $this->System->Models['User']->AnonymousUserId)290 if($this->System->Modules['User']->Models['User']->User['Id'] != $this->System->Modules['User']->Models['User']->AnonymousUserId) 291 291 $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); 292 292 } else
Note:
See TracChangeset
for help on using the changeset viewer.