if (Yii::$app->session->hasFlash('error')) {
    ?>
    <div class="alert-alert-warning text-center">
        <?php 
    echo Yii::$app->session->getFlash('error');
    ?>
    </div>
<?php 
}
?>

<?php 
$form = ActiveForm::begin(['id' => 'user', 'validateOnBlur' => false, 'fieldConfig' => ['template' => "{input}\n{error}"], 'options' => ['class' => 'auth-form']]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('email'), 'autofocus' => true]);
?>

    <?php 
echo $form->field($model, 'captcha', ['options' => ['class' => 'form-group captcha']])->widget(Captcha::className(), ['captchaAction' => ['/users/auth/captcha'], 'options' => ['class' => 'form-control', 'placeholder' => 'Код с картинки']]);
?>
    
    <div class="form-group button-container">
        <?php 
echo Html::submitButton(UsersModule::t('front', 'Recover'));
?>
    </div>

<?php 
ActiveForm::end();
Beispiel #2
0
                </div>
                <div class="col-sm-4 text-right" style="padding: 20px">
                    ' . GridBulkActions::widget(['gridId' => 'user-grid']) . '
                </div>
            </div>
        ', 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:10px']], ['class' => 'roman444uk\\yii\\grid\\StatusColumn', 'attribute' => 'superadmin', 'visible' => Yii::$app->user->isSuperadmin, 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'username', 'value' => function (User $model) {
    return Html::a($model->username, ['view', 'id' => $model->id], ['data-pjax' => 0]);
}, 'format' => 'raw', 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'email', 'format' => 'raw', 'visible' => User::hasPermission('viewUserEmail'), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'roman444uk\\yii\\grid\\StatusColumn', 'attribute' => 'email_confirmed', 'visible' => User::hasPermission('viewUserEmail'), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'gridRoleSearch', 'filter' => ArrayHelper::map(Role::getAvailableRoles(Yii::$app->user->isSuperAdmin), 'name', 'description'), 'value' => function (User $model) {
    return implode(', ', ArrayHelper::map($model->roles, 'name', 'description'));
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUserRoles'), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'registration_ip', 'value' => function (User $model) {
    return Html::a($model->registration_ip, "http://ipinfo.io/" . $model->registration_ip, ["target" => "_blank"]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewRegistrationIp'), 'filterInputOptions' => ['class' => 'form-control input-sm']], ['value' => function (User $model) {
    return GhostHtml::a(UsersModule::t('back', 'Roles and permissions'), ['/user/user-permission/set', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary', 'data-pjax' => 0, 'data-set-roles' => $model->id]);
}, 'format' => 'raw', 'visible' => User::canRoute('/user/permission/set'), 'options' => ['width' => '10px']], ['value' => function (User $model) {
    return GhostHtml::a(UsersModule::t('back', 'Change password'), ['change-password', 'id' => $model->id], ['class' => 'btn btn-sm btn-default', 'data-pjax' => 0, 'data-change-password' => $model->id]);
}, 'format' => 'raw', 'options' => ['width' => '10px']], ['class' => 'roman444uk\\yii\\grid\\StatusColumn', 'attribute' => 'status', 'optionsArray' => [[User::STATUS_ACTIVE, UsersModule::t('back', 'Active'), 'success'], [User::STATUS_INACTIVE, UsersModule::t('back', 'Inactive'), 'warning'], [User::STATUS_BANNED, UsersModule::t('back', 'Banned'), 'danger']], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['class' => 'actions'], 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['title' => Yii::t('yii', 'View'), 'data-pjax' => '0', 'data-view' => $key]);
}, 'update' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0', 'data-update' => $key]);
}]]]]);
?>

    <?php 
echo MagnificPopup::widget(['id' => '', 'type' => 'ajax', 'target' => '#user-grid-create-button, a[data-update], a[data-view]', 'options' => ['removalDelay' => 300]]);
?>

<?php 
Pjax::end();
?>

<?php 
Beispiel #3
0
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\DetailView;
use roman444uk\users\components\GhostHtml;
use roman444uk\users\models\rbacDB\Role;
use roman444uk\users\models\User;
use roman444uk\users\UsersModule;
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => 'Пользователи сервисов', 'url' => ['list']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
if (!Yii::$app->request->isAjax) {
    ?>
    <p>
        <?php 
    echo GhostHtml::a(UsersModule::t('back', 'Edit'), ['update', 'id' => $model->serviceId], ['class' => 'btn btn-sm btn-primary']);
    ?>
        <?php 
    echo GhostHtml::a(UsersModule::t('back', 'Delete'), ['delete', 'id' => $model->serviceId], ['class' => 'btn btn-sm btn-danger pull-right', 'data' => ['confirm' => UsersModule::t('back', 'Are you sure you want to delete this user?'), 'method' => 'post']]);
    ?>
    </p>
<?php 
}
?>

<?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'status', 'value' => User::getStatusValue($model->status)], 'username', ['attribute' => 'email', 'value' => $model->email, 'format' => 'email', 'visible' => User::hasPermission('viewUserEmail')], ['label' => UsersModule::t('back', 'Roles'), 'value' => implode('<br>', ArrayHelper::map(Role::getUserRoles($model->id), 'name', 'description')), 'visible' => User::hasPermission('viewUserRoles'), 'format' => 'raw']]]);
<?php 
$form = ActiveForm::begin(['id' => 'user', 'validateOnBlur' => false, 'fieldConfig' => ['template' => "{input}\n{error}"], 'options' => ['autocomplete' => 'off', 'class' => 'auth-form']]);
?>

    <?php 
if ($model->scenario != 'restoreViaEmail') {
    ?>
        <?php 
    echo $form->field($model, 'current_password')->passwordInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('current_password'), 'autocomplete' => 'off']);
    ?>
    <?php 
}
?>

    <?php 
echo $form->field($model, 'password')->passwordInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('password'), 'autocomplete' => 'off']);
?>

    <?php 
echo $form->field($model, 'repeat_password')->passwordInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('repeat_password'), 'autocomplete' => 'off']);
?>
    
    <div class="form-group button-container">
        <?php 
echo Html::submitButton(UsersModule::t('back', 'Save'));
?>
    </div>

<?php 
ActiveForm::end();
Beispiel #5
0
$eauthAssetPath = Yii::$app->assetManager->publish(Yii::$app->getModule('eauth')->basePath . '/assets');
$eauthAssetPath = $eauthAssetPath[0];
$this->title = EauthModule::t('Service users');
$this->params['breadcrumbs'][] = $this->title;
?>


<?php 
Pjax::begin(['id' => 'user-grid-pjax']);
?>

    <?php 
