/** * Removes Group from the list stored in the session * * @param mixed group_arg String containing group id, * or array containing list of groups to delete */ function deleteGroup($group_arg) { $this->foowd->track('smdoc_group->deleteGroup', $group_arg); $session_groups = new input_session('user_groups', REGEX_GROUP); $changed = $this->_deleteGroup($session_groups->value, $group_arg); if ($changed) { $session_groups->set($session_groups->value); } $this->foowd->track(); return $changed; }
/** * Get list of workspaces within system. * * @return array Returns an array of workspace titles indexed by workspaceid. */ function getWorkspaceList() { $session_wklist = new input_session('workspaceList', NULL); if (isset($session_wklist->value)) { return $session_wklist->value; } $workspaceArray = array(0 => $this->config_settings['workspace']['workspace_base_name']); $where['OR'][] = array('index' => 'classid', 'op' => '=', 'value' => WORKSPACE_CLASS_ID); $where['OR'][] = array('index' => 'classid', 'op' => '=', 'value' => TRANSLATION_CLASS_ID); $indices = array('objectid', 'title'); $workspaces = $this->getObjList($indices, NULL, $where, 'title', NULL, FALSE, FALSE); foreach ($workspaces as $workspace) { $workspaceArray[$workspace['objectid']] = htmlspecialchars($workspace['title']); } $session_wklist->set($workspaceArray); return $session_wklist->value; }
/** * Retrieve given language. * if objectid is NULL, return array containing all languages * * @static * @param smdoc $foowd Reference to the foowd environment object. * @param int $objectid Specific translation to retrieve. * @return specified language string, or array of all languages. */ function getLanguage(&$foowd, $objectid = FALSE) { $session_langs = new input_session('languages', NULL); if (!isset($session_langs->value)) { smdoc_translation::initialize($foowd); $session_langs->refresh(); } if ($objectid === FALSE) { return $session_langs->value; } if (isset($session_langs->value[$objectid])) { return $session_langs->value[$objectid]; } else { return NULL; } }
/** * Log out the user. * * @static * @param smdoc $foowd Reference to the foowd environment object. * @param string authType The type of user authentication to use. * @return int 0 = cookie logged out successfully<br /> * 1 = http logged out successfully<br /> * 2 = ip auth, can not log out<br /> * 3 = user already logged out<br /> * 4 = http log out failed due to browser<br /> */ function logout(&$foowd) { if ($foowd->user->isAnonymous()) { return 3; } // user already logged out $foowd->user = base_user::fetchAnonymousUser($foowd); $session_userinfo = new input_session('userinfo', NULL, NULL, true); $session_userinfo->set(NULL); return 0; // logged out successfully }