当前位置: 首页>>代码示例>>PHP>>正文


PHP UserManagement\UserManagementModule类代码示例

本文整理汇总了PHP中webvimark\modules\UserManagement\UserManagementModule的典型用法代码示例。如果您正苦于以下问题:PHP UserManagementModule类的具体用法?PHP UserManagementModule怎么用?PHP UserManagementModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UserManagementModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendEmail

 /**
  * @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();
 }
开发者ID:laherre,项目名称:user-management,代码行数:14,代码来源:PasswordRecoveryForm.php

示例2: validateCurrentPassword

 /**
  * 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"));
     }
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:13,代码来源:ChangeOwnPasswordForm.php

示例3: validateIP

 /**
  * 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"));
         }
     }
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:14,代码来源:LoginForm.php

示例4: actionSetChildPermissions

 /**
  * 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]);
 }
开发者ID:alizowghi,项目名称:user-management,代码行数:19,代码来源:RoleController.php

示例5: actionSetChildRoutes

 /**
  * 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]);
 }
开发者ID:skophp,项目名称:user-management,代码行数:23,代码来源:PermissionController.php

示例6: actionSetRoles

 /**
  * @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]);
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:25,代码来源:UserPermissionController.php

示例7:

<?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>
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:19,代码来源:registrationWaitForEmailConfirmation.php

示例8:

<?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']);
?>
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:31,代码来源:index.php

示例9: attributeLabels

 /**
  * @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')];
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:7,代码来源:UserVisitLog.php

示例10:

 */
$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>
开发者ID:laherre,项目名称:user-management,代码行数:30,代码来源:confirmEmailSuccess.php

示例11: menuItems

 /**
  * 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']]];
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:9,代码来源:UserManagementModule.php

示例12: implode

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>
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:30,代码来源:view.php

示例13:

<?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>
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:31,代码来源:loginLayout.php

示例14: attributeLabels

 /**
  * @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'];
 }
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:7,代码来源:User.php

示例15:

?>


				<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>
开发者ID:gpis88ce,项目名称:Gpis88ce,代码行数:30,代码来源:changePassword.php


注:本文中的webvimark\modules\UserManagement\UserManagementModule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。