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); } }
/** * 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%">'; }
/** * 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; }
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); }
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(); } }
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 : '')); } } }
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) }
/** * 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; }
/** * 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); } }
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); } }
/** * 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; }
/** * 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; }
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; }
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); }
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; }
function frs_header($params) { global $group_id, $HTML, $sys_use_frs; /* Does this site use FRS? */ if (!$sys_use_frs) { exit_disabled(); } $project =& group_get_object($group_id); if (!$project || !is_object($project)) { exit_no_group(); } $params['toptab'] = 'frs'; $params['group'] = $group_id; site_project_header($params); if (session_loggedin()) { $perm =& $project->getPermission(session_get_user()); if ($perm && is_object($perm) && !$perm->isError() && $perm->isReleaseTechnician()) { echo $HTML->subMenu(array(_('Files'), _('Admin')), array('/frs/?group_id=' . $group_id, '/frs/admin/?group_id=' . $group_id)); } } }
/** * GForge Mailing Lists Facility * * Portions Copyright 1999-2001 (c) VA Linux Systems * The rest Copyright 2003 (c) Guillaume Smet * * @version $Id$ * */ function mail_header($params) { global $HTML, $group_id; if ($group_id) { //required for site_project_header $params['group'] = $group_id; $params['toptab'] = 'mail'; $project =& group_get_object($group_id); if ($project && is_object($project)) { if (!$project->usesMail()) { exit_error(_('Error'), _('This Project Has Turned Off The Mailing Lists')); } } site_project_header($params); if (session_loggedin()) { $perm =& $project->getPermission(session_get_user()); if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) { echo $HTML->subMenu(array(_('Admin')), array('/mail/admin/?group_id=' . $group_id)); } } } else { exit_no_group(); } }
/** * create - use this function to create a new message in the database. * * @param string The subject of the message. * @param string The body of the message. * @param int The thread_id of the message, if known. * @param int The message_id of the parent message, if any. * @param boolean Whether the message has an attach associated. Defaults to false * @return boolean success. */ function create($subject, $body, $thread_id = '', $is_followup_to = '', $has_attach = false) { if (!$body || !$subject) { $this->setError(_('Must Include A Message Body And Subject')); return false; } if (!$this->Forum->userCanPost()) { $this->setPermissionDeniedError(); return false; } if (!session_loggedin()) { $user_id = 100; } else { $user_id = user_getid(); } if ($is_followup_to) { $ParentMessage = new ForumMessage($this->Forum, $is_followup_to); if (!$ParentMessage || !is_object($ParentMessage)) { $this->setError("ForumMessage::create()" . _('ForumMessage::create() No Valid ParentMessage Object')); return false; } if ($ParentMessage->isError()) { $this->setError('ForumMessage::create() ' . $ParentMessage->getErrorMessage()); return false; } } if (!$is_followup_to) { $is_followup_to = 0; } //see if that message has been posted already for all the idiots that double-post //we shouldn't need this, the double post checker functions solve this issue now /*$res3=db_query("SELECT * FROM forum WHERE is_followup_to='$is_followup_to' AND body='". htmlspecialchars($body) ."' AND subject='". htmlspecialchars($subject) ."' AND group_forum_id='". $this->Forum->getId() ."' AND posted_by='$user_id'"); if (db_numrows($res3) > 0) { //already posted this message $this->setError(_('You appear to be double-posting this message, since it has the same subject and followup information as a prior post.')); return false; } else { echo db_error(); }*/ db_begin(); //now we check the moderation status of the forum and act accordingly $mod_level = $this->Forum->GetModerationLevel(); switch ($mod_level) { case 0: //no moderation return $this->insertmsg($subject, $body, $thread_id, $is_followup_to, $user_id, $has_attach); case 1: //moderation for anonymous & non project users if ($this->Forum->userIsModLvl1()) { return $this->insertmoderated($subject, $body, $thread_id, $is_followup_to, $user_id); } else { return $this->insertmsg($subject, $body, $thread_id, $is_followup_to, $user_id, $has_attach); } case 2: //moderation for anyone who can post (even project members). admins can always post... if ($this->Forum->userIsModLvl2()) { return $this->insertmoderated($subject, $body, $thread_id, $is_followup_to, $user_id); } else { return $this->insertmsg($subject, $body, $thread_id, $is_followup_to, $user_id, $has_attach); } } }
/** * header() - "steel theme" top of page * * @param array Header parameters array */ function header($params) { global $sys_name; $this->headerStart($params); ?> <link rel="stylesheet" type="text/css" href="<?php echo util_make_url('/themes/osx/css/theme.css'); ?> " /> <body> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><a href="<?php echo util_make_url('/'); ?> " onmouseover="imgOver('logo')" onmouseout="imgOff('logo')"><img name="logo" border="0" height="60" width="180" src="<?php echo $this->imgroot . 'logo.png'; ?> " alt="GForge Logo" /></a></td> <td><?php echo $this->searchBox(); ?> </td> <td style="text-align:right"><?php if (session_loggedin()) { ?> <b><?php echo util_make_link('/account/logout.php', _('Log Out')); ?> </b><br /> <b><?php echo util_make_link('/account/', _('My Account')); ?> </b><?php } else { ?> <b><?php echo util_make_link('/account/login.php', _('Log In')); ?> </b><br /> <b><?php echo util_make_link('/account/register.php', _('New Account')); ?> </b><?php } $params['template'] = '<br/><b>{menu}</b>'; plugin_hook('headermenu', $params); ?> </td> <td> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td colspan="3"> <?php echo $this->outerTabs($params); ?> </td> <td> </td> </tr> <tr> <td> </td> <td valign="top" width="99%" colspan="3"> <!-- Inner Tabs / Shell --> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if (isset($params['group']) && $params['group']) { ?> <tr> <td> </td> <td> <?php echo $this->projectTabs($params['toptab'], $params['group']); ?> </td> <td> </td> </tr> <?php } ?> <tr> <td><img src="<?php echo $this->imgroot; ?> clear.png" width="99%" height="10" alt="" /></td> </tr> <tr> <td><img src="<?php echo $this->imgroot; ?> clear.png" width="10" height="1" alt="" /></td> <td valign="top" width="99%"> <?php }
* @version $Id$ */ /* Project/Task Manager By Tim Perdue, Sourceforge, 11/99 Heavy rewrite by Tim Perdue April 2000 Total rewrite in OO and GForge coding guidelines 12/2002 by Tim Perdue */ require_once '../../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'pm/include/ProjectGroupHTML.class.php'; require_once $gfcommon . 'pm/ProjectGroupFactory.class.php'; require_once $gfcommon . 'pm/ProjectCategory.class.php'; if (!session_loggedin()) { exit_not_logged_in(); } $group_id = getIntFromRequest('group_id'); $group_project_id = getIntFromRequest('group_project_id'); if (!$group_id) { exit_no_group(); } $g =& group_get_object($group_id); if (!$g || !is_object($g)) { exit_no_group(); } elseif ($g->isError()) { exit_error('Error', $g->getErrorMessage()); } $perm =& $g->getPermission(session_get_user()); $update_cat = getStringFromRequest('update_cat');
/** * create - use this function to create a new entry in the database. * * @param string The filename of this document. Can be a URL. * @param string The filetype of this document. If filename is URL, this should be 'URL'; * @param string The contents of this document (should be addslashes()'d before entry). * @param int The doc_group id of the doc_groups table. * @param string The title of this document. * @param int The language id of the supported_languages table. * @param string The description of this document. * @return boolean success. */ function create($filename, $filetype, $data, $doc_group, $title, $language_id, $description) { if (strlen($title) < 5) { $this->setError(_('Title Must Be At Least 5 Characters')); return false; } if (strlen($description) < 10) { $this->setError(_('Document Description Must Be At Least 10 Characters')); return false; } /* $perm =& $this->Group->getPermission( session_get_user() ); if (!$perm || !is_object($perm) || !$perm->isDocEditor()) { $this->setPermissionDeniedError(); return false; } */ $user_id = session_loggedin() ? user_getid() : 100; $doc_initstatus = '3'; // If Editor - uploaded Documents are ACTIVE if (session_loggedin()) { $perm =& $this->Group->getPermission(session_get_user()); if ($perm && is_object($perm) && $perm->isDocEditor()) { $doc_initstatus = '1'; } } // If $filetype is "text/plain", $body convert UTF-8 encoding. if (strcasecmp($filetype, "text/plain") === 0 && function_exists('mb_convert_encoding') && function_exists('mb_detect_encoding')) { $data = mb_convert_encoding($data, 'UTF-8', mb_detect_encoding($data)); } $data1 = $data; // key words for in-document search $kw = new Parsedata($this->engine_path); $kwords = $kw->get_parse_data(stripslashes($data1), htmlspecialchars($title1), htmlspecialchars($description), $filetype); // $kwords = ""; $filesize = strlen($data); $sql = "INSERT INTO doc_data (group_id,title,description,createdate,doc_group,\n\t\t\tstateid,language_id,filename,filetype,filesize,data,data_words,created_by)\n\t\t\tVALUES ('" . $this->Group->getId() . "',\n\t\t\t'" . htmlspecialchars($title) . "',\n\t\t\t'" . htmlspecialchars($description) . "',\n\t\t\t'" . time() . "',\n\t\t\t'{$doc_group}',\n\t\t\t'{$doc_initstatus}',\n\t\t\t'{$language_id}',\n\t\t\t'{$filename}',\n\t\t\t'{$filetype}',\n\t\t\t'{$filesize}',\n\t\t\t'" . base64_encode(stripslashes($data)) . "',\n\t\t\t'{$kwords}',\n\t\t\t'{$user_id}')"; db_begin(); $result = db_query($sql); if (!$result) { $this->setError('Error Adding Document: ' . db_error()); db_rollback(); return false; } $docid = db_insertid($result, 'doc_data', 'docid'); if (!$this->fetchData($docid)) { db_rollback(); return false; } $this->sendNotice(true); db_commit(); return true; }
/** * setup - call this function before getThreaded/nested/etc to set up the user preferences. * * @param int The number of rows to skip. * @param string The style of forum, whether it's nested, ultimate, etc. * @param int The maximum number of rows to return. * @param int Whether to set these prefs into the database - use "custom". */ function setup($offset, $style, $max_rows, $set) { //echo "<br />offset: $offset| style: $style|max_rows: $max_rows|set: $set+"; if (!$offset || $offset < 0) { $this->offset = 0; } else { $this->offset = $offset; } if (!$style || $style != 'ultimate' && $style != 'flat' && $style != 'nested' && $style != 'threaded') { $style = 'ultimate'; } if (!$max_rows || $max_rows < 5) { $max_rows = 25; } if (session_loggedin()) { $u =& session_get_user(); $_pref = $style . '|' . $max_rows; if ($set == 'custom') { if ($u->getPreference('forum_style')) { if ($_pref == $u->getPreference('forum_style')) { //pref already stored } else { //set the pref $u->setPreference('forum_style', $_pref); } } else { //set the pref $u->setPreference('forum_style', $_pref); } } else { if ($u->getPreference('forum_style')) { $_pref_arr = explode('|', $u->getPreference('forum_style')); $style = $_pref_arr[0]; $max_rows = $_pref_arr[1]; } else { //no saved pref and we're not setting //one because this is all default settings } } } if (!$style || $style != 'ultimate' && $style != 'flat' && $style != 'nested' && $style != 'threaded') { $style = 'ultimate'; } $this->style = $style; if (!$max_rows || $max_rows < 5) { $max_rows = 25; } $this->max_rows = $max_rows; }
/** * isMonitoring - Is the current user in the list of people monitoring this package. * * @return boolean is_monitoring. */ function isMonitoring() { if (!session_loggedin()) { return false; } $sql = "SELECT * FROM filemodule_monitor\n\t\t\tWHERE user_id='" . user_getid() . "'\n\t\t\tAND filemodule_id='" . $this->getID() . "';"; $result = db_query($sql); if (!$result || db_numrows($result) < 1) { return false; } else { return true; } }
/** * header() - "steel theme" top of page * * @param array Header parameters array */ function header($params) { if (!$params['title']) { $params['title'] = "FusionForge"; } else { $params['title'] = "FusionForge: " . $params['title']; } echo '<?xml version="1.0" encoding="utf-8"?>' . "\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo _('en'); ?> " lang="<?php echo _('en'); ?> "> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo $params['title']; ?> </title> <link rel="stylesheet" type="text/css" href="<?php echo util_make_url('/themes/lite/css/theme.css'); ?> " /> <script type="text/javascript"> <!-- function help_window(helpurl) { HelpWin = window.open( '<?php echo session_issecure() ? 'https://' . $GLOBALS['sys_default_domain'] : 'http://' . $GLOBALS['sys_default_domain']; ?> ' + helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400'); } // --> <?php plugin_hook("javascript", false); ?> </script> <?php if (_('default_font') != 'default_font') { $site_fonts = _('default_font'); } else { $site_fonts = 'helvetica'; } ?> <style type="text/css"> <!-- OL,UL,P,BODY,TD,TR,TH,FORM { font-family: <?php echo $site_fonts; ?> ; font-size:<?php echo $this->FONTSIZE; ?> ; color: <?php echo $this->FONTCOLOR_CONTENT; ?> ; } H1 { font-size: x-large; font-family: <?php echo $site_fonts; ?> ; } H2 { font-size: large; font-family: <?php echo $site_fonts; ?> ; } H3 { font-size: medium; font-family: <?php echo $site_fonts; ?> ; } H4 { font-size: small; font-family: <?php echo $site_fonts; ?> ; } H5 { font-size: x-small; font-family: <?php echo $site_fonts; ?> ; } H6 { font-size: xx-small; font-family: <?php echo $site_fonts; ?> ; } PRE,TT { font-family: courier,sans-serif } --> </style> </head> <body> <div class="header"> <table border="0px" width="100%" cellspacing="0px" cellpadding="0px" class="content"> <tr> <td><a href="<?php echo util_make_url('/'); ?> "><img src="/themes/lite/images/gforge_logo.png" border="0" alt="Gforge Logo" width="200px" /></a></td> <td align="right"><?php echo $this->searchBox(); ?> </td> <td align="right"><?php if (session_loggedin()) { echo util_make_link('/account/logout.php', _('Logout')); ?> <br /><?php echo util_make_link('/account/', _('My Account')); ?> <br /><?php } else { echo util_make_link('/account/login.php', _('Login')); ?> <br /><?php echo util_make_link('/account/register.php', _('New Account')); ?> <br /><?php } ?> </td> <td> </td> </tr> </table> </div> <div class="menu"> <?php echo $this->mainMenu($params); ?> <!-- Inner Tabs / Shell --> <?php if (isset($params['group']) && $params['group']) { ?> <div class="union_menu" > </div> <?php echo $this->projectTabs($params['toptab'], $params['group']); ?> <?php } ?> </div> <div class="content"> <?php }
* 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 */ require_once '../../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'survey/survey_utils.php'; $is_admin_page = 'y'; $group_id = getIntFromRequest('group_id'); $survey_id = getIntFromRequest('survey_id'); $customer_id = getIntFromRequest('customer_id'); survey_header(array('title' => _('Results'))); if (!session_loggedin() || !user_ismember($group_id, 'A')) { echo "<h1>" . _('Permission denied') . "</h1>"; survey_footer(array()); exit; } ?> <form action="none"> <?php /* Select this survey from the database */ $sql = "SELECT * FROM surveys WHERE survey_id='{$survey_id}' AND group_id='{$group_id}'"; $result = db_query($sql); echo "\n<h2>" . db_result($result, 0, "survey_title") . "</h2><p> </p>"; /*
/** * user_getname() - DEPRECATED; DO NOT USE! * * @param int The User ID * @deprecated * */ function user_getname($user_id = false) { // use current user if one is not passed in if (!$user_id) { if (session_loggedin()) { $user =& user_get_object(user_getid()); if ($user) { return $user->getUnixName(); } else { return 'Error getting user'; } } else { return 'No User Id'; } } else { $user =& user_get_object($user_id); if ($user) { return $user->getUnixName(); } else { return 'Invalid User'; } } }
echo $ath->getID(); ?> " METHOD="post" enctype="multipart/form-data"> <input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?> " /> <input type="hidden" name="func" value="postmod" /> <input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?> " /> <table width="80%"> <?php if (session_loggedin()) { ?> <tr> <td><?php if ($ah->isMonitoring()) { $img = "xmail16w.png"; $key = "stop_monitoring"; } else { $img = "mail16w.png"; $key = "monitor"; } echo ' <a href="index.php?group_id=' . $group_id . '&artifact_id=' . $ah->getID() . '&atid=' . $ath->getID() . '&func=monitor"><strong>' . html_image('ic/' . $img . '', '20', '20', array()) . ' ' . $key . '</strong></a>'; ?> <a href="javascript:help_window('<?php echo util_make_url('/help/tracker.php?helpname=monitor');
function quickNav() { if (!session_loggedin()) { return ''; } else { $res = db_query("SELECT * FROM groups NATURAL JOIN user_group WHERE user_id='" . user_getid() . "' ORDER BY group_name"); echo db_error(); if (!$res || db_numrows($res) < 1) { return ''; } else { $ret = ' <form name="quicknavform"> <select name="quicknav" onChange="location.href=document.quicknavform.quicknav.value">'; $ret .= ' <option value="">' . _('Quick Jump To...') . '</option>'; for ($i = 0; $i < db_numrows($res); $i++) { $ret .= ' <option value="' . util_make_url_g(db_result($res, $i, 'unix_group_name'), db_result($res, $i, 'group_id')) . '">' . db_result($res, $i, 'group_name') . '</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A') { $ret .= ' <option value="' . util_make_url('/project/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } //tracker if (db_result($res, $i, 'use_tracker')) { $ret .= ' <option value="' . util_make_url('/tracker/?group_id=' . db_result($res, $i, 'group_id')) . '"> Tracker</option>'; if (db_result($res, $i, 'admin_flags') || db_result($res, $i, 'artifact_flags')) { $ret .= ' <option value="' . util_make_url('/tracker/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //task mgr if (db_result($res, $i, 'use_pm')) { $ret .= ' <option value="' . util_make_url('/pm/?group_id=' . db_result($res, $i, 'group_id')) . '"> Task Manager</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A' || db_result($res, $i, 'project_flags')) { $ret .= ' <option value="' . util_make_url('/pm/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //FRS if (db_result($res, $i, 'use_frs')) { $ret .= ' <option value="' . util_make_url('/frs/?group_id=' . db_result($res, $i, 'group_id')) . '"> Files</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A' || db_result($res, $i, 'release_flags')) { $ret .= ' <option value="' . util_make_url('/frs/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //SCM if (db_result($res, $i, 'use_scm')) { $ret .= ' <option value="' . util_make_url('/scm/?group_id=' . db_result($res, $i, 'group_id')) . '"> SCM</option>'; /*if (db_result($res,$i,'admin_flags') || db_result($res,$i,'project_flags')) { $ret .= ' <option value="'.util_make_url('/pm/admin/?group_id='.db_result($res,$i,'group_id')).'"> Admin</option>'; } */ } //forum if (db_result($res, $i, 'use_forum')) { $ret .= ' <option value="' . util_make_url('/forum/?group_id=' . db_result($res, $i, 'group_id')) . '"> Forum</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A' || db_result($res, $i, 'forum_flags')) { $ret .= ' <option value="' . util_make_url('/forum/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //mail if (db_result($res, $i, 'use_mail')) { $ret .= ' <option value="' . util_make_url('/mail/?group_id=' . db_result($res, $i, 'group_id')) . '"> Lists</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A') { $ret .= ' <option value="' . util_make_url('/mail/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //doc if (db_result($res, $i, 'use_docman')) { $ret .= ' <option value="' . util_make_url('/docman/?group_id=' . db_result($res, $i, 'group_id')) . '"> Docs</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A' || db_result($res, $i, 'doc_flags')) { $ret .= ' <option value="' . util_make_url('/docman/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //news if (db_result($res, $i, 'use_news')) { $ret .= ' <option value="' . util_make_url('/news/?group_id=' . db_result($res, $i, 'group_id')) . '"> News</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A') { $ret .= ' <option value="' . util_make_url('/news/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } //survey if (db_result($res, $i, 'use_survey')) { $ret .= ' <option value="' . util_make_url('/survey/?group_id=' . db_result($res, $i, 'group_id')) . '"> Surveys</option>'; if (trim(db_result($res, $i, 'admin_flags')) == 'A') { $ret .= ' <option value="' . util_make_url('/survey/admin/?group_id=' . db_result($res, $i, 'group_id')) . '"> Admin</option>'; } } } $ret .= ' </select> </form>'; } } return $ret; }
function get($name) { // get e-mail address from FusionForge if (FUSIONFORGE && session_loggedin()) { $user = session_get_user(); return $user->getEmail(); } else { parent::get($name); } }
/** * makeDefault - set this as the default query * * @return boolean success. */ function makeDefault() { if (!session_loggedin()) { $this->setError('Must Be Logged In'); return false; } $usr =& session_get_user(); return $usr->setPreference('art_query' . $this->ArtifactType->getID(), $this->getID()); }