예제 #1
0
 /**
  * parameters preparation after a select is executed
  */
 public function afterFind()
 {
     if (!$this->notUseAfrefind && Yii::app()->controller->action->id != 'NotSentEmails') {
         if (!$this->relProfile) {
             $this->relProfile = new Profile();
             $this->relProfile->ug_id = $this->id;
             $this->relProfile->save();
         }
         // retrieve the group name
         $this->group_name = $this->relUserGroupsGroup->groupname;
         // retrieve the user access permission's arra
         if ((int) $this->id === self::ROOT) {
             $this->access = self::ROOT_ACCESS;
         } else {
             $this->access = UserGroupsAccess::findRules(UserGroupsAccess::USER, $this->id);
         }
         // copy the level of it's own group
         $this->level = $this->relUserGroupsGroup->level;
         // copy the group home
         $this->group_home = $this->relUserGroupsGroup->home;
         //Получение параметров
         if ($this->params) {
             $this->params = unserialize($this->params);
         } else {
             $this->params = array_keys($this->ParamsFields);
         }
         // get the user readable home
         $home_array = UserGroupsAccess::homeList();
         if ($this->home) {
             $this->readable_home = isset($home_array[$this->home]) ? $home_array[$this->home] : $this->home;
         } else {
             $this->readable_home = isset($home_array[$this->group_home]) ? $home_array[$this->group_home] . ' - <i><b>Inherited from Group</b></i>' : $this->group_home;
         }
     }
     parent::afterFind();
 }
 /**
  * parameters preparation after a select is executed
  */
 public function afterFind()
 {
     // retrieve the group name
     $this->group_name = $this->relUserGroupsGroup->groupname;
     // retrieve the user access permission's arra
     if ((int) $this->id === self::ROOT) {
         $this->access = self::ROOT_ACCESS;
     } else {
         $this->access = UserGroupsAccess::findRules(UserGroupsAccess::USER, $this->id);
     }
     // copy the level of it's own group
     $this->level = $this->relUserGroupsGroup->level;
     // copy the group home
     $this->group_home = $this->relUserGroupsGroup->home;
     // get the user readable home
     $home_array = UserGroupsAccess::homeList();
     if ($this->home) {
         $this->readable_home = isset($home_array[$this->home]) ? $home_array[$this->home] : $this->home;
     } else {
         $this->readable_home = isset($home_array[$this->group_home]) ? $home_array[$this->group_home] . ' - <i><b>Inherited from Group</b></i>' : $this->group_home;
     }
     parent::afterFind();
 }
예제 #3
0
	<div class="form">

	<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'user-groups-misc-form', 'enableAjaxValidation' => true, 'enableClientValidation' => true));
?>
		<p class="note">Fields with <span class="required">*</span> are required.</p>

		<?php 
if (UserGroupsConfiguration::findRule('personal_home') || Yii::app()->user->pbac(array('user.admin', 'admin.admin'))) {
    ?>
		<div class="row">
			<?php 
    echo $form->labelEx($miscModel, 'home');
    ?>
			<?php 
    $home_lists = UserGroupsAccess::homeList();
    array_unshift($home_lists, Yii::t('userGroupsModule.admin', 'Group Home: {home}', array('{home}' => $miscModel->relUserGroupsGroup->home)));
    ?>
			<?php 
    echo $form->dropDownList($miscModel, 'home', $home_lists);
    ?>
			<?php 
    echo $form->error($miscModel, 'home');
    ?>
		</div>
		<?php 
}
?>
		<div class="row">
			<?php 
echo $form->labelEx($miscModel, 'email');