Exemplo n.º 1
0
 * For copyright and license information, please see the LICENSE.md
 * Installing the system or redistributions of files must retain the above copyright notice.
 *
 * @link        http://mobicms.net mobiCMS Project
 * @copyright   Copyright (C) mobiCMS Community
 * @license     LICENSE.md (see attached file)
 */
defined('MOBICMS') or die('Error: restricted access');
use Config\System as Config;
$app = App::getInstance();
$user = $app->user()->get();
$form = new Mobicms\Form\Form(['action' => $app->request()->getUri()]);
if ($user->rights >= 7 || $user->nickChanged < time() - Config::$usrChangeNicknamePeriod * 86400) {
    $form->title(_m('Change Nickname'))->element('text', 'nickname', ['label' => _m('New Nickname'), 'maxlength' => 20, 'required' => true])->element('text', 'repeat', ['label' => _m('Repeat Nickname'), 'maxlength' => 20, 'description' => _s('Min. 2, Max. 20 Characters.<br>Allowed letters are Cyrillic and Latin alphabet, numbers, spaces and punctuation - = @ ! ? ~ . _ ( ) [ ] *') . '<br/>' . _m('Please note that while changing the nickname is changing your Login on the site.<br>The next change of nickname is allowed through') . ' ' . Config::$usrChangeNicknamePeriod . ' ' . _sp('Day', 'Days', Config::$usrChangeNicknamePeriod) . '.', 'required' => true])->element('password', 'password', ['label' => _m('Your Password'), 'required' => true])->divider()->element('submit', 'submit', ['value' => _s('Save'), 'class' => 'btn btn-primary'])->html('<a class="btn btn-link" href="../">' . _s('Back') . '</a>')->validate('nickname', 'lenght', ['min' => 2, 'max' => 20])->validate('repeat', 'compare', ['compare_field' => 'nickname']);
} else {
    $form->html('<div class="alert alert-danger">' . '<strong>' . _m('Nickname can not change more than once a') . ' ' . Config::$usrChangeNicknamePeriod . ' ' . _sp('Day', 'Days', Config::$usrChangeNicknamePeriod) . '</strong><br/><br/>' . _m('You have already changed their nickname:') . ' ' . Includes\Functions::displayDate($user->nickChanged) . '<br/>' . _m('Next time will be able to change:') . ' ' . Includes\Functions::displayDate($user->nickChanged + Config::$usrChangeNicknamePeriod * 86400) . '</div>')->html('<a class="btn btn-primary" href="../">' . _s('Back') . '</a>');
}
if ($form->process() === true) {
    $valid = $app->user()->validate();
    // Проверяем Ник
    if (!$valid->checkNicknameChars($form->output['nickname'])) {
        // Обнаружены запрещенные символы
        $form->setError('nickname', _s('Invalid characters'));
    } elseif (!$valid->checkNicknameCharsets($form->output['nickname'])) {
        // Обнаружены символы из разных языков
        $form->setError('nickname', _s('It is forbidden to use characters of different languages'));
    } elseif (ctype_digit($form->output['nickname']) && !Config::$usrNicknameDigitsOnly) {
        // Ник состоит только из цифр
        $form->setError('nickname', _s('Nicknames consisting only of numbers are prohibited'));
    } elseif (!$valid->checkNicknameRepeatedChars($form->output['nickname'])) {
        // Обнаружены повторяющиеся символыь (более 3-х подряд)
Exemplo n.º 2
0
                </div>
                <?php 
if (!empty($profile['status'])) {
    ?>
                    <div class="small bold colored"><?php 
    echo $profile['status'];
    ?>
</div>
                <?php 
}
?>
                <?php 
if ($profile['lastVisit'] < time() - 300) {
    ?>
                    <div><?php 
    echo _s('Last visit') . ': ' . Includes\Functions::displayDate($profile['lastVisit']);
    ?>
</div>
                <?php 
}
?>
                <?php 
if ($rights) {
    ?>
                    <div class="small inline margin"><?php 
    echo $profile['userAgent'];
    ?>
</div>
                    <div class="small">
                        <?php 
    if ($proxy) {
Exemplo n.º 3
0
    <?php 
if (isset($this->list)) {
    ?>
        <ul class="striped">
            <?php 
    foreach ($this->list as $val) {
        ?>
                <li class="static">
                    <h2><?php 
        echo $val['title'];
        ?>
</h2>

                    <div class="news-info">
                        <?php 
        echo Includes\Functions::displayDate($val['time']);
        ?>
<br/>
                        <?php 
        echo _m('Added');
        ?>
: <a href="<?php 
        echo $app->request()->getBaseUrl();
        ?>
/profile/<?php 
        echo $val['author_id'];
        ?>
/"><?php 
        echo $val['author'];
        ?>
</a>