Ejemplo n.º 1
0
 * SkeliCZ - Login page
 *
 * @package    SkeliCZ
 * @author     Vitex <*****@*****.**>
 * @copyright  2009-2016 info@vitexsoftware.cz (G)
 */
namespace SkeliCZ;

require_once 'includes/SkeliInit.php';
$oPage->onlyForLogged();
if ($oPage->getRequestValue('user') == 'normal') {
    $oUser->setSettingValue('admin', FALSE);
    $oUser->addStatusMessage(_('Admin privileges was suppressed'));
}
switch ($oPage->getRequestValue('action')) {
    default:
        break;
}
$oPage->addItem(new PageTop(_('User Profile') . ' ' . $oUser->GetUserLogin()));
$settingsFrame = new \Ease\TWB\Panel(_('Settings'));
$settingsFrame->addItem(new \Ease\Html\ATag('https://secure.gravatar.com/', new \Ease\Html\ImgTag($oUser->getIcon()), ['title' => 'Click to change avatar']));
//$settingsFrame->addItem(new IETextInputSaver('login', $oUser->getUserLogin(), _('přihlašovací jméno')));
$settingsFrame->addItem(new \Ease\TWB\LinkButton('changepassword.php', _('změna hesla')));
//$settingsFrame->addItem(new IETextInputSaver('email', $oUser->getUserEmail(), _('emailová adresa'), array('id' => 'UserMail')));
$settingsFrame->addItem('<br>');
$oPage->column2->addItem($settingsFrame);
if ((bool) $oUser->getSettingValue('admin')) {
    $oPage->column3->addItem(new \Ease\TWB\LinkButton('?user=normal', _('Suppress admin privileges'), 'danger'));
}
$oPage->addItem(new PageBottom());
$oPage->draw();
Ejemplo n.º 2
0
$login = $oPage->getRequestValue('login');
if ($login) {
    $oUser = \Ease\Shared::user(new User());
    //    \Ease\Shared::user()->SettingsColumn = 'settings';
    if ($oUser->tryToLogin($_POST)) {
        $oPage->redirect('index.php');
        exit;
    }
} else {
    $oPage->addStatusMessage(_('Please enter your login and password'));
}
$oPage->addItem(new PageTop(_('Sign in')));
$loginFace = new \Ease\Html\Div(null, ['id' => 'LoginFace']);
$oPage->container->addItem($loginFace);
$loginRow = new \Ease\TWB\Row();
$infoColumn = $loginRow->addItem(new \Ease\TWB\Col(4));
$infoBlock = $infoColumn->addItem(new \Ease\TWB\Well(new \Ease\Html\ImgTag('images/password.png')));
$infoBlock->addItem(_('Welcome to Skeli.cz'));
$loginColumn = $loginRow->addItem(new \Ease\TWB\Col(4));
$submit = new \Ease\TWB\SubmitButton(_('Sign in'), 'success');
$loginPanel = new \Ease\TWB\Panel(new \Ease\Html\ImgTag('images/skelilogo.png'), 'success', null, $submit);
$loginPanel->addItem(new \Ease\TWB\FormGroup(_('Username'), new \Ease\Html\InputTextTag('login', $login)));
$loginPanel->addItem(new \Ease\TWB\FormGroup(_('Login'), new \Ease\Html\InputPasswordTag('password')));
$loginColumn->addItem($loginPanel);
$passRecoveryColumn = $loginRow->addItem(new \Ease\TWB\Col(4, new \Ease\TWB\LinkButton('passwordrecovery.php', '<i class="fa fa-key"></i>
' . _('Password recovery'), 'warning')));
$passRecoveryColumn->additem(new \Ease\TWB\LinkButton('createaccount.php', '<i class="fa fa-user"></i>
' . _('Create account'), 'success'));
$oPage->container->addItem(new \Ease\TWB\Form('Login', null, 'POST', $loginRow));
$oPage->addItem(new PageBottom());
$oPage->draw();