/**
  * @param bool $performValidation
  *
  * @return bool
  */
 public function sendEmail($performValidation = true)
 {
     if ($performValidation and !$this->validate()) {
         return false;
     }
     $this->user->generateConfirmationToken();
     $this->user->save(false);
     return Yii::$app->mailer->compose(Yii::$app->getModule('user-management')->mailerOptions['passwordRecoveryFormViewFile'], ['user' => $this->user])->setFrom(Yii::$app->getModule('user-management')->mailerOptions['from'])->setTo($this->email)->setSubject(UserManagementModule::t('front', 'Password reset for') . ' ' . Yii::$app->name)->send();
 }
 /**
  * Validates current password
  */
 public function validateCurrentPassword()
 {
     if (!Yii::$app->getModule('user-management')->checkAttempts()) {
         $this->addError('current_password', UserManagementModule::t('back', 'Too many attempts'));
         return false;
     }
     if (!Yii::$app->security->validatePassword($this->current_password, $this->user->password_hash)) {
         $this->addError('current_password', UserManagementModule::t('back', "Wrong password"));
     }
 }
Esempio n. 3
0
 /**
  * Check if user is binded to IP and compare it with his actual IP
  */
 public function validateIP()
 {
     $user = $this->getUser();
     if ($user and $user->bind_to_ip) {
         $ips = explode(',', $user->bind_to_ip);
         $ips = array_map('trim', $ips);
         if (!in_array(LittleBigHelper::getRealIp(), $ips)) {
             $this->addError('password', UserManagementModule::t('front', "You could not login from this IP"));
         }
     }
 }
 /**
  * Add or remove child permissions (including routes) and return back to view
  *
  * @param string $id
  *
  * @return \yii\web\Response
  */
 public function actionSetChildPermissions($id)
 {
     $role = $this->findModel($id);
     $newChildPermissions = Yii::$app->request->post('child_permissions', []);
     $oldChildPermissions = array_keys((new DbManager())->getPermissionsByRole($role->name));
     $toRemove = array_diff($oldChildPermissions, $newChildPermissions);
     $toAdd = array_diff($newChildPermissions, $oldChildPermissions);
     Role::addChildren($role->name, $toAdd);
     Role::removeChildren($role->name, $toRemove);
     Yii::$app->session->setFlash('success', UserManagementModule::t('back', 'Saved'));
     return $this->redirect(['view', 'id' => $id]);
 }
 /**
  * Add or remove routes for this permission
  *
  * @param string $id
  *
  * @return \yii\web\Response
  */
 public function actionSetChildRoutes($id)
 {
     $item = $this->findModel($id);
     $newRoutes = Yii::$app->request->post('child_routes', []);
     $oldRoutes = array_keys(AuthHelper::getChildrenByType($item->name, AbstractItem::TYPE_ROUTE));
     $toAdd = array_diff($newRoutes, $oldRoutes);
     $toRemove = array_diff($oldRoutes, $newRoutes);
     Permission::addChildren($id, $toAdd);
     Permission::removeChildren($id, $toRemove);
     if (($toAdd or $toRemove) and $id == Yii::$app->getModule('user-management')->commonPermissionName) {
         Yii::$app->cache->delete('__commonRoutes');
     }
     AuthHelper::invalidatePermissions();
     Yii::$app->session->setFlash('success', UserManagementModule::t('back', 'Saved'));
     return $this->redirect(['view', 'id' => $id]);
 }
 /**
  * @param int $id - User ID
  *
  * @return \yii\web\Response
  */
 public function actionSetRoles($id)
 {
     if (!Yii::$app->user->isSuperadmin and Yii::$app->user->id == $id) {
         Yii::$app->session->setFlash('error', UserManagementModule::t('back', 'You can not change own permissions'));
         return $this->redirect(['set', 'id' => $id]);
     }
     $oldAssignments = array_keys(Role::getUserRoles($id));
     // To be sure that user didn't attempt to assign himself some unavailable roles
     $newAssignments = array_intersect(Role::getAvailableRoles(Yii::$app->user->isSuperAdmin, true), Yii::$app->request->post('roles', []));
     $toAssign = array_diff($newAssignments, $oldAssignments);
     $toRevoke = array_diff($oldAssignments, $newAssignments);
     foreach ($toRevoke as $role) {
         User::revokeRole($id, $role);
     }
     foreach ($toAssign as $role) {
         User::assignRole($id, $role);
     }
     Yii::$app->session->setFlash('success', UserManagementModule::t('back', 'Saved'));
     return $this->redirect(['set', 'id' => $id]);
 }
