Changeset 549 for trunk/Modules


Ignore:
Timestamp:
Jun 18, 2013, 8:30:40 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Do hlavní nabídky lze přidávat položky na určitou pozici.
Location:
trunk/Modules
Files:
4 edited

Legend:

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

    r548 r549  
    1818        $this->System->RegisterPage('dictionary.php', 'PageDictionary');
    1919        $this->System->RegisterMenuItem(array(
     20                'Name' => 'Dictionary',
    2021        'Title' => 'Slovníček',
    2122        'Hint' => 'Slovník WoW výrazů',
     
    2324        'Permission' => LICENCE_ANONYMOUS,
    2425        'Icon' => '',
    25     ));
     26    ), 1);
    2627  }
    2728}
  • trunk/Modules/FrontPage/FrontPage.php

    r548 r549  
    2323      'Permission' => LICENCE_ANONYMOUS,
    2424      'Icon' => '',
    25     ));
     25    ), 0);
    2626  }
     27 
     28  function HandleLoginForm()
     29  {
     30        global $User, $Message, $MessageType;
     31 
     32        if(array_key_exists('action', $_GET))
     33        {
     34                if($_GET['action'] == 'login')
     35                {
     36                        if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))
     37                        {
     38                                $User->Login($_POST['LoginUser'], $_POST['LoginPass']);
     39                                if($User->Role == LICENCE_ANONYMOUS)
     40                                {
     41                                        $Message = 'Jméno nebo heslo bylo zadáno špatně.';
     42                                        $MessageType = MESSAGE_CRITICAL;
     43                                } else
     44                                {
     45                                        $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$User->Name.'</strong>!';
     46                                        $MessageType = MESSAGE_INFORMATION;
     47                                }
     48                        } else
     49                        {
     50                                $Message = 'Nebylo zadáno jméno a heslo.';
     51                                $MessageType = MESSAGE_CRITICAL;
     52                        }
     53                } else
     54                        if($_GET['action'] == 'logout')
     55                        {
     56                                if($User->Role != LICENCE_ANONYMOUS)
     57                                {
     58                                        WriteLog('Odhlášení', LOG_TYPE_USER);
     59                                        $User->Logout();
     60                                        $Message = 'Byl jsi odhlášen.';
     61                                        $MessageType = MESSAGE_INFORMATION;
     62                                }
     63                        }
     64        }
     65  }
     66 
    2767}
    2868
     
    3171  function Show()
    3272  {
    33         $Output = '<br />'.
     73        global $Message, $MessageType;
     74       
     75        $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm();
     76        $Output = '';
     77        if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
     78         
     79        $Output .= '<br />'.
    3480                        '<table class="Home"><tr><td colspan="3">'.$this->ShowWelcome().
    3581                        '</td></tr>'.
     
    3985                        '</tr></table>';
    4086         return($Output);
    41   }
     87  } 
    4288
    4389  function ShowShoutbox()
  • trunk/Modules/Team/Team.php

    r548 r549  
    2323      'Permission' => LICENCE_ANONYMOUS,
    2424      'Icon' => '',
    25     ));
     25    ), 1);
    2626  }
    2727}
  • trunk/Modules/User/User.php

    r548 r549  
    3232        'Permission' => LICENCE_ANONYMOUS,
    3333        'Icon' => '',
    34     ));
     34    ), 0);
    3535        }
    3636}
Note: See TracChangeset for help on using the changeset viewer.