'Přihlášení', 'SubmitButtonText' => 'Přihlásit', 'Items' => array( array('Name' => 'UserName', 'Type' => TypeStringId, 'Caption' => 'Jméno', 'Value' => ''), array('Name' => 'Password', 'Type' => TypePasswordId, 'Caption' => 'Heslo', 'Value' => ''), ), ); $FormUserRegister = array ( 'Title' => 'Registrace uživatele', 'Table' => 'User', 'SubmitButtonText' => 'Registrovat', 'Items' => array( array('Name' => 'UserName', 'Type' => TypeStringId, 'Caption' => 'Přihlašovací jméno', 'Value' => ''), array('Name' => 'Password', 'Type' => TypePasswordId, 'Caption' => 'Heslo', 'Value' => ''), array('Name' => 'Password2', 'Type' => TypePasswordId, 'Caption' => 'Potvrzení hesla', 'Value' => ''), array('Name' => 'Email', 'Type' => TypeStringId, 'Caption' => 'E-mail', 'Value' => ''), array('Name' => 'FirstName', 'Type' => TypeStringId, 'Caption' => 'Křestní jméno', 'Value' => ''), array('Name' => 'SecondName', 'Type' => TypeStringId, 'Caption' => 'Příjmení', 'Value' => ''), ), ); $Output = '
';
if(array_key_exists('Action', $_GET))
{
if($_GET['Action'] == 'Login')
{
$Form = new Form();
$Form->Definition = $FormUserLogin;
$Form->LoadValuesFromForm();
$Output .= $this->SystemMessage('Přihlášení', $this->System->Modules['User']->Login($Form->Values['UserName'], $Form->Values['Password']));
} else
if($_GET['Action'] == 'Logout')
{
$Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout());
} else
if($_GET['Action'] == 'LoginForm')
{
$Form = new Form();
$Form->Definition = $FormUserLogin;
$Form->OnSubmit = '?Action=Login';
$Output .= $Form->ShowEditForm();
} else
if($_GET['Action'] == 'UserRegister')
{
$Form = new Form();
$Form->Definition = $FormUserRegister;
$Form->OnSubmit = '?Action=UserRegisterSave';
$Output .= $Form->ShowEditForm();
} else
if($_GET['Action'] == 'UserRegisterConfirm')
{
$Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));
} else
if($_GET['Action'] == 'UserRegisterSave')
{
$Form = new Form();
$Form->Definition = $FormUserRegister;
$Form->LoadValuesFromForm();
$Output .= $this->SystemMessage('Registrace', $this->System->Modules['User']->Register($Form->Values['Name'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['FirstName'], $Form->Values['SecondName']));
}
}
if($this->System->Modules['User']->User['Id'] == 0)
{
//if(!array_key_exists('Action', $_GET))
{
$Output .= 'Přihlášení Registrace'; $Form = new Form(); $Form->Definition = $FormUserLogin; $Form->OnSubmit = '?Action=Login'; $Output .= $Form->ShowEditForm(); } } else { $Output .= $this->System->Modules['User']->User['UserName'].' Odhlásit'; $Output .= ' '; $Output .= ShowMenu(); $Output .= ' | '; $Output .= Output(); $Output .= ' |