Ignore:
Timestamp:
Apr 20, 2013, 8:51:15 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Definice třída User přesunuta do modulu User. Existuje aplikační modul System->ModuleManager->ModulesUser a samotná instance třídy System->User.
  • Upraveno: Zbylá inicializace starého modulového systému třídy Module přesunuta do startovní části aplikačních modulů.
  • Upraveno: Třída System přesunuta ze souboru Common/Global do samostatného souboru Common/System.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Portal/Portal.php

    r523 r524  
    1616      if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    1717        if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL'];
    18         if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->Modules['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
     18        if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->User->User->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    1919        $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    2020    }
     
    5555    //$Output .= 'Server běží: '.$this->GetServerUptime().' &nbsp;  &nbsp; ';
    5656
    57     if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    58     {
    59       $DbResult = $this->Database->select('MemberPayment', 'Cash', 'Member=(SELECT Customer FROM UserCustomerRel WHERE Id='.$this->System->Modules['User']->User['Id'].')');
     57    if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
     58    {
     59      $DbResult = $this->Database->select('MemberPayment', 'Cash', 'Member=(SELECT Customer FROM UserCustomerRel WHERE Id='.$this->System->User->User['Id'].')');
    6060      if($DbResult->num_rows > 0)
    6161      {
     
    7272  {
    7373    $Output = '<a href="'.$this->System->Link('/?Action=UserOptions').'">Profil</a><br />';
    74     if($this->System->Modules['User']->CheckPermission('Finance', 'MemberOptions'))
     74    if($this->System->User->CheckPermission('Finance', 'MemberOptions'))
    7575      $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Domácnost</a><br />';
    76     if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     76    if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
    7777      $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />';
    78     if($this->System->Modules['User']->CheckPermission('Network', 'RegistredHostList'))
     78    if($this->System->User->CheckPermission('Network', 'RegistredHostList'))
    7979      $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />';
    80     if($this->System->Modules['User']->CheckPermission('News', 'Insert'))
     80    if($this->System->User->CheckPermission('News', 'Insert'))
    8181      $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />';
    82     if($this->System->Modules['User']->CheckPermission('EatingPlace', 'Edit'))
     82    if($this->System->User->CheckPermission('EatingPlace', 'Edit'))
    8383      $Output .= '<a href="'.$this->System->Link('/jidelna/menuedit.php').'">Úprava jídelníčků</a><br />';
    84     if($this->System->Modules['User']->CheckPermission('Finance', 'Manage'))
     84    if($this->System->User->CheckPermission('Finance', 'Manage'))
    8585      $Output .= '<a href="'.$this->System->Link('/finance/sprava/').'">Správa financí</a><br />';
    86     if($this->System->Modules['User']->CheckPermission('Network', 'Administration'))
     86    if($this->System->User->CheckPermission('Network', 'Administration'))
    8787      $Output .= '<a href="'.$this->System->Link('/network/administration/').'">Správa sítě</a><br />';
    88     if($this->System->Modules['User']->CheckPermission('IS', 'Manage'))
     88    if($this->System->User->CheckPermission('IS', 'Manage'))
    8989      $Output .= '<a href="'.$this->System->Link('/is/').'">Správa dat</a><br />';
    9090    return($Output);
     
    156156        $Form->SetClass('UserLogin');
    157157        $Form->OnSubmit = '?Action=Login';
    158         $Result = $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password']);
     158        $Result = $this->System->User->Login($_POST['Username'], $_POST['Password']);
    159159        $Output .= $this->SystemMessage('Přihlášení', $Result);
    160160        if($Result <> USER_LOGGED_IN)
     
    170170      if($_GET['Action'] == 'Logout')
    171171      {
    172         if($this->System->Modules['User']->User['Id'] != null)
    173         {
    174           $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout());
     172        if($this->System->User->User['Id'] != null)
     173        {
     174          $Output .= $this->SystemMessage('Odhlášení', $this->System->User->Logout());
    175175        } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen');
    176176      } else
    177177      if($_GET['Action'] == 'UserOptions')
    178178      {
    179         if($this->System->Modules['User']->User['Id'] != null)
     179        if($this->System->User->User['Id'] != null)
    180180        {
    181181          $UserOptions = new Form($this->System->FormManager);
    182182          $UserOptions->SetClass('UserOptions');
    183           $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     183          $UserOptions->LoadValuesFromDatabase($this->System->User->User['Id']);
    184184          $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    185185          $Output .= $UserOptions->ShowEditForm();
     
    191191        $UserOptions->SetClass('UserOptions');
    192192        $UserOptions->LoadValuesFromForm();
    193         $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']);
     193        $UserOptions->SaveValuesToDatabase($this->System->User->User['Id']);
    194194        $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
    195195        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
    196         $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     196        $UserOptions->LoadValuesFromDatabase($this->System->User->User['Id']);
    197197        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    198198        $Output .= $UserOptions->ShowEditForm();
     
    209209      {
    210210        $Output .= $this->SystemMessage('Potvrzení registrace',
    211           $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));
     211          $this->System->User->RegisterConfirm($_GET['User'], $_GET['H']));
    212212      } else
    213213      if($_GET['Action'] == 'PasswordRecovery')
     
    223223        $Form->SetClass('PasswordRecovery');
    224224        $Form->LoadValuesFromForm();
    225         $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     225        $Result = $this->System->User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    226226        $Output .= $this->SystemMessage('Obnova hesla', $Result);
    227227        if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     
    232232      if($_GET['Action'] == 'PasswordRecoveryConfirm')
    233233      {
    234         $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
     234        $Output .= $this->SystemMessage('Obnova hesla', $this->System->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
    235235      } else
    236236      if($_GET['Action'] == 'UserRegisterSave')
     
    239239        $Form->SetClass('UserRegister');
    240240        $Form->LoadValuesFromForm();
    241         $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']);
     241        $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
    242242        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
    243243        if($Result <> USER_REGISTRATED)
     
    251251        $Form = new Form($this->System->FormManager);
    252252        $Form->SetClass('MemberOptions');
    253         $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->Modules['User']->User['Id']);
     253        $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->User->User['Id']);
    254254        if($DbResult->num_rows > 0)
    255255        {
     
    278278          $Form->Values['BillingPeriodNext'] = 2;
    279279         
    280         $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['User']->User['Member'],
     280        $DbResult = $this->Database->update('Member', 'Id='.$this->System->User->User['Member'],
    281281           array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'],
    282282           'BillingPeriodNext' => $Form->Values['BillingPeriodNext']));
    283         $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Modules['User']->User['Member']);
     283        $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->User->User['Member']);
    284284        $Member = $DbResult->fetch_assoc();
    285285        $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'],
     
    294294          'Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, '.
    295295          'Subject.AddressCountry, Subject.IC, Subject.DIC FROM Member JOIN Subject '.
    296           'ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->User['Member']);
     296          'ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->User->User['Member']);
    297297        $DbRow = $DbResult->fetch_array();
    298298        foreach($Form->Definition['Items'] as $Index => $Item)
     
    326326        else if($Panel['Module'] == 'UserOptions')
    327327        {
    328           if($this->System->Modules['User']->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
     328          if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
    329329        } else
    330330        if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
Note: See TracChangeset for help on using the changeset viewer.