Changeset 343 for trunk/index.php


Ignore:
Timestamp:
Jan 17, 2012, 1:00:26 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Správa uživatelů je nyní přetvořena na modul modulárního systému.
  • Upraveno: Hlavní objekt System je nyní odvozen z třídy ModularSystem.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r305 r343  
    2222      if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    2323        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->Modules['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
     24        if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    2525        $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    2626    }
     
    6161    //$Output .= 'Server běží: '.$this->GetServerUptime().' &nbsp;  &nbsp; ';
    6262
    63     if($this->System->Modules['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->Modules['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'].'))');
    6666      if($DbResult->num_rows > 0)
    6767      {
     
    7878  {
    7979    $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />';
    80     if($this->System->Modules['User']->CheckPermission('Finance', 'MemberOptions'))
     80    if($this->System->Models['User']->CheckPermission('Finance', 'MemberOptions'))
    8181      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />';
    82     if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     82    if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    8383      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/user_state.php">Finance</a><br />';
    84     if($this->System->Modules['User']->CheckPermission('Network', 'RegistredHostList'))
     84    if($this->System->Models['User']->CheckPermission('Network', 'RegistredHostList'))
    8585      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/user_hosts.php">Počítače</a><br />';
    86     if($this->System->Modules['User']->CheckPermission('News', 'Insert'))
     86    if($this->System->Models['User']->CheckPermission('News', 'Insert'))
    8787      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />';
    88     if($this->System->Modules['User']->CheckPermission('EatingPlace', 'Edit'))
     88    if($this->System->Models['User']->CheckPermission('EatingPlace', 'Edit'))
    8989      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/menuedit.php">Editace jídelníčků</a><br />';
    90     if($this->System->Modules['User']->CheckPermission('Finance', 'Manage'))
     90    if($this->System->Models['User']->CheckPermission('Finance', 'Manage'))
    9191      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/manage.php">Správa financí</a><br />';
    92     if($this->System->Modules['User']->CheckPermission('Network', 'Administration'))
     92    if($this->System->Models['User']->CheckPermission('Network', 'Administration'))
    9393      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/administration.php">Správa sítě</a><br />';
    9494    return($Output);
     
    156156        $Form = new Form('UserLogin');
    157157        $Form->OnSubmit = '?Action=Login';
    158         $Result = $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password']);
     158        $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']);
    159159        $Output .= $this->SystemMessage('Přihlášení', $Result);
    160160        if($Result <> USER_LOGGED_IN)
     
    169169      if($_GET['Action'] == 'Logout')
    170170      {
    171         $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout());
     171        $Output .= $this->SystemMessage('Odhlášení', $this->System->Models['User']->Logout());
    172172      } else
    173173      if($_GET['Action'] == 'UserOptions')
    174174      {
    175175        $UserOptions = new Form('UserOptions');
    176         $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     176        $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
    177177        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    178178        $Output .= $UserOptions->ShowEditForm();
     
    182182        $UserOptions = new Form('UserOptions', array());
    183183        $UserOptions->LoadValuesFromForm();
    184         $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']);
     184        $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']);
    185185        $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
    186186        $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
    187         $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     187        $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
    188188        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    189189        $Output .= $UserOptions->ShowEditForm();
     
    198198      if($_GET['Action'] == 'UserRegisterConfirm')
    199199      {
    200         $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));
     200        $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Models['User']->RegisterConfirm($_GET['User'], $_GET['H']));
    201201      } else
    202202      if($_GET['Action'] == 'PasswordRecovery')
     
    210210        $Form = new Form('PasswordRecovery');
    211211        $Form->LoadValuesFromForm();
    212         $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     212        $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    213213        $Output .= $this->SystemMessage('Obnova hesla', $Result);
    214214        if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     
    219219      if($_GET['Action'] == 'PasswordRecoveryConfirm')
    220220      {
    221         $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['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']));
    222222      } else
    223223      if($_GET['Action'] == 'UserRegisterSave')
     
    225225        $Form = new Form('UserRegister', array());
    226226        $Form->LoadValuesFromForm();
    227         $Result = $this->System->Modules['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']);
    228228        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
    229229        if($Result <> USER_REGISTRATED)
     
    236236      {
    237237        $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->Modules['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']);
    239239        $DbRow = $DbResult->fetch_array();
    240240        foreach($UserOptions->Definition['Items'] as $Index => $Item)
     
    254254          $UserOptions->Values['BillingPeriodNext'] = 2;
    255255         
    256         $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['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->Modules['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']);
    258258        $Member = $DbResult->fetch_assoc();
    259259        $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']));
    260260        $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.');
    261261        $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->Modules['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']);
    263263        $DbRow = $DbResult->fetch_array();
    264264        foreach($UserOptions->Definition['Items'] as $Index => $Item)
     
    290290        else if($Panel['Module'] == 'UserOptions')
    291291        {
    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());
    293294        } else
    294295        if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
Note: See TracChangeset for help on using the changeset viewer.