Changeset 524 for trunk/Modules


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.
Location:
trunk/Modules
Files:
21 edited
1 moved

Legend:

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

    r519 r524  
    2121    global $MonthNames;
    2222   
    23     if(!$this->System->Modules['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
     23    if(!$this->System->User->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
    2424
    2525    if(array_key_exists('date', $_GET)) $Date = $_GET['date'];
  • trunk/Modules/File/File.php

    r514 r524  
    77  var $FilesDir;
    88 
    9   function __construct($Database)
     9  function __construct($System)
    1010  {
    11     $this->Database = $Database;
     11    parent::__construct($System);
    1212    $this->FilesDir = '';
    1313  }
     
    118118    parent::Start();
    119119    $this->System->RegisterPage('file', 'PageFile');
    120     $File = new File($this->System->Database);
    121     $File->FilesDir = dirname(__FILE__).'/../../'.$Config['Web']['UploadFileFolder'];   
    122     $this->System->AddModule($File);
     120    $this->System->AddModule(new File($this->System));
     121    $this->System->Modules['File']->FilesDir = dirname(__FILE__).'/../../'.$Config['Web']['UploadFileFolder'];
    123122  } 
    124123 
  • trunk/Modules/Finance/Customers.php

    r521 r524  
    1111    $Finance = $this->System->Modules['Finance'];
    1212    $this->System->Modules['Finance']->LoadTariffs();
    13     if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
     13    if(!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
    1414
    1515    $Output = 'Seznam účastníků:<br/>';
  • trunk/Modules/Finance/Finance.php

    r521 r524  
    3737  function Start()
    3838  {
     39    global $Config;
     40   
    3941    parent::Start();
    4042    $this->System->RegisterPage('finance', 'PageFinance');
     
    4850    $this->System->RegisterPage(array('finance', 'import'), 'PageFinanceImportPayment');   
    4951    $this->System->RegisterPage(array('finance', 'zivnost'), 'PageFinanceTaxFiling');   
     52
     53    $this->System->AddModule(new Bill($this->System));
     54    $this->System->AddModule(new Finance($this->System));
     55    $this->System->Modules['Finance']->MainSubject = $Config['Finance']['MainSubjectId'];
     56    $this->System->Modules['Finance']->DirectoryId = $Config['Finance']['DirectoryId'];
     57    $this->System->Modules['Finance']->LoadMonthParameters(0); 
    5058  } 
    5159 
  • trunk/Modules/Finance/Import.php

    r523 r524  
    99  function Show()
    1010  {
    11     if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
     11    if(!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
    1212    if(array_key_exists('Operation', $_GET))
    1313    {
  • trunk/Modules/Finance/Manage.php

    r521 r524  
    99  function Show()
    1010  {
    11     if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage'))
     11    if(!$this->System->User->CheckPermission('Finance', 'Manage'))
    1212      return('Nemáte oprávnění');
    1313
     
    203203    $Form->SaveValuesToDatabase(0);
    204204    $Output = $this->SystemMessage('Finance', 'Zařízení vloženo.');
    205     $this->System->Modules['Log']->NewRecord('Finance', 'NewDeviceInserted');
     205    $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewDeviceInserted');
    206206    return($Output);
    207207  }
     
    223223    $Form->SaveValuesToDatabase(0);
    224224    $Output = $this->SystemMessage('Finance', 'Záznam historie zařízení vložen.');
    225     $this->System->Modules['Log']->NewRecord('Finance', 'NewDeviceHistoryInserted');
     225    $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewDeviceHistoryInserted');
    226226    return($Output);
    227227  }
     
    246246    $DbRow = $DbResult->fetch_assoc();
    247247    $Output = $this->SystemMessage('Finance', 'Platba vložena '.$DbRow['BillCode'].'.');
    248     $this->System->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted');
     248    $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted');
    249249    return($Output);
    250250  }
     
    272272    $DbRow = $DbResult->fetch_assoc();
    273273    $Output = $this->SystemMessage('Finance', 'Faktura vložena '.$DbRow['BillCode'].'.');
    274     $this->System->Modules['Log']->NewRecord('Finance', 'NewInvoiceInserted');
     274    $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewInvoiceInserted');
    275275    return($Output);
    276276  }
     
    308308  function ShowMonthlyPayment()
    309309  {
    310     if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
     310    if(!$this->System->User->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
    311311    $SQL = 'SELECT Member.*, MemberPayment.MonthlyTotal AS Monthly, '.
    312312      'MemberPayment.Cash AS Cash, '.
     
    450450  function ProcessMonthlyPayment()
    451451  {
    452     if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
     452    if(!$this->System->User->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
    453453    $Output = '';
    454454
  • trunk/Modules/Finance/Overview.php

    r521 r524  
    1515    $Output .= '<a href="'.$this->System->Link('/finance/sluzby/').'">Přehled nabízených služeb</a><br />';
    1616    $Output .= '<a href="'.$this->System->Link('/finance/zarizeni/').'">Výpis zařízení</a><br />';
    17     if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList'))
     17    if($this->System->User->CheckPermission('Finance', 'SubjectList'))
    1818      $Output .= '<a href="'.$this->System->Link('/finance/zakaznici/').'">Seznam zákazníků</a><br />';
    1919    $Output .= '<a href="'.$this->System->Link('/finance/spotreba/').'">Spotřeba energie</a><br />';
  • trunk/Modules/Finance/UserState.php

    r521 r524  
    1414    if(array_key_exists('Subject', $_GET))
    1515    {
    16       if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
     16      if(!$this->System->User->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
    1717      $DbResult = $this->Database->query('SELECT * FROM Subject WHERE Id='.$_GET['Subject']);
    1818      $Subject = $DbResult->fetch_assoc();
    1919    } else
    2020    {
    21       if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění');
    22       $UserId = $this->System->Modules['User']->User['Id'];
     21      if(!$this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění');
     22      $UserId = $this->System->User->User['Id'];
    2323      $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$UserId.' LIMIT 1');
    2424      if($DbResult->num_rows > 0)
  • trunk/Modules/Finance/Zivnost.php

    r521 r524  
    5555  function Show()
    5656  {
    57     if(!$this->System->Modules['User']->CheckPermission('Finance', 'TradingStatus')) return('Nemáte oprávnění');
     57    if(!$this->System->User->CheckPermission('Finance', 'TradingStatus')) return('Nemáte oprávnění');
    5858    $this->System->Modules['Finance']->LoadTariffs(1);
    5959    //TransformFinance();
  • trunk/Modules/FinanceBankAPI/FileImport.php

    r523 r524  
    2929  function Show()
    3030  {   
    31     if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
     31    if(!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
    3232     
    3333    $DbResult = $this->Database->select('FinanceBankAccount', '*', 'Id='.$_GET['id']);
     
    5656  {
    5757    $Output = '';
    58     if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
     58    if(!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
    5959    if(array_key_exists('Operation', $_GET))
    6060    {
  • trunk/Modules/IS/IS.php

    r519 r524  
    1212  function Show()
    1313  {
    14     if(!$this->System->Modules['User']->CheckPermission('IS', 'Manage'))
     14    if(!$this->System->User->CheckPermission('IS', 'Manage'))
    1515      return('Nemáte oprávnění');
    1616
     
    107107        $_SESSION['Id'] = $Id;
    108108        //$this->Database->update($Table, 'Id='.$Id,
    109         //  array('UserCreate' => $this->System->Modules['User']->User['Id'],
     109        //  array('UserCreate' => $this->System->User->User['Id'],
    110110        //  'TimeCreate' => 'NOW()'));
    111111        $Output .= $this->ShowView($Table, $Id);   
  • trunk/Modules/Log/Log.php

    r523 r524  
    3737  {
    3838    if(array_key_exists('User', $this->System->Modules) and
    39       array_key_exists('Id', $this->System->Modules['User']->User))
    40       $UserId = $this->System->Modules['User']->User['Id'];
     39      array_key_exists('Id', $this->System->User->User))
     40      $UserId = $this->System->User->User['Id'];
    4141      else $UserId = NULL;
    4242    $this->Database->insert('Log', array('Time' => 'NOW()',
  • trunk/Modules/Network/Administration.php

    r519 r524  
    1313  function Show()
    1414  {
    15     if(!$this->System->Modules['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění');
     15    if(!$this->System->User->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění');
    1616    $Output = '';
    1717    if(array_key_exists('Action', $_GET))
  • trunk/Modules/Network/UserHosts.php

    r519 r524  
    1717    $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
    1818    $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>';
    19     $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 = (SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->Modules['User']->User['Id'].') ORDER BY NetworkDevice.Name');
     19    $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 = (SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->User->User['Id'].') ORDER BY NetworkDevice.Name');
    2020    while($Device = $DbResult->fetch_assoc())
    2121    {
  • trunk/Modules/NetworkShare/SharePage.php

    r523 r524  
    6868  function Show()
    6969  {
    70     if(!$this->System->Modules['User']->CheckPermission('Share', 'Display')) return('Nemáte oprávnění');
     70    if(!$this->System->User->CheckPermission('Share', 'Display')) return('Nemáte oprávnění');
    7171
    7272    // If not only online checkbox checked
  • trunk/Modules/News/News.php

    r506 r524  
    5151    $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];     
    5252    $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>';
    53     if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $Category))
     53    if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category))
    5454      $Output .= ' <a href="aktuality/?action=add&amp;category='.$Category.'">Přidat</a>';
    5555    $Output .= '</div></div><div class="Content">';
  • trunk/Modules/News/NewsPage.php

    r523 r524  
    3838    {
    3939      case 'view':
    40         if(!$this->System->Modules['User']->CheckPermission('News', 'Display', 'Item')) $Output .= 'Nemáte oprávnění';
     40        if(!$this->System->User->CheckPermission('News', 'Display', 'Item')) $Output .= 'Nemáte oprávnění';
    4141        else
    4242        {
     
    4949              else $Author = $Row['Name'];
    5050            $Output .= '<div class="Panel"><div class="Title">'.$Row['Title'].' ('.HumanDate($Row['Date']).', '.$Author.')';
    51             if($this->System->Modules['User']->User['Id'] == $Row['User'])
     51            if($this->System->User->User['Id'] == $Row['User'])
    5252            {
    5353              $Output .= '<div class="Action">';
     
    7979        while($DbRow = $DbResult->fetch_array())
    8080        {
    81           if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $DbRow['Id']))
     81          if($this->System->User->CheckPermission('News', 'Insert', 'Group', $DbRow['Id']))
    8282          {
    8383            if($DbRow['Id'] == $Category) $Selected = ' selected="1"'; else $Selected = '';
     
    9898      case 'add2':
    9999        $RemoteAddr = GetRemoteAddress(); 
    100         if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $Category))
     100        if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category))
    101101        {
    102102          // Process uploaded file
     
    121121          $this->Database->insert('News', array('Category' => $Category, 'Title' => $_POST['title'],
    122122            'Content' => $_POST['content'], 'Date' => 'NOW()', 'IP' => $RemoteAddr,
    123             'Enclosure' => $Enclosures, 'Author' => $this->System->Modules['User']->User['Name'], 'User' => $this->System->Modules['User']->User['Id'], 'Link' => $_POST['link']));
     123            'Enclosure' => $Enclosures, 'Author' => $this->System->User->User['Name'], 'User' => $this->System->User->User['Id'], 'Link' => $_POST['link']));
    124124          $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 />';
    125125          $Output .= '<a href="?category='.$_POST['category'].'">Zpět na seznam aktualit</a>';
     
    130130        $DbResult = $this->Database->query('SELECT * FROM News WHERE Id='.$_GET['id']);
    131131        $Row = $DbResult->fetch_array();
    132         if($this->System->Modules['User']->User['Id'] == $Row['User'])
     132        if($this->System->User->User['Id'] == $Row['User'])
    133133        {
    134134          $Row['Content'] = str_replace('<br />', '', $Row['Content']);
     
    151151        {
    152152          $Row = $DbResult->fetch_array();
    153           if($this->System->Modules['User']->User['Id'] == $Row['User'])
     153          if($this->System->User->User['Id'] == $Row['User'])
    154154          {
    155155            $_POST['content'] = str_replace("\n", '<br />', $_POST['content']);
  • trunk/Modules/OpeningHours/OpeningHours.php

    r507 r524  
    3535  function EditSubject($Id)
    3636  {
    37     if($this->System->Modules['User']->CheckPermission('SubjectOpenTime', 'Edit'))
     37    if($this->System->User->CheckPermission('SubjectOpenTime', 'Edit'))
    3838    {
    3939      $Output = '<div class="Centred">';
     
    7777   
    7878    $Output = '';
    79     if($this->System->Modules['User']->CheckPermission('SubjectOpenTime', 'Edit'))
     79    if($this->System->User->CheckPermission('SubjectOpenTime', 'Edit'))
    8080    {
    8181      $this->Database->delete('SubjectOpenTimeDay', 'Subject='.$Id);
     
    189189      if($Subject['Photo'] != 0) $Output .= '<a href="file?id='.$Subject['Photo'].'">Fotka</a> ';
    190190     
    191       if($this->System->Modules['User']->CheckPermission('SubjectOpenTime', 'Edit'))
     191      if($this->System->User->CheckPermission('SubjectOpenTime', 'Edit'))
    192192        $Output .= '<a href="edit?Subject='.$Subject['Id'].'">Editovat</a><br />';
    193193      $Output .= '<br />';
  • 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());
  • trunk/Modules/TV/tkr.php

    r438 r524  
    2323}
    2424
    25 $System->AddModule(new CableTVChennelListPage());
     25$System->AddModule(new CableTVChennelListPage($System));
    2626$System->Modules['CableTVChennelListPage']->GetOutput();
    2727
  • trunk/Modules/User/User.php

    r521 r524  
    11<?php
     2
     3include_once(dirname(__FILE__).'/UserList.php');
    24
    35define('LOGIN_USED', 'Přihlašovací jméno již použito.');
     
    4749class User extends Module
    4850{
    49   var $Dependencies = array('Log');
    5051  var $Roles = array();
    5152  var $User = array();
    52   var $DefaultRole = 2;
    5353  var $OnlineStateTimeout = 600; // in seconds
    5454  var $PermissionCache = array();
     
    5858  var $PasswordHash;
    5959 
    60   function __construct()
    61   {
     60  function __construct($System)
     61  {
     62    parent::__construct($System);
    6263    $this->PasswordHash = new PasswordHash();
    6364  }
     
    9798    {
    9899      $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
    99       if($DbRow['User'] != null) $this->System->Modules['Log']->NewRecord('User', 'Logout');
     100      if($DbRow['User'] != null) $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout');
    100101    }
    101102    //$this->LoadPermission($this->User['Role']);
     
    107108  function Register($Login, $Password, $Password2, $Email, $Name, $PhoneNumber, $ICQ)
    108109  {
    109     global $Options, $Config;
     110    global $Config;
    110111
    111112    if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '')  || ($Name == '')) $Result = DATA_MISSING;
     
    155156           
    156157            $Result = USER_REGISTRATED;
    157             $this->System->Modules['Log']->NewRecord('User', 'NewRegistration', $Login);
     158            $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'NewRegistration', $Login);
    158159          }
    159160        }
     
    174175        $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0));
    175176        $Output = USER_REGISTRATION_CONFIRMED;
    176         $this->System->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='.
     177        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='.
    177178          $Row['Login'].', Id='.$Row['Id']);
    178179      } else $Output = PASSWORDS_UNMATCHED;
     
    198199        $Result = USER_LOGGED_IN;
    199200        $this->Check();
    200         $this->System->Modules['Log']->NewRecord('User', 'Login', 'Login='.$Login.',Host='.gethostbyaddr(GetRemoteAddress()));
     201        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Login', 'Login='.$Login.',Host='.gethostbyaddr(GetRemoteAddress()));
    201202      }
    202203    } else $Result = USER_NOT_REGISTRED;
     
    208209    $SID = session_id();
    209210    $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => null));
    210     $this->System->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']);
     211    $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']);
    211212    $this->Check();
    212213    return(USER_LOGGED_OUT);
     
    354355     
    355356      $Output = USER_PASSWORD_RECOVERY_SUCCESS;
    356       $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
     357      $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
    357358    } else $Output = USER_PASSWORD_RECOVERY_FAIL;
    358359    return($Output);
     
    373374          'Salt' => $Salt, 'Locked' => 0));
    374375        $Output = USER_PASSWORD_RECOVERY_CONFIRMED;
    375         $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);
     376        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);
    376377      } else $Output = PASSWORDS_UNMATCHED;
    377378    } else $Output = USER_NOT_FOUND;
     
    380381}
    381382
     383class ModuleUser extends AppModule
     384{
     385  function __construct($System)
     386  {
     387    parent::__construct($System);
     388    $this->Name = 'User';
     389    $this->Version = '1.0';
     390    $this->Creator = 'Chronos';
     391    $this->License = 'GNU/GPLv3';
     392    $this->Description = 'User management';
     393    $this->Dependencies = array();
     394  } 
     395
     396  function Install()
     397  {
     398  }
     399 
     400  function Uninstall()
     401  {     
     402  }
     403 
     404  function Start()
     405  {
     406    parent::Start();
     407    $this->System->User = new User($this->System);
     408    if(isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check();
     409    $this->System->RegisterPage('userlist', 'PageUserList');
     410  } 
     411 
     412  function Stop()
     413  {
     414  }
     415}
     416
    382417?>
  • trunk/Modules/WebCam/WebCam.php

    r523 r524  
    6868    global $Config;
    6969    $Output = '';
    70     //$Output = '<a href="http://www.zdechov.net/kamery/?id=1"><img alt="Webkamera školní hřiště" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam.jpg" /></a>';
    71     //$Output .= '<a href="http://www.zdechov.net/kamery/?id=2"><img alt="Webkamera střed obce obloha" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam2.jpg" /></a>';
    72     //$Output .= '<a href="http://www.zdechov.net/kamery/?id=3"><img alt="Skiareál, motokrosová grapa" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam3.jpg" /></a>';
    73     //$Output .= '<a href="http://www.zdechov.net/kamery/?id=4"><img alt="Fotbalové hřiště" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam4.jpg" /></a>';
     70    $Output = '<a href="http://www.zdechov.net/kamery/?id=1"><img alt="Webkamera školní hřiště" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam.jpg" /></a>';
     71    $Output .= '<a href="http://www.zdechov.net/kamery/?id=2"><img alt="Webkamera střed obce obloha" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam2.jpg" /></a>';
     72    $Output .= '<a href="http://www.zdechov.net/kamery/?id=3"><img alt="Skiareál, motokrosová grapa" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam3.jpg" /></a>';
     73    $Output .= '<a href="http://www.zdechov.net/kamery/?id=4"><img alt="Fotbalové hřiště" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam4.jpg" /></a>';
    7474          return($Output);   
    7575  } 
Note: See TracChangeset for help on using the changeset viewer.