Example #1
0
 /**
  * Special Ban a user.
  */
 public function banUser($userId, $bans)
 {
     $user = $this->get($userId, false);
     if (empty($user)) {
         return 'Invalid user id.';
     }
     $this->db->update(array('_id' => $this->_toMongoId($userId)), array('$set' => array('bans' => $bans)));
     $this->clearCache($userId);
     // We need to permeate an active session!
     $key = 'hts_user_' . $user['username'];
     if (apc_exists($key)) {
         Session::setExternalVars(apc_fetch($key), array('bans' => $bans));
     }
     return $user;
 }