'Základní nastavení',
'Table' => 'User',
'SubmitText' => 'Uložit',
'Items' => array(
'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''),
'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
//'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
//'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''),
),
);
var $RegisterFormClass = array(
'Title' => 'Registrace uživatele',
'SubmitText' => 'Registrovat',
'Table' => 'User',
'Items' => array(
'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''),
'Password2' => array('Type' => 'Password', 'Caption' => 'Potvrzení hesla', 'Default' => ''),
'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
//'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
//'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''),
),
);
var $PasswordRecoveryFormClass = array(
'Title' => 'Obnova hesla',
'SubmitText' => 'Obnovit',
'Table' => '',
'Items' => array(
'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
),
);
var $LoginFormClass = array(
'Title' => 'Přihlášení uživatele',
'SubmitText' => 'Přihlásit',
'Table' => '',
'Items' => array(
'Username' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''),
),
);
function Login()
{
global $Config;
$Form = new Form($this->System, $this->LoginFormClass);
$Form->OnSubmit = '?Module=User&Action=LoginFinish';
$Output = $Form->ShowEditForm();
$Output .= '
';
return($Output);
}
function LoginFinish()
{
$Form = new Form($this->System, $this->LoginFormClass);
$Form->OnSubmit = '?Module=User&Action=LoginFinish';
$Form->LoadValuesFromForm();
$Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']);
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Přihlášení', $Result);
if($Result <> $this->System->Translate('UserLoggedIn'))
{
$Form->Values['Password'] = '';
$Output .= $Form->ShowEditForm();
$Output .= '';
}
return($Output);
}
function RegisterSave()
{
global $Config;
if($Config['System']['UserRegistrationEnabled'])
{
$Form = new Form($this->System, $this->RegisterFormClass, array());
$Form->LoadValuesFromForm();
$Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Registrace nového účtu', $Result);
if($Result <> $this->System->Translate('UserRegistrated'))
{
$Form->OnSubmit = '?Module=User&Action=UserRegisterSave';
$Output = $Form->ShowEditForm();
}
} else $Output = 'Registrace nových účtů nejsou povoleny.';
return($Output);
}
function PasswordRecoveryConfirm()
{
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
$Output .= $this->LoginForm();
return($Output);
}
function PasswordRecoveryFinish()
{
$Form = new Form($this->System, $this->PasswordRecoveryFormClass);
$Form->LoadValuesFromForm();
$Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Obnova hesla', $Result);
if($Result <> $this->System->Translate('UserPasswordRecoverySuccess'))
{
$Output .= $Form->ShowEditForm();
}
return($Output);
}
function PasswordRecovery()
{
$Form = new Form($this->System, $this->PasswordRecoveryFormClass);
$Form->OnSubmit = '?Module=User&Action=PasswordRecovery2';
$Output = $Form->ShowEditForm();
return($Output);
}
function Logout()
{
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout());
$Output .= $this->Login();
return($Output);
}
function Options()
{
$UserOptions = new Form($this->System, $this->OptionsFormClass);
$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
$UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave';
$Output = $UserOptions->ShowEditForm();
return($Output);
}
function OptionsSave()
{
$UserOptions = new Form($this->System, $this->OptionsFormClass, array());
$UserOptions->LoadValuesFromForm();
$UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']);
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Nastavení', 'Nastavení uloženo.');
$this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
$UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave';
$Output .= $UserOptions->ShowEditForm();
return($Output);
}
function Register()
{
global $Config;
if($Config['System']['UserRegistrationEnabled'])
{
$Form = new Form($this->System, $this->RegisterFormClass);
$Form->LoadValuesFromForm();
$Form->OnSubmit = '?Module=User&Action=UserRegisterSave';
$Output = 'Vyplňte správně požadované údaje. Na zadaný email vám bude zaslán aktivační email.';
$Output .= $Form->ShowEditForm();
} else $Output = 'Registrace nových účtů nejsou povoleny.';
return($Output);
}
function RegisterConfirm()
{
global $Config;
if($Config['System']['UserRegistrationEnabled'])
{
$Page = new PageView($this->System);
$Output = $Page->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));
$Output .= $this->ShowLoginForm();
} else $Output = 'Registrace nových účtů nejsou povoleny.';
return($Output);
}
}