14 $this->_authorizer = $this->module->getAuthorizer();
15 $this->
layout = $this->module->layout;
16 $this->defaultAction =
'index';
19 $this->module->registerScripts();
27 return array(
'accessControl');
41 'index',
'search',
'update',
'edit',
'editOperationsFields',
43 'users' => $this->_authorizer->getSuperusers(),
46 'users' => array(
'*'),
62 $this->render(
'index', array(
'dataProvider' =>
$data,
70 public function actionSearch($pattern, $siteId, $searchUserId, $rights, $pageSize, $currentPage = 0)
72 $userId = Yii::app()->user->id;
75 $params = $model->buildFindParams(compact(
85 $model->createRequest($params);
86 $sites = $model->search($params);
87 $itemsProvider =
new CArrayDataProvider($sites, array(
88 'pagination' => array(
89 'pageSize' => $pageSize,
93 $pages =
new CPagination(1000000000);
94 $pages->pageVar =
'currentPage';
97 $this->render(
'search', array(
99 'sites' => $model->encode($sites),
100 'itemsProvider' => $itemsProvider,
102 'currentPage' => $currentPage,
103 'pageSize' => $pageSize,
113 $sites = Yii::app()->request->getPost(
'sites');
114 $rights = Yii::app()->request->getPost(
'Rights');
117 $model->setRightsAllRecords($model->decode($sites), $rights);
119 Yii::app()->user->setFlash($this->module->flashSuccessKey,
'Update success');
120 $this->redirect(Yii::app()->request->urlReferrer);
132 $site = $model->findByAttributes(array(
133 'Site_Id' => $siteId,
'User_Id' => $userId,
136 $site = compact(
'siteId',
'userId');
138 $this->render(
'edit', array(
143 'sites' => $model->encode(array($site)),
153 if (Yii::app()->request->isPostRequest) {
154 $rightsList = Yii::app()->getRequest()->getPost(
'RightsList');
155 $model->setRightsList($rightsList);
157 $rightsList = $model->getRightsList();
158 $this->render(
'editOperationsFields', compact(
'model',
'rightsList'));