本文整理汇总了PHP中session_loggedin函数的典型用法代码示例。如果您正苦于以下问题:PHP session_loggedin函数的具体用法?PHP session_loggedin怎么用?PHP session_loggedin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_loggedin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: news_header
function news_header($params)
{
global $HTML, $group_id, $news_name, $news_id, $sys_news_group, $sys_use_news;
if (!$sys_use_news) {
exit_disabled();
}
$params['toptab'] = 'news';
$params['group'] = $group_id;
/*
Show horizontal links
*/
if ($group_id && $group_id != $sys_news_group) {
site_project_header($params);
} else {
$HTML->header($params);
}
if ($group_id && $group_id != $sys_news_group) {
$menu_texts = array();
$menu_links = array();
$menu_texts[] = _('Submit');
$menu_links[] = '/news/submit.php?group_id=' . $group_id;
if (session_loggedin()) {
$project =& group_get_object($params['group']);
if ($project && is_object($project) && !$project->isError()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
$menu_texts[] = _('Admin');
$menu_links[] = '/news/admin/?group_id=' . $group_id;
}
}
}
echo $HTML->subMenu($menu_texts, $menu_links);
}
}
示例2: scm_header
/**
* GForge SCM Library
*
* Copyright 2004 (c) GForge LLC
*
* @version $Id$
* @author Tim Perdue tim@gforge.org
* @date 2005-04-16
*
* This file is part of GForge.
*
* GForge is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function scm_header($params)
{
global $HTML, $sys_use_scm;
if (!$sys_use_scm) {
exit_disabled();
}
$project =& group_get_object($params['group']);
if (!$project || !is_object($project)) {
exit_error('Error', 'Could Not Get Project');
} elseif ($project->isError()) {
exit_error('Error', $project->getErrorMessage());
}
if (!$project->usesSCM()) {
exit_error('Error', _('Error - This project has turned off SCM.'));
}
site_project_header(array('title' => _('SCM Repository'), 'group' => $params['group'], 'toptab' => 'scm'));
/*
Show horizontal links
*/
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
echo $HTML->subMenu(array(_('SCM'), _('Admin'), _('Reporting')), array('/scm/?group_id=' . $params['group'], '/scm/admin/?group_id=' . $params['group'], '/scm/reporting/?group_id=' . $params['group']));
}
}
echo '<div style="width:99%">';
}
示例3: IN
/**
* getProjectGroups - get an array of ProjectGroup objects.
*
* @return array The array of ProjectGroups.
*/
function &getProjectGroups()
{
if ($this->projectGroups) {
return $this->projectGroups;
}
if (session_loggedin()) {
$perm =& $this->Group->getPermission(session_get_user());
if (!$perm || !is_object($perm) || !$perm->isMember()) {
$public_flag = '=1';
$exists = '';
} else {
$public_flag = '<3';
if ($perm->isPMAdmin()) {
$exists = '';
} else {
$exists = " AND group_project_id IN (SELECT role_setting.ref_id\n\t\t\t\t\tFROM role_setting, user_group\n\t\t\t\t\tWHERE role_setting.value::integer >= 0\n AND role_setting.section_name = 'pm'\n AND role_setting.ref_id=project_group_list_vw.group_project_id\n \n \t\t\t\t\t AND user_group.role_id = role_setting.role_id\n\t\t\t\t\t AND user_group.user_id='" . user_getid() . "') ";
}
}
} else {
$public_flag = '=1';
$exists = '';
}
$sql = "SELECT *\n\t\t\tFROM project_group_list_vw\n\t\t\tWHERE group_id='" . $this->Group->getID() . "' \n\t\t\tAND is_public {$public_flag} {$exists}\n\t\t\tORDER BY group_project_id;";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$this->setError(_('No ProjectGroups Found') . db_error());
$this->projectGroups = NULL;
} else {
while ($arr = db_fetch_array($result)) {
$this->projectGroups[] = new ProjectGroup($this->Group, $arr['group_project_id'], $arr);
}
}
return $this->projectGroups;
}
示例4: header
function header($params)
{
global $DOCUMENT_ROOT, $HTML, $group_id;
use_javascript('/js/sortable.js');
html_use_jquery();
$params['toptab'] = 'taskboard';
$params['group'] = $group_id;
$labels[] = _("View Taskboard");
$links[] = '/plugins/taskboard/index.php?group_id=' . $group_id;
if (session_loggedin()) {
if (forge_check_perm('tracker', $this->getID(), 'manager')) {
$labels[] = _('Administration');
$links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id;
$action = getStringFromRequest('action');
if ($action == 'edit_column') {
$labels[] = _('Configure Columns');
$links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id . '&action=columns';
$column_id = getStringFromRequest('column_id', '');
if ($column_id) {
$labels[] = _('Delete Column');
$links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id . '&action=delete_column&column_id=' . $column_id;
}
}
}
}
$params['submenu'] = $HTML->subMenu($labels, $links);
site_project_header($params);
}
示例5: doc_droplist_count
function doc_droplist_count($l_group_id, $language_id, $g)
{
if (session_loggedin()) {
$perm =& $g->getPermission(session_get_user());
if (!$perm || !is_object($perm) || !$perm->isMember()) {
$public_flag = 'AND dd.stateid=1';
} else {
$public_flag = 'AND dd.stateid IN (1,4,5)';
}
} else {
$public_flag = 'AND dd.stateid=1';
}
$query = "select dd.language_id, sl.name, count(*) as count\n\t\t from doc_groups as dg, doc_data as dd, supported_languages as sl\n\t\t where dg.doc_group = dd.doc_group\n\t\t and dg.group_id = '{$l_group_id}'\n\t\t {$public_flag}\n\t\t and sl.language_id = dd.language_id\n\t\t group by dd.language_id,sl.name";
$gresult = db_query($query);
if (db_numrows($gresult) >= 1) {
print "<form name=\"langchoice\" action=\"index.php?group_id=" . $l_group_id . "\" method=\"post\"><table border=\"0\">" . " <tr><td valign=\"middle\"><strong>" . _('Language') . " </strong></td>" . " <td valign=\"middle\"><select name=\"language_id\">\n\n";
print "<option value=\"*\">" . _('All Languages') . " </option>";
while ($grow = db_fetch_array($gresult)) {
if ($language_id == $grow['language_id']) {
print "<option value=\"" . $grow['language_id'] . "\" selected=\"selected\">" . $grow['name'] . " (" . $grow['count'] . ") </option>";
} else {
print "<option value=\"" . $grow['language_id'] . "\">" . $grow['name'] . " (" . $grow['count'] . ") </option>";
}
}
print "</select></td><td valign=\"middle\"><input type=\"submit\" value=\"" . _('Go') . "\" /></td></tr></table></form>";
} else {
echo db_error();
}
}
示例6: header
function header()
{
global $HTML, $group_id, $group_public_name, $request, $project;
$pagename = $request->getArg('pagename');
$submenu = Template('navbar');
//group is private
if (!$project->isPublic()) {
//if it's a private group, you must be a member of that group
session_require_perm('project_read', $group_id);
}
//for dead projects must be member of admin project
if (!$project->isActive()) {
//only SF group can view non-active, non-holding groups
session_require_global_perm('forge_admin');
}
$HTML->header(array('title' => $group_public_name . ': ' . htmlspecialchars($pagename), 'group' => $group_id, 'toptab' => 'wiki', 'submenu' => $submenu->asXML()));
// Display a warning banner for internal users when the wiki is opened
// to external users.
if ($project->getIsExternal()) {
$external_user = false;
if (session_loggedin()) {
$user = session_get_user();
$external_user = $user->getIsExternal();
}
if (!$external_user) {
$page = $request->getPage();
if ($page->get('external')) {
$external_msg = _("This page is external.");
}
echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") . (isset($external_msg) ? ' ' . $external_msg : ''));
}
}
}
示例7: survey_header
function survey_header($params)
{
global $group_id, $is_admin_page, $HTML, $sys_use_survey;
if (!$sys_use_survey) {
exit_disabled();
}
$params['toptab'] = 'surveys';
$params['group'] = $group_id;
if ($project =& group_get_object($group_id)) {
if (!$project->usesSurvey()) {
exit_error(_('Error'), _('This Group Has Turned Off Surveys.'));
}
site_project_header($params);
if ($is_admin_page && $group_id) {
echo $HTML->subMenu(array(_('Surveys'), _('Admin'), _('Add Survey'), _('Edit Survey'), _('Add Questions'), _('Edit Questions'), _('Show Results')), array('/survey/?group_id=' . $group_id, '/survey/admin/?group_id=' . $group_id, '/survey/admin/add_survey.php?group_id=' . $group_id, '/survey/admin/edit_survey.php?group_id=' . $group_id, '/survey/admin/add_question.php?group_id=' . $group_id, '/survey/admin/show_questions.php?group_id=' . $group_id, '/survey/admin/show_results.php?group_id=' . $group_id));
} else {
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
echo $HTML->subMenu(array(_('Admin')), array('/survey/admin/?group_id=' . $group_id));
}
}
}
}
// end if (valid group id)
}
示例8: isGroupMember
/**
* isGroupMember - returns if the logged in user is member of the current group
*
* @param int $groupId group id
*/
function isGroupMember($groupId)
{
$Group =& group_get_object($groupId);
if ($Group && is_object($Group) && !$Group->isError() && session_loggedin()) {
$perm =& $Group->getPermission(session_get_user());
if ($perm && is_object($perm) && $perm->isMember()) {
return true;
}
}
return false;
}
示例9: exit_permission_denied
/**
* exit_permission_denied() - Exit with permission denied error
*
* @param string $reason_descr
*/
function exit_permission_denied($reason_descr = '')
{
if (!session_loggedin()) {
exit_not_logged_in();
} else {
if (!$reason_descr) {
$reason_descr = _('This project\'s administrator will have to grant you permission to view this page.');
}
exit_error(_('Permission denied.'), $reason_descr);
}
}
示例10: pm_header
function pm_header($params)
{
// XXX ogi: What to do with these?
global $group_id, $is_pm_page, $words, $group_project_id, $HTML, $order, $pg, $sys_use_pm;
if (!$sys_use_pm) {
exit_disabled();
}
//required by site_project_header
$params['group'] = $group_id;
$params['toptab'] = 'pm';
//only projects can use the bug tracker, and only if they have it turned on
$project =& group_get_object($group_id);
if (!$project || !is_object($project)) {
exit_no_group();
}
if (!$project->usesPm()) {
exit_error(_('Error'), _('This Project Has Turned Off The Task Manager'));
}
site_project_header($params);
$labels = array();
$links = array();
if ($group_project_id) {
$labels[] = ($pg ? $pg->getName() . ': ' : '') . _('Browse tasks');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=browse';
if (session_loggedin()) {
$labels[] = _('Add task');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=addtask';
}
if ($group_project_id) {
$gantt_width = 820;
$gantt_height = 680;
$gantt_url = "/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=ganttpage";
$gantt_title = _('Gantt Chart');
$gantt_winopt = 'scrollbars=yes,resizable=yes,toolbar=no,height=' . $gantt_height . ',width=' . $gantt_width;
$labels[] = $gantt_title;
$links[] = $gantt_url . '" onclick="window.open(this.href, \'' . preg_replace('/\\s/', '_', $gantt_title) . '\', \'' . $gantt_winopt . '\'); return false;';
}
//upload/download as CSV files
$labels[] = _('Download as CSV');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=downloadcsv';
$labels[] = _('Upload CSV');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=uploadcsv';
}
if ($pg && is_object($pg) && $pg->userIsAdmin()) {
$labels[] = _('Reporting');
$links[] = '/pm/reporting/?group_id=' . $group_id;
$labels[] = _('Admin');
$links[] = '/pm/admin/?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&update_pg=1';
}
if (!empty($labels)) {
echo $HTML->subMenu($labels, $links);
}
}
示例11: IN
/**
* getForums - get an array of Forum objects for this Group.
*
* @return array The array of Forum objects.
*/
function &getForums()
{
global $sys_database_type;
if ($this->forums) {
return $this->forums;
}
if (session_loggedin()) {
$perm =& $this->Group->getPermission(session_get_user());
if (!$perm || !is_object($perm) || !$perm->isMember()) {
$public_flag = '=1';
$exists = '';
} else {
$public_flag = '<3';
if ($perm->isForumAdmin()) {
$exists = '';
} else {
$exists = " AND group_forum_id IN (SELECT role_setting.ref_id\n\t\t\t\t\tFROM role_setting, user_group\n\t\t\t\t\tWHERE role_setting.value::integer >= 0\n AND role_setting.section_name = 'forum'\n AND role_setting.ref_id=forum_group_list_vw.group_forum_id\n \n \t\t\t\t\t AND user_group.role_id = role_setting.role_id\n\t\t\t\t\t AND user_group.user_id='" . user_getid() . "') ";
}
}
} else {
$public_flag = '=1';
$exists = '';
}
if ($sys_database_type == "mysql") {
$sql = "SELECT fgl.*,\n\t\t\t\t\t(SELECT count(*) AS `count`\n\t\t\t\t\t\tFROM (\n\t\t\t\t\t\t\tSELECT DISTINCT group_forum_id, thread_id FROM forum\n\t\t\t\t\t\t) AS tmp\n\t\t\t\t\t\tWHERE tmp.group_forum_id = fgl.group_forum_id\n\t\t\t\t\t) AS threads \n\t\t\t\tFROM forum_group_list_vw AS fgl";
} else {
$sql = "SELECT *\n\t\t\t\tFROM forum_group_list_vw";
}
$sql .= "\n\t\t\tWHERE group_id='" . $this->Group->getID() . "' \n\t\t\tAND is_public {$public_flag} \n\t\t\t{$exists}\n\t\t\tORDER BY group_forum_id;";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result) {
$this->setError(_('Forum not found') . ' : ' . db_error());
$this->forums = false;
} else {
while ($arr = db_fetch_array($result)) {
$this->forums[] = new Forum($this->Group, $arr['group_forum_id'], $arr);
}
}
return $this->forums;
}
示例12: IN
/**
* getArtifactTypes - return an array of ArtifactType objects.
*
* @return array The array of ArtifactType objects.
*/
function &getArtifactTypes()
{
if ($this->ArtifactTypes) {
return $this->ArtifactTypes;
}
if (session_loggedin()) {
$perm =& $this->Group->getPermission(session_get_user());
if (!$perm || !is_object($perm) || !$perm->isMember()) {
$public_flag = '=1';
$exists = '';
} else {
$public_flag = '<3';
if ($perm->isArtifactAdmin()) {
$exists = '';
} else {
$exists = " AND group_artifact_id IN (SELECT role_setting.ref_id\n\t\t\t\t\tFROM role_setting, user_group\n\t\t\t\t\tWHERE role_setting.value::integer >= 0\n AND role_setting.section_name = 'tracker'\n AND role_setting.ref_id=artifact_group_list_vw.group_artifact_id\n \n \t\t\t\t\t AND user_group.role_id = role_setting.role_id\n\t\t\t\t\t AND user_group.user_id='" . user_getid() . "') ";
}
}
} else {
$public_flag = '=1';
$exists = '';
}
$sql = "SELECT * FROM artifact_group_list_vw\n\t\t\tWHERE group_id='" . $this->Group->getID() . "'\n\t\t\tAND is_public {$public_flag}\n\t\t\t{$exists}\n\t\t\tORDER BY group_artifact_id ASC";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$this->setError('None Found ' . db_error());
$this->ArtifactTypes = NULL;
} else {
while ($arr =& db_fetch_array($result)) {
$artifactType = new ArtifactType($this->Group, $arr['group_artifact_id'], $arr);
if ($artifactType->isError()) {
$this->setError($artifactType->getErrorMessage());
} else {
$this->ArtifactTypes[] = $artifactType;
}
}
}
return $this->ArtifactTypes;
}
示例13: userExists
function userExists()
{
global $group_id;
// Mapping (PhpWiki vs FusionForge) performed is:
// ANON for non logged or non member
// USER for member of the project.
// ADMIN for member having admin rights
if (session_loggedin()) {
// Get project object (if error => ANON)
$project =& group_get_object($group_id);
if (!$project || !is_object($project)) {
$this->_level = WIKIAUTH_ANON;
return false;
} elseif ($project->isError()) {
$this->_level = WIKIAUTH_ANON;
return false;
}
$member = false;
$user = session_get_user();
$perm =& $project->getPermission($user);
if (!$perm || !is_object($perm)) {
$this->_level = WIKIAUTH_ANON;
return false;
} elseif (!$perm->isError()) {
$member = $perm->isMember();
}
if ($member) {
$this->_userid = $user->getRealName();
$this->_is_external = $user->getIsExternal();
if ($perm->isAdmin()) {
$this->_level = WIKIAUTH_ADMIN;
} else {
$this->_level = WIKIAUTH_USER;
}
return $this;
}
}
$this->_level = WIKIAUTH_ANON;
return false;
}
示例14: header
function header($params)
{
global $HTML, $sys_use_tracker;
if (!$sys_use_tracker) {
exit_disabled();
}
$group_id = $this->Group->getID();
//required by new site_project_header
$params['group'] = $group_id;
$params['toptab'] = 'tracker';
$params['tabtext'] = $this->getName();
site_project_header($params);
$labels = array();
$links = array();
$labels[] = $this->getName() . ': ' . _('Browse');
$links[] = '/tracker/?func=browse&group_id=' . $group_id . '&atid=' . $this->getID();
$labels[] = _('Download .csv');
$links[] = '/tracker/?func=downloadcsv&group_id=' . $group_id . '&atid=' . $this->getID();
if ($this->allowsAnon() || session_loggedin()) {
$labels[] = _('Submit New');
$links[] = '/tracker/?func=add&group_id=' . $group_id . '&atid=' . $this->getID();
}
if (session_loggedin()) {
$labels[] = _('Reporting');
$links[] = '/tracker/reporting/?group_id=' . $group_id . '&atid=' . $this->getID();
if ($this->isMonitoring()) {
$labels[] = _('Stop Monitor');
} else {
$labels[] = _('Monitor');
}
$links[] = '/tracker/?group_id=' . $group_id . '&atid=' . $this->getID() . '&func=monitor';
if ($this->userIsAdmin()) {
$labels[] = _('Admin');
$links[] = '/tracker/admin/?group_id=' . $group_id . '&atid=' . $this->getID();
}
}
echo $HTML->subMenu($labels, $links);
}
示例15: getAvailableRoles
public function getAvailableRoles()
{
if ($this->_cached_available_roles != NULL) {
return $this->_cached_available_roles;
}
$this->_cached_available_roles = array();
$this->_cached_available_roles[] = RoleAnonymous::getInstance();
if (session_loggedin()) {
$this->_cached_available_roles[] = RoleLoggedIn::getInstance();
$user = session_get_user();
if (USE_PFO_RBAC) {
$res = db_query_params('SELECT role_id FROM pfo_user_role WHERE user_id=$1', array($user->getID()));
while ($arr = db_fetch_array($res)) {
$this->_cached_available_roles[] = $this->getRoleById($arr['role_id']);
}
} else {
$groups = $user->getGroups();
foreach ($groups as $g) {
$this->_cached_available_roles[] = $user->getRole($g);
}
}
}
$params = array();
$params['current_roles'] = $this->_cached_available_roles;
$params['new_roles'] = array();
plugin_hook_by_reference('get_extra_roles', $params);
foreach ($params['new_roles'] as $r) {
$this->addAvailableRole($r);
}
$params = array();
$params['current_roles'] = $this->_cached_available_roles;
$params['dropped_roles'] = array();
plugin_hook_by_reference('restrict_roles', $params);
foreach ($params['dropped_roles'] as $r) {
$this->dropAvailableRole($r);
}
return $this->_cached_available_roles;
}