Example #1
0
 /**
  * Enable/disable an account and set `time_disabled` and `active`
  *
  * Deleted accounts are not allowed to enable/disable.
  *
  * Only disabled account can be enabled, set `active` to true
  * and reset `time_disabled`; only enabled account can be disabled,
  * set `active` to false and set `time_disabled`.
  *
  * @param int   $uid
  * @param bool  $flag
  *
  * @return bool|null   Null for no-action
  */
 public function enableAccount($uid, $flag = true)
 {
     return parent::enableAccount($uid, $flag);
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function getRole($uid, $section = '')
 {
     $section = $section ?: Pi::engine()->application()->getSection();
     $roles = parent::getRole($uid, $section);
     if ($uid && 'front' == $section) {
         if (!in_array('member', $roles)) {
             $roles[] = 'member';
         }
     }
     return $roles;
 }