Beispiel #1
0
 public function initialize()
 {
     parent::initialize();
     if (empty($this->scriptProperties['board'])) {
         return $this->failure($this->modx->lexicon('discuss.usergroup_err_ns'));
     }
     $this->board = $this->modx->getObject('disBoard', $this->scriptProperties['board']);
     return true;
 }
Beispiel #2
0
 public function initialize()
 {
     parent::initialize();
     $this->disUser = $this->modx->getObject('disUser', $this->scriptProperties['user']);
     if (empty($this->disUser)) {
         return $this->failure($this->modx->lexicon('discuss.user_err_nf'));
     }
     $this->user = $this->disUser->getOne('User');
     return true;
 }
Beispiel #3
0
 public function initialize()
 {
     parent::initialize();
     if (empty($this->scriptProperties['id'])) {
         return $this->failure($this->modx->lexicon('discuss.usergroup_err_ns'));
     }
     $this->profile = $this->modx->getObject('disUserGroupProfile', array('usergroup' => $this->scriptProperties['id']));
     if (empty($this->profile)) {
         $this->userGroup = $this->modx->getObject('modUserGroup', $this->scriptProperties['id']);
         if (empty($this->userGroup)) {
             return $this->modx->error->failure($this->modx->lexicon('discuss.usergroup_err_nf', array('id' => $this->scriptProperties['id'])));
         }
         $this->profile = $this->modx->newObject('disUserGroupProfile');
         $this->profile->set('usergroup', $this->scriptProperties['id']);
         $this->profile->save();
     } else {
         $this->userGroup = $this->profile->getOne('UserGroup');
     }
     return true;
 }
Beispiel #4
0
 public function initialize()
 {
     parent::initialize();
     return true;
 }