/** * Clear user cached info for given userids. * There's currently cached info in several places (vB_Session, vB_User and vB_Cache implementations) * this makes sure they all properly cleared. * * @param array List of users to clear cache. * * @param bool Cache was cleared or not. **/ public function clearUserInfo($userids) { if (empty($userids) or !is_array($userids)) { return false; } $events = array(); $userids = array_unique($userids); $session = vB::getCurrentSession(); $currentuser = $session->get('userid'); $updatecurrent = false; foreach ($userids as $userid) { // update current user? if ($currentuser == $userid) { $updatecurrent = true; } vB_User::clearUsersCache($userid); $events[] = 'userChg_' . $userid; } vB_Cache::allCacheEvent($events); if ($updatecurrent) { $session->clearUserInfo(); } return true; }