Ejemplo n.º 1
0
 /**
  * Lists all users.
  */
 public function actionIndex()
 {
     $model = new UserGroupsUser('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['UserGroupsUser'])) {
         $model->attributes = $_GET['UserGroupsUser'];
     }
     if (Yii::app()->request->isAjaxRequest) {
         $this->renderPartial('index', array('model' => $model), false, true);
     } else {
         $this->render('index', array('model' => $model), false, true);
     }
 }
 /**
  * Displays the current configurations
  */
 public function actionIndex()
 {
     // load the data provider and models for the grid views
     $confDataProvider = new CActiveDataProvider('UserGroupsConfiguration', array('pagination' => array('pageSize' => 20)));
     $cronDataProvider = new CActiveDataProvider('UserGroupsCron', array('pagination' => array('pageSize' => 10)));
     $groupModel = new UserGroupsGroup('search');
     $groupModel->unsetAttributes();
     $userModel = new UserGroupsUser('search');
     $userModel->unsetAttributes();
     // load the filtering data to the group model
     if (isset($_GET['UserGroupsGroup'])) {
         $groupModel->attributes = $_GET['UserGroupsGroup'];
     }
     // load the filtering data to the user model
     if (isset($_GET['UserGroupsUser'])) {
         $userModel->attributes = $_GET['UserGroupsUser'];
     }
     // checks if the configuration form has been sent
     if (isset($_POST['UserGroupsConfiguration'])) {
         $this->configurationSave($_POST['UserGroupsConfiguration']);
     }
     // checks if the cron form has been sent
     if (isset($_POST['UserGroupsCron'])) {
         $this->cronSave($_POST['UserGroupsCron']);
     }
     // checks if the cron remove form has been sent
     if (isset($_POST['UserGroupsCronRemove'])) {
         $this->cronRemove();
     }
     // checks if the access form has been sent
     if (isset($_POST['UserGroupsAccess']) && !isset($_POST['UserGroupsAccess']['delete'])) {
         $this->accessPermissionSave($_POST['UserGroupsAccess']);
     }
     if (isset($_POST['UserGroupsAccess']) && isset($_POST['UserGroupsAccess']['delete'])) {
         $this->itemDelete($_POST['UserGroupsAccess']);
     }
     // checks if the page was loaded as ajax
     if (Yii::app()->request->isAjaxRequest) {
         $this->renderPartial('index', array('confDataProvider' => $confDataProvider, 'cronDataProvider' => $cronDataProvider, 'groupModel' => $groupModel, 'userModel' => $userModel), false, true);
     } else {
         $this->render('index', array('confDataProvider' => $confDataProvider, 'cronDataProvider' => $cronDataProvider, 'groupModel' => $groupModel, 'userModel' => $userModel));
     }
 }