echo GridView::widget(['id' => 'service-user-grid', 'dataProvider' => $dataProvider, 'pager' => ['options' => ['class' => 'pagination pagination-sm'], 'hideOnSinglePage' => true, 'lastPageLabel' => '>>', 'firstPageLabel' => '<<'], 'filterModel' => $searchModel, 'layout' => '
            <div class="row">
                <div class="col-sm-4">
                    ' . GhostHtml::a('<span class="glyphicon glyphicon-plus-sign"></span> ' . UsersModule::t('back', 'Create'), ['/eauth/service-user/create'], ['id' => 'service-user-grid-create-button', 'class' => 'btn btn-success btn-sm']) . '
                </div>
                <div class="col-sm-4 text-center">
                    {summary}
                </div>
                <div class="col-sm-4 text-right">
                    ' . WidgetPageSize::widget(['pjaxId' => 'service-user-grid-pjax']) . '
                </div>
            </div>
            {items}
            <div class="row">
                <div class="col-sm-8">
                    {pager}
                </div>
                <div class="col-sm-4 text-right" style="padding: 20px">
                    ' . GridBulkActions::widget(['gridId' => 'user-grid']) . '
Beispiel #6
0
    </div>
    
<?php 
ActiveForm::end();
?>

<div class="form-group button-container">
    <span>Войти с помощью:</span>
    <?php 
echo $this->render('@frontend/views/layouts/_social-icons-panel');
?>
    
    <br><br>
    <?php 
echo Html::a(UsersModule::t('front', "Registration"), ['/users/auth/registration'], ['class' => 'registration']);
?>
    <br>
    <?php 
echo Html::a(UsersModule::t('front', 'Password recovery'), ['/users/auth/password-recovery'], ['class' => 'password-recovery']);
?>
</div>
    
<?php 
if (Yii::$app->request->isAjax) {
    $js = <<<JS
jQuery('#auth-container .registration').magnificPopup({"type":"ajax","prependTo":"#auth-container","removalDelay":300,"showCloseBtn":true});
jQuery('#auth-container .password-recovery').magnificPopup({"type":"ajax","prependTo":"#auth-container","removalDelay":300,"showCloseBtn":true});
JS;
    MagnificPopupAsset::register($this);
    $this->registerJs($js);
}
Beispiel #7
0
use roman444uk\users\UsersModule;
use yii\widgets\Menu;
$route = Yii::$app->controller->route;
$dataInformer = Yii::$app->dataInformer;
$advertsCountStatusNew = $dataInformer->get(DataInformer::ADVERT_COUNT_STATUS_NEW, 0);
$advertsCountTotal = $dataInformer->get(DataInformer::ADVERT_COUNT_TOTAL, 0);
$categoryCountTotal = $dataInformer->get(DataInformer::CATEGORY_COUNT_TOTAL, 0);
$cityCountTotal = $dataInformer->get(DataInformer::CITY_COUNT_TOTAL, 0);
$userCountFromService = $dataInformer->get(DataInformer::USER_COUNT_FROM_SERVICE, 0);
$userCountRegistered = $dataInformer->get(DataInformer::USER_COUNT_REGISTERED, 0);
$userCountTotal = $dataInformer->get(DataInformer::USER_COUNT_TOTAL, 0);
?>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
    <section class="sidebar">
          
        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."/>
                <span class="input-group-btn">
                    <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
                </span>
            </div>
        </form>

        <?php 
echo Menu::widget(['activateParents' => true, 'options' => ['id' => 'admin-menu', 'class' => 'sidebar-menu'], 'labelTemplate' => '<a href="#"><span>{label}</span></a>', 'linkTemplate' => '<a href="{url}"><span>{label}</span></a>', 'submenuTemplate' => "<ul class=\"treeview-menu\">{items}</ul>", 'items' => [['url' => '', 'label' => 'Объявления', 'active' => in_array(Yii::$app->controller->id, ['advert', 'category', 'city']), 'items' => [['url' => ['/advert/list?status=' . Advert::STATUS_NEW], 'label' => 'Новые' . ($advertsCountStatusNew ? ' (' . $advertsCountStatusNew . ')' : '')], ['url' => ['/advert/list'], 'label' => 'Все (' . $advertsCountTotal . ')'], ['url' => ['/category/list'], 'label' => 'Категории (' . $categoryCountTotal . ')'], ['url' => ['/city/list'], 'label' => 'Города (' . $cityCountTotal . ')'], ['url' => ['/advert/stat'], 'label' => 'Статистика']]], ['url' => '', 'label' => 'Пользователи', 'active' => Yii::$app->controller->module->id == 'users' || Yii::$app->controller->module->id == 'eauth', 'items' => [['label' => 'Все (' . $userCountTotal . ')', 'url' => ['/users/user/with-eauth']], ['label' => 'Зарегистрированные (' . $userCountRegistered . ')', 'url' => ['/users/user/list']], ['url' => ['/eauth/service-user/list'], 'label' => 'Из сервисов (' . $userCountFromService . ')'], ['label' => UsersModule::t('back', 'Roles'), 'url' => ['/users/role/list'], 'active' => Yii::$app->controller->id == 'role'], ['label' => UsersModule::t('back', 'Permissions'), 'url' => ['/users/permission/list'], 'active' => Yii::$app->controller->id == 'permission'], ['label' => UsersModule::t('back', 'Permission groups'), 'url' => ['/users/auth-item-group/list'], 'active' => Yii::$app->controller->id == 'auth-item-group'], ['label' => UsersModule::t('back', 'Visit log'), 'url' => ['/users/user-visit-log/list'], 'active' => Yii::$app->controller->id == 'user-visit-log'], ['label' => 'Статистика', 'url' => ['/users/stat/index']]]], ['url' => ['/files/file/list'], 'label' => 'Менеджер файлов'], ['url' => ['/pages/manager'], 'label' => 'Страницы'], ['url' => [''], 'label' => 'Общая статистика', 'active' => in_array($route, ['users/user-visit-log/list']), 'items' => [['url' => ['/users/user-visit-log/list'], 'label' => 'Посещения']]]]]);
?>
    </section>
</aside>