<?php

use webvimark\modules\UserManagement\UserManagementModule;
/**
 * @var yii\web\View $this
 * @var webvimark\modules\UserManagement\models\User $user
 */
$this->title = UserManagementModule::t('front', 'Registration - confirm your e-mail');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="registration-wait-for-confirmation">

	<div class="alert alert-info text-center">
		<?php 
echo UserManagementModule::t('front', 'Check your e-mail {email} for instructions to activate account', ['email' => '<b>' . $user->email . '</b>']);
?>
	</div>

</div>
Esempio n. 8
0
<?php

use webvimark\extensions\DateRangePicker\DateRangePicker;
use webvimark\modules\UserManagement\UserManagementModule;
use yii\helpers\Html;
use yii\widgets\Pjax;
use webvimark\extensions\GridPageSize\GridPageSize;
use yii\grid\GridView;
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var webvimark\modules\UserManagement\models\search\UserVisitLogSearch $searchModel
 */
$this->title = UserManagementModule::t('back', 'Visit log');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-visit-log-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<div class="panel panel-default">

		<div class="panel-body">

			<div class="row">
				<div class="col-sm-12 text-right">
					<?php 
echo GridPageSize::widget(['pjaxId' => 'user-visit-log-grid-pjax']);
?>
Esempio n. 9
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => 'ID', 'token' => 'Token', 'ip' => 'IP', 'language' => UserManagementModule::t('back', 'Language'), 'browser' => UserManagementModule::t('back', 'Browser'), 'os' => UserManagementModule::t('back', 'OS'), 'user_agent' => UserManagementModule::t('back', 'User agent'), 'user_id' => UserManagementModule::t('back', 'User'), 'visit_time' => UserManagementModule::t('back', 'Visit Time')];
 }
 */
$this->title = UserManagementModule::t('front', 'E-mail confirmed');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="change-own-password-success">

	<div class="alert alert-success text-center">
		<?php 
echo UserManagementModule::t('front', 'E-mail confirmed');
?>
 - <b><?php 
echo $user->email;
?>
</b>

		<?php 
if (isset($_GET['returnUrl'])) {
    ?>
			<br/>
			<br/>
			<b><?php 
    echo Html::a(UserManagementModule::t('front', 'Continue'), $_GET['returnUrl']);
    ?>
</b>
		<?php 
}
?>
	</div>

</div>
Esempio n. 11
0
 /**
  * For Menu
  *
  * @return array
  */
 public static function menuItems()
 {
     return [['label' => '<i class="fa fa-angle-double-right"></i> ' . UserManagementModule::t('back', 'Users'), 'url' => ['/user-management/user/index']], ['label' => '<i class="fa fa-angle-double-right"></i> ' . UserManagementModule::t('back', 'Roles'), 'url' => ['/user-management/role/index']], ['label' => '<i class="fa fa-angle-double-right"></i> ' . UserManagementModule::t('back', 'Permissions'), 'url' => ['/user-management/permission/index']], ['label' => '<i class="fa fa-angle-double-right"></i> ' . UserManagementModule::t('back', 'Permission groups'), 'url' => ['/user-management/auth-item-group/index']], ['label' => '<i class="fa fa-angle-double-right"></i> ' . UserManagementModule::t('back', 'Visit log'), 'url' => ['/user-management/user-visit-log/index']]];
 }
Esempio n. 12
0
echo $this->title;
?>
</h2>

	<div class="panel panel-default">
		<div class="panel-body">

		    <p>
			<?php 
echo GhostHtml::a(UserManagementModule::t('back', 'Edit'), ['update', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary']);
?>
			<?php 
echo GhostHtml::a(UserManagementModule::t('back', 'Create'), ['create'], ['class' => 'btn btn-sm btn-success']);
?>
			<?php 
echo GhostHtml::a(UserManagementModule::t('back', 'Roles and permissions'), ['/user-management/user-permission/set', 'id' => $model->id], ['class' => 'btn btn-sm btn-default']);
?>

			<?php 
echo GhostHtml::a(UserManagementModule::t('back', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-sm btn-danger pull-right', 'data' => ['confirm' => UserManagementModule::t('back', 'Are you sure you want to delete this user?'), 'method' => 'post']]);
?>
		    </p>

			<?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')], ['attribute' => 'email_confirmed', 'value' => $model->email_confirmed, 'format' => 'boolean', 'visible' => User::hasPermission('viewUserEmail')], ['label' => UserManagementModule::t('back', 'Roles'), 'value' => implode('<br>', ArrayHelper::map(Role::getUserRoles($model->id), 'name', 'description')), 'visible' => User::hasPermission('viewUserRoles'), 'format' => 'raw'], ['attribute' => 'bind_to_ip', 'visible' => User::hasPermission('bindUserToIp')], array('attribute' => 'registration_ip', 'value' => Html::a($model->registration_ip, "http://ipinfo.io/" . $model->registration_ip, ["target" => "_blank"]), 'format' => 'raw', 'visible' => User::hasPermission('viewRegistrationIp')), 'created_at:datetime', 'updated_at:datetime']]);
?>

		</div>
	</div>
</div>
Esempio n. 13
0
<?php

use app\assets\AppAsset;
use webvimark\modules\UserManagement\UserManagementModule;
use yii\bootstrap\BootstrapAsset;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
$this->title = UserManagementModule::t('front', 'Authorization');
BootstrapAsset::register($this);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
	<meta charset="<?php 
echo Yii::$app->charset;
?>
"/>
	<meta name="robots" content="noindex, nofollow">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<?php 
echo Html::csrfMetaTags();
?>
	<title><?php 
echo Html::encode($this->title);
?>
</title>
Esempio n. 14
0
 /**
  * @return array
  */
 public function attributeLabels()
 {
     return ['id' => 'ID', 'username' => UserManagementModule::t('back', 'Login'), 'superadmin' => UserManagementModule::t('back', 'Superadmin'), 'confirmation_token' => 'Confirmation Token', 'registration_ip' => UserManagementModule::t('back', 'Registration IP'), 'bind_to_ip' => UserManagementModule::t('back', 'Bind to IP'), 'status' => UserManagementModule::t('back', 'Status'), 'gridRoleSearch' => UserManagementModule::t('back', 'Roles'), 'created_at' => UserManagementModule::t('back', 'Created'), 'updated_at' => UserManagementModule::t('back', 'Updated'), 'password' => UserManagementModule::t('back', 'Password'), 'repeat_password' => UserManagementModule::t('back', 'Repeat password'), 'email_confirmed' => UserManagementModule::t('back', 'E-mail confirmed'), 'email' => 'E-mail'];
 }
Esempio n. 15
0
?>


				<div class="form-group">
					<div class="col-sm-offset-3 col-sm-9">
						<?php 
if ($model->isNewRecord) {
    ?>
							<?php 
    echo Html::submitButton('<span class="glyphicon glyphicon-plus-sign"></span> ' . UserManagementModule::t('back', 'Create'), ['class' => 'btn btn-success']);
    ?>
						<?php 
} else {
    ?>
							<?php 
    echo Html::submitButton('<span class="glyphicon glyphicon-ok"></span> ' . UserManagementModule::t('back', 'Save'), ['class' => 'btn btn-primary']);
    ?>
						<?php 
}
?>
					</div>
				</div>

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

			</div>
		</div>
	</div>
<?php

use webvimark\modules\UserManagement\UserManagementModule;
/**
 * @var yii\web\View $this
 */
$this->title = UserManagementModule::t('back', 'Change own password');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="change-own-password-success">

	<div class="alert alert-success text-center">
		<?php 
echo UserManagementModule::t('back', 'Password has been changed');
?>
	</div>

</div>
Esempio n. 17
0
	<?php 
echo $form->field($model, 'username')->textInput(['maxlength' => 50, 'autocomplete' => 'off', 'autofocus' => true]);
?>

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

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

	<?php 
echo $form->field($model, 'captcha')->widget(Captcha::className(), ['template' => '<div class="row"><div class="col-sm-2">{image}</div><div class="col-sm-3">{input}</div></div>', 'captchaAction' => ['/user-management/auth/captcha']]);
?>

	<div class="form-group">
		<div class="col-sm-offset-3 col-sm-9">
			<?php 
echo Html::submitButton('<span class="glyphicon glyphicon-ok"></span> ' . UserManagementModule::t('front', 'Register'), ['class' => 'btn btn-primary']);
?>
		</div>
	</div>

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

</div>
Esempio n. 18
0
<?php

use webvimark\modules\UserManagement\UserManagementModule;
/**
 * @var yii\web\View $this
 * @var webvimark\modules\UserManagement\models\User $user
 */
$this->title = UserManagementModule::t('front', 'E-mail confirmed');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="change-own-password-success">

	<div class="alert alert-success text-center">
		<?php 
echo UserManagementModule::t('front', 'E-mail confirmed');
?>
 - <b><?php 
echo $user->email;
?>
</b>
	</div>

</div>
Esempio n. 19
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['name' => UserManagementModule::t('back', 'Name'), 'code' => UserManagementModule::t('back', 'Code'), 'created_at' => UserManagementModule::t('back', 'Created'), 'updated_at' => UserManagementModule::t('back', 'Updated')];
 }
Esempio n. 20
0
echo $form->field($model, 'rememberMe')->checkbox(['value' => true]);
?>

					<?php 
echo Html::submitButton(UserManagementModule::t('front', 'Login'), ['class' => 'btn btn-lg btn-primary btn-block']);
?>

					<div class="row registration-block">
						<div class="col-sm-6">
							<?php 
echo GhostHtml::a(UserManagementModule::t('front', "Registration"), ['/user-management/auth/registration']);
?>
						</div>
						<div class="col-sm-6 text-right">
							<?php 
echo GhostHtml::a(UserManagementModule::t('front', "Forgot password ?"), ['/user-management/auth/password-recovery']);
?>
						</div>
					</div>




					<?php 
ActiveForm::end();
?>
				</div>
			</div>
		</div>
	</div>
</div>
 /**
  * @param User $user
  *
  * @return bool
  */
 protected function sendConfirmationEmail($user)
 {
     return Yii::$app->mailer->compose(Yii::$app->getModule(\Yii::$app->user->moduleAliasName)->mailerOptions['registrationFormViewFile'], ['user' => $user])->setFrom(Yii::$app->getModule(\Yii::$app->user->moduleAliasName)->mailerOptions['from'])->setTo($user->email)->setSubject(UserManagementModule::t('front', 'E-mail confirmation for') . ' ' . Yii::$app->name)->send();
 }
Esempio n. 22
0
?>
				</div>
			</div>


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

			<?php 
echo GridView::widget(['id' => 'user-grid', 'dataProvider' => $dataProvider, 'pager' => ['options' => ['class' => 'pagination pagination-sm'], 'hideOnSinglePage' => true, 'lastPageLabel' => '>>', 'firstPageLabel' => '<<'], 'filterModel' => $searchModel, 'layout' => '{items}<div class="row"><div class="col-sm-8">{pager}</div><div class="col-sm-4 text-right">{summary}' . GridBulkActions::widget(['gridId' => 'user-grid', 'actions' => [Url::to(['bulk-activate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Activate'), Url::to(['bulk-deactivate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Deactivate'), '----' => [Url::to(['bulk-delete']) => GridBulkActions::t('app', 'Delete')]]]) . '</div></div>', 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:10px']], ['class' => 'webvimark\\components\\StatusColumn', 'attribute' => 'superadmin', 'visible' => Yii::$app->user->isSuperadmin], ['attribute' => 'username', 'value' => function (User $model) {
    return Html::a($model->username, ['view', 'id' => $model->id], ['data-pjax' => 0]);
}, 'format' => 'raw'], ['attribute' => 'email', 'format' => 'raw', 'visible' => User::hasPermission('viewUserEmail')], ['class' => 'webvimark\\components\\StatusColumn', 'attribute' => 'email_confirmed', 'visible' => User::hasPermission('viewUserEmail')], ['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')], ['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')], ['value' => function (User $model) {
    return GhostHtml::a(UserManagementModule::t('back', 'Roles and permissions'), ['/user-management/user-permission/set', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary', 'data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::canRoute('/user-management/user-permission/set'), 'options' => ['width' => '10px']], ['value' => function (User $model) {
    return GhostHtml::a(UserManagementModule::t('back', 'Change password'), ['change-password', 'id' => $model->id], ['class' => 'btn btn-sm btn-default', 'data-pjax' => 0]);
}, 'format' => 'raw', 'options' => ['width' => '10px']], ['class' => 'webvimark\\components\\StatusColumn', 'attribute' => 'status', 'optionsArray' => [[User::STATUS_ACTIVE, UserManagementModule::t('back', 'Active'), 'success'], [User::STATUS_INACTIVE, UserManagementModule::t('back', 'Inactive'), 'warning'], [User::STATUS_BANNED, UserManagementModule::t('back', 'Banned'), 'danger']]], ['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width:70px; text-align:center;']]]]);
?>

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

		</div>
	</div>
</div>
Esempio n. 23
0
	<!-- User Account: style can be found in dropdown.less -->
	<li class="dropdown user user-menu">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">
			<i class="glyphicon glyphicon-user"></i>
			<span><?php 
echo Yii::$app->user->username;
?>
 <i class="caret"></i></span>
		</a>
		<ul class="dropdown-menu">

			<!-- Menu Footer-->
			<li class="user-footer">
				<div class="pull-left">
					<?php 
echo GhostHtml::a('<i class="fa fa-random"></i> ' . UserManagementModule::t('back', 'Change password'), ['/user-management/auth/change-own-password'], ['class' => 'btn btn-default btn-flat']);
?>
				</div>
				<div class="pull-right">
					<?php 
echo Html::a('<i class="fa fa-power-off"></i> ' . UserManagementModule::t('back', 'Logout'), ['/user-management/auth/logout'], ['class' => 'btn btn-default btn-flat']);
?>
				</div>
			</li>
		</ul>
	</li>
</ul>
</div>
</nav>
</header>
 /**
  * For Menu
  *
  * @return array
  */
 public static function menuItems2()
 {
     return [['label' => UserManagementModule::t('back', 'Users'), 'url' => ['/user-management/user/index']], ['label' => UserManagementModule::t('back', 'Roles'), 'url' => ['/user-management/role/index']], ['label' => UserManagementModule::t('back', 'Permissions'), 'url' => ['/user-management/permission/index']], ['label' => UserManagementModule::t('back', 'Permission groups'), 'url' => ['/user-management/auth-item-group/index']], ['label' => UserManagementModule::t('back', 'Visit log'), 'url' => ['/user-management/user-visit-log/index']]];
 }
Esempio n. 25
0
<?php

use webvimark\modules\UserManagement\UserManagementModule;
use yii\helpers\Html;
/**
 * @var yii\web\View $this
 * @var webvimark\modules\UserManagement\models\User $model
 */
$this->title = UserManagementModule::t('back', 'User creation');
$this->params['breadcrumbs'][] = ['label' => UserManagementModule::t('back', 'Users'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-create">

	<h2 class="lte-hide-title"><?php 
echo $this->title;
?>
</h2>

	<div class="panel panel-default">
		<div class="panel-body">

			<?php 
echo $this->render('_form', compact('model'));
?>
		</div>
	</div>

</div>
Esempio n. 26
0
    ?>

				<div class="form-group">
					<div class="col-sm-offset-3 col-sm-9">
						<?php 
    echo Html::submitButton('<span class="glyphicon glyphicon-ok"></span> ' . UserManagementModule::t('front', 'Confirm'), ['class' => 'btn btn-primary']);
    ?>
					</div>
				</div>

				<?php 
    ActiveForm::end();
    ?>
			<?php 
} else {
    ?>

				<div class="alert alert-info text-center">
					<?php 
    echo UserManagementModule::t('back', 'E-mail with activation link has been sent to <b>{email}</b>. This link will expire in {minutes} min.', ['email' => $model->user->email, 'minutes' => $model->getTokenTimeLeft(true)]);
    ?>
				</div>
			<?php 
}
?>


		</div>
	</div>
</div>
Esempio n. 27
0
$this->title = UserManagementModule::t('back', 'Roles');
$this->params['breadcrumbs'][] = $this->title;
?>

<h2 class="lte-hide-title"><?php 
echo $this->title;
?>
</h2>

<div class="panel panel-default">
	<div class="panel-body">
		<div class="row">
			<div class="col-sm-6">
				<p>
					<?php 
echo GhostHtml::a('<span class="glyphicon glyphicon-plus-sign"></span> ' . UserManagementModule::t('back', 'Create'), ['create'], ['class' => 'btn btn-success']);
?>
				</p>
			</div>

			<div class="col-sm-6 text-right">
				<?php 
echo GridPageSize::widget(['pjaxId' => 'role-grid-pjax']);
?>
			</div>
		</div>

		<?php 
Pjax::begin(['id' => 'role-grid-pjax']);
?>
Esempio n. 28
0
?>


				<?php 
echo Html::endForm();
?>
			</div>
		</div>
	</div>

	<div class="col-sm-8">
		<div class="panel panel-default">
			<div class="panel-heading">
				<strong>
					<span class="glyphicon glyphicon-th"></span> <?php 
echo UserManagementModule::t('back', 'Permissions');
?>
				</strong>
			</div>
			<div class="panel-body">

				<div class="row">
					<?php 
foreach ($permissionsByGroup as $groupName => $permissions) {
    ?>

						<div class="col-sm-6">
							<fieldset>
								<legend><?php 
    echo $groupName;
    ?>
Esempio n. 29
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['name' => UserManagementModule::t('back', 'Code'), 'description' => UserManagementModule::t('back', 'Description'), 'rule_name' => UserManagementModule::t('back', 'Rule'), 'group_code' => UserManagementModule::t('back', 'Group'), 'data' => UserManagementModule::t('back', 'Data'), 'type' => UserManagementModule::t('back', 'Type'), 'created_at' => UserManagementModule::t('back', 'Created'), 'updated_at' => UserManagementModule::t('back', 'Updated')];
 }
Esempio n. 30
0
 /**
  * Receive token, find user by it and confirm email
  *
  * @param string $token
  *
  * @throws \yii\web\NotFoundHttpException
  * @return string|\yii\web\Response
  */
 public function actionConfirmEmailReceive($token)
 {
     $user = User::findByConfirmationToken($token);
     if (!$user) {
         throw new NotFoundHttpException(UserManagementModule::t('front', 'Token not found. It may be expired'));
     }
     $user->email_confirmed = 1;
     $user->removeConfirmationToken();
     $user->save(false);
     return $this->renderIsAjax('confirmEmailSuccess', compact('user'));
 }