function show_news_item($result, $i, $approved, $selectable) { global $HTML; echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '><td width="20%">'; if ($selectable) { echo '<input type="checkbox" ' . 'name="news_id[]" value="' . db_result($result, $i, 'id') . '" />'; } echo date(_('Y-m-d'), db_result($result, $i, 'post_date')) . '</td> <td width="45%">'; echo ' <a href="' . getStringFromServer('PHP_SELF') . '?approve=1&id=' . db_result($result, $i, 'id') . '">' . db_result($result, $i, 'summary') . '</a> </td> <td width="35%">' . util_make_link_g(db_result($result, $i, 'unix_group_name'), db_result($result, $i, 'group_id'), db_result($result, $i, 'group_name') . ' (' . db_result($result, $i, 'unix_group_name') . ')') . '</td> </tr>'; }
/** * viewcvs_execute() - Call to viewcvs.cgi and returned the output. * * @return String the output of the ViewCVS command. */ function viewcvs_execute($repos_name, $repos_type) { $request_uri = getStringFromServer('REQUEST_URI'); $query_string = getStringFromServer('QUERY_STRING'); $viewcvs_path = $GLOBALS['sys_urlroot'] . '/scm/viewvc'; // this is very important ... $path = getStringFromServer('PATH_INFO'); if ($path == '') { $path = getStringFromServer('ORIG_PATH_INFO'); } if ($path != '') { // hack: path must always end with / if ($path[strlen($path) - 1] != '/') { $path .= '/'; } } else { $path = '/'; } if ($repos_type == "cvs") { $repos_root = $GLOBALS['cvsdir_prefix'] . '/' . $repos_name; } else { if ($repos_type == "svn") { $repos_root = $GLOBALS['svndir_prefix'] . '/' . $repos_name; } else { die("Invalid repository type"); } } if (!is_dir($repos_root)) { $content = _('The repository for this project isn\'t created yet. It will be created in the next few minutes.'); return $content; } $query_string = str_replace('\\&', '&', make_arg_cmd_safe($query_string)); $query_string = str_replace('\\*', '*', $query_string); $path = str_replace('\\*', '*', make_arg_cmd_safe($path)); $command = 'HTTP_COOKIE="' . make_arg_cmd_safe(getStringFromServer('HTTP_COOKIE')) . '" ' . 'REMOTE_ADDR="' . make_arg_cmd_safe(getStringFromServer('REMOTE_ADDR')) . '" ' . 'QUERY_STRING="' . $query_string . '" ' . 'SERVER_SOFTWARE="' . make_arg_cmd_safe(getStringFromServer('SERVER_SOFTWARE')) . '" ' . 'SCRIPT_NAME="' . make_arg_cmd_safe(getStringFromServer('SCRIPT_NAME')) . '" ' . 'HTTP_USER_AGENT="' . make_arg_cmd_safe(getStringFromServer('HTTP_USER_AGENT')) . '" ' . 'HTTP_ACCEPT_ENCODING="' . make_arg_cmd_safe(getStringFromServer('HTTP_ACCEPT_ENCODING')) . '" ' . 'HTTP_ACCEPT_LANGUAGE="' . make_arg_cmd_safe(getStringFromServer('HTTP_ACCEPT_LANGUAGE')) . '" ' . 'PATH_INFO="' . $path . '" ' . 'PATH="' . make_arg_cmd_safe(getStringFromServer('PATH')) . '" ' . 'REPOSITORY_ROOT="' . make_arg_cmd_safe($repos_root) . '" ' . 'REPOSITORY_TYPE="' . $repos_type . '" ' . 'REPOSITORY_NAME="' . make_arg_cmd_safe($repos_name) . '" ' . 'HTTP_HOST="' . make_arg_cmd_safe(getStringFromServer('HTTP_HOST')) . '" ' . 'DOCROOT="/themes/' . $GLOBALS['sys_theme'] . '/viewvc" ' . $viewcvs_path . '/bin/cgi/viewvc.cgi 2>&1'; ob_start(); passthru($command); $content = ob_get_contents(); ob_end_clean(); return $content; }
/** * reports_header() - Show the reports header * * @param int The group ID * @param array Array of select box values * @param string The select box title * @param string Any additional HTML */ function reports_header($group_id, $vals, $titles, $html = '') { global $what; global $period; global $span; print '<form method="get" action="' . getStringFromServer('PHP_SELF') . '#b">'; print $html; print html_build_select_box_from_arrays($vals, $titles, 'what', $what, false); $periods = array('day' => 'Last day', 'week' => 'Last week'); $vals = array('day', 'week', 'month', 'year', 'lifespan'); $texts = array(_('Last day(s)'), _('Last week(s)'), _('Last month(s)'), _('Last year(s)'), _('Project lifespan')); if (!$period) { $period = "lifespan"; } print _('for'); print html_build_select_box_from_arrays(array('', '1', '4', '7', '12', '14', '30', '52'), array('', '1', '4', '7', '12', '14', '30', '52'), 'span', $span, false); print html_build_select_box_from_arrays($vals, $texts, 'period', $period, false); print "<input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\" />"; print ' <input type="submit" value="' . _('Show') . '" />'; print "</form>\n"; }
$GLOBALS['BROWSER_VER'] = 0; $GLOBALS['BROWSER_AGENT'] = 'OTHER'; } /* Determine platform */ if (strstr(getStringFromServer('HTTP_USER_AGENT'), 'Win')) { $GLOBALS['BROWSER_PLATFORM'] = 'Win'; } else { if (strstr(getStringFromServer('HTTP_USER_AGENT'), 'Mac')) { $GLOBALS['BROWSER_PLATFORM'] = 'Mac'; } else { if (strstr(getStringFromServer('HTTP_USER_AGENT'), 'Linux')) { $GLOBALS['BROWSER_PLATFORM'] = 'Linux'; } else { if (strstr(getStringFromServer('HTTP_USER_AGENT'), 'Unix')) { $GLOBALS['BROWSER_PLATFORM'] = 'Unix'; } else { $GLOBALS['BROWSER_PLATFORM'] = 'Other'; } } } } /* echo "\n\nAgent: ".getStringFromServer('HTTP_USER_AGENT'); echo "\nIE: ".browser_is_ie(); echo "\nMac: ".browser_is_mac(); echo "\nWindows: ".browser_is_windows(); echo "\nPlatform: ".browser_get_platform(); echo "\nVersion: ".browser_get_version(); echo "\nAgent: ".browser_get_agent();
<li> <a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&add_list=1">' . _('Add Mailing List') . '</a> </li> </ul>'; $mlCount = count($mlArray); if ($mlCount > 0) { $tableHeaders = array(_('Mailing list'), '', ''); echo $HTML->listTableTop($tableHeaders); for ($i = 0; $i < $mlCount; $i++) { $currentList =& $mlArray[$i]; if ($currentList->isError()) { echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '><td colspan="3">'; echo $currentList->getErrorMessage(); echo '</td></tr>'; } else { echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '><td width="60%">' . '<strong>' . $currentList->getName() . '</strong><br />' . htmlspecialchars($currentList->getDescription()) . '</td>' . '<td width="20%" style="text-align:center"><a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&group_list_id=' . $currentList->getID() . '&change_status=1">' . _('Update') . '</a></td>' . '<td width="20%" style="text-align:center">'; if ($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) { echo _('Not activated yet'); } else { echo '<a href="' . $currentList->getExternalAdminUrl() . '">' . _('Administrate') . '</a></td>'; } echo '</tr>'; } } echo $HTML->listTableBottom(); } mail_footer(array()); } } else { exit_no_group(); }
$res_db = db_query("\n\t\tSELECT *\n\t\tFROM prdb_dbs\n\t\tWHERE state=" . $dbstate . "\n\t\tORDER BY dbname\n\t"); while ($row_db = db_fetch_array($res_db)) { print '<li>' . util_make_link('/project/admin/database.php?group_id=' . $row_db['group_id'], $row_db['dbname']) . '</li>'; } print "</ul>"; } ?> <hr /> <h3><?php echo _('Add an already active database'); ?> </h3> <form name="madd" method="post" action="<?php echo getStringFromServer('PHP_SELF'); ?> "> <table> <tr> <td><?php echo _('Group Unix Name:'); echo utils_requiredField(); ?> </td> <td><input type="text" name="groupname" /></td> </tr> <tr>
*/ require_once 'env.inc.php'; require_once $gfwww . 'include/pre.php'; global $sys_show_source; if (!$sys_show_source) { exit_permission_denied(); } $file = getStringFromRequest('file'); if (!$file) { exit_error(_('Missing File Argument'), _('A file must be specified for this page.')); } if (strstr($file, '..')) { exit_error(_('Invalid File Argument'), _('The file argument is invalid.')); } $dir = dirname($file); // If this is a legal dir, then it is under the docroot, else use basename if ($dir) { $fname = getStringFromServer('DOCUMENT_ROOT') . $file; } else { $fname = basename($file); } if (!file_exists($fname) || @is_dir($fname)) { exit_error(_('File Not Found'), _('Cannot find specified file to display.')); } $HTML->header(array('title' => sprintf(_('Source of %1$s'), $file))); show_source($fname); $HTML->footer(array()); // Local Variables: // mode: php // c-file-style: "bsd" // End:
private function getExtraTabs() { include $GLOBALS['Language']->getContent('layout/extra_tabs', null, null, '.php'); if ($GLOBALS['sys_use_snippet'] != 0) { $selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/snippet/'); array_unshift($additional_tabs, array('link' => '/snippet/', 'title' => $GLOBALS['Language']->getText('menu', 'code_snippet'), 'selected' => $selected)); } return $additional_tabs; }
function outerTabs($params) { global $Language; $TABS_DIRS[] = '/'; $TABS_TITLES[] = $Language->getText('menu', 'home'); if (user_isloggedin()) { $TABS_DIRS[] = '/my/'; $TABS_TITLES[] = $Language->getText('menu', 'my_personal_page'); } if ($GLOBALS['sys_use_trove'] != 0) { $TABS_DIRS[] = '/softwaremap/'; $TABS_TITLES[] = $Language->getText('menu', 'projectree'); } if ($GLOBALS['sys_use_snippet'] != 0) { $TABS_DIRS[] = '/snippet/'; $TABS_TITLES[] = $Language->getText('menu', 'code_snippet'); } if (user_ismember(1, 'A')) { $TABS_DIRS[] = '/admin/'; $TABS_TITLES[] = $Language->getText('menu', 'admin'); } $TABS_DIRS[] = '/site/'; $TABS_TITLES[] = $Language->getText('include_layout', 'Help'); /* if (user_ismember($GLOBALS['sys_stats_group'])) { $TABS_DIRS[]='/reporting/'; $TABS_TITLES[]=$Language->getText('menu','reporting'); } */ $selected_top_tab = isset($params['selected_top_tab']) ? $params['selected_top_tab'] : ''; if (isset($params['group']) && $params['group']) { // get group info using the common result set $pm = ProjectManager::instance(); $project = $pm->getProject($params['group']); if ($project && is_object($project)) { if ($project->isError()) { } else { $selected = array_search("/softwaremap/", $TABS_DIRS); } } } else { if (strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/themes/') || strstr(getStringFromServer('REQUEST_URI'), '/account/')) { $selected = array_search("/my/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), 'softwaremap')) { $selected = array_search("/softwaremap/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/snippet/')) { $selected = array_search("/snippet/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/site/')) { $selected = array_search("/site/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/reporting/')) { $selected = array_search('/reporting/', $TABS_DIRS); } elseif ((strstr(getStringFromServer('REQUEST_URI'), '/admin/') || $selected_top_tab == 'admin') && user_ismember(1, 'A')) { $selected = array_search('/admin/', $TABS_DIRS); } elseif ($selected_top_tab && array_search($selected_top_tab, $TABS_DIRS) !== FALSE) { $selected = array_search($selected_top_tab, $TABS_DIRS); } else { $selected = 0; } } echo $this->tabGenerator($TABS_DIRS, $TABS_TITLES, false, $selected, null, '100%'); }
" /> <?php $theme_cssfile = $GLOBALS['sys_themeroot'] . $GLOBALS['sys_theme'] . '/css/theme.css'; if (file_exists($theme_cssfile)) { echo ' <link rel="stylesheet" type="text/css" href="' . util_make_url('/themes/' . $GLOBALS['sys_theme'] . '/css/theme.css') . '" /> '; } echo ' </head> <body> <h1>' . $feedback . '</h1> <table border="3" cellpadding="4" rules="groups" frame="box" width="100%" class="tablecontent"> <form action="' . getStringFromServer('PHP_SELF') . '?func=query&group_id=' . $group_id . '&atid=' . $ath->getID() . '" method="post"> <input type="hidden" name="form_key" value="' . form_generate_key() . '"> <tr> <td> <input type="submit" name="submit" value="' . _('Save Changes') . '" /> </td> <td>'; if (db_numrows($res) > 0) { echo html_build_select_box($res, 'query_id', $query_id, false) . ''; } echo ' </td> </tr> <tr class="tablecontent"> <td> <input type="radio" name="query_action" value="1" ' . (!$query_id ? 'checked' : '') . '>' . _('Name and Save Query') . '<br />';
// // Pending requests // echo $HTML->boxMiddle(_('Pending Requests')); $reqs =& get_group_join_requests($group); if (count($reqs) < 1) { echo _('No Pending Requests'); } else { for ($i = 0; $i < count($reqs); $i++) { $user =& user_get_object($reqs[$i]->getUserId()); if (!$user || !is_object($user)) { echo "Invalid User"; } ?> <form action="<?php echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id; ?> " method="post"> <input type="hidden" name="submit" value="y" /> <input type="hidden" name="form_userid" value="<?php echo $user->getId(); ?> " /> <tr><td><input type="hidden" name="form_unix_name" value="<?php echo $user->getUnixName(); ?> " /><?php echo util_make_link_u($user->getUnixName(), $user->getId(), $user->getRealName()); ?> </td> <td><?php
/** * exit_not_logged_in() - Exit with not logged in error */ function exit_not_logged_in() { //instead of a simple error page, now take them to the login page header("Location: " . util_make_url("/account/login.php?return_to=" . urlencode(getStringFromServer('REQUEST_URI')))); exit; }
function header($params) { global $Language; $this->generic_header($params); //themable someday? $site_fonts = 'verdana,arial,helvetica,sans-serif'; echo '<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" class="' . $this->getClassnamesForBodyTag($params) . '">'; echo $this->getOsdnNavBar(); echo html_blankimage(5, 100); ?> <br> <!-- start page body --> <div align="center"> <table cellpadding="0" cellspacing="0" border="0" width="97%"> <!-- First line with borders and corners --> <tr> <td background="<?php echo util_get_image_theme("upper_left_corner.png"); ?> " width="1%" height="26"><img src="<?php echo util_get_image_theme("upper_left_corner.png"); ?> " width="16" height="26" alt=" "></td> <td background="<?php echo util_get_image_theme("top_border.png"); ?> " align="left" colspan="3" width="99%"><a href="/"><img src="<?php echo util_get_image_theme("codex_banner_lc.png"); ?> " height="26" border="0" alt="<?php echo $GLOBALS['sys_name'] . ' ' . $Language->getText('include_layout', 'banner'); ?> "></a></td> <td><img src="<?php echo util_get_image_theme("upper_right_corner.png"); ?> " width="16" height="26" alt=" "></td> </tr> <!-- Second line with menus and content --> <tr> <td background="<?php echo util_get_image_theme("left_border.png"); ?> " align="left" valign="bottom" alt=""><img src="<?php echo util_get_image_theme("bottom_left_corner.png"); ?> " width="16" height="16" alt=""></td> <td colspan="3" > <!-- start main body cell --> <div align="left"> <table style=menus cellpadding="0" cellspacing="0" border="0" width="100%"> <tr valign="top"> <td class="menuframe"> <!-- VA Linux Stats Counter --> <?php if (!session_issecure()) { print '<IMG src="' . util_get_image_theme("clear.png") . '" width=140 height=1 alt="' . $Language->getText('include_layout', 'counter') . '"><BR>'; } else { print html_blankimage(1, 140) . '<br>'; } $main_body_class = ''; if (isset($params['toptab']) && is_string($params['toptab'])) { $main_body_class = 'service-' . $params['toptab']; } ?> <!-- Company Logo here --> <P> <?php print '<center><IMG src="' . util_get_image_theme("organization_logo.png") . '" alt="' . $GLOBALS['sys_org_name'] . ' ' . $Language->getText('include_layout', 'logo') . '"></center><BR>'; ?> <!-- menus --> <?php // html_blankimage(1,140); menu_print_sidebar($params); ?> <P> </TD> <td width="15" background="<?php echo util_get_image_theme("fade.png"); ?> " nowrap> </td> <td class="contenttable <?php echo $main_body_class; ?> "> <BR> <?php if (isset($params['group']) && $params['group']) { echo $this->project_tabs($params['toptab'], $params['group']); } else { if (strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/account/')) { $tabs = array(array('link' => '/my/', 'label' => $Language->getText('my_index', 'my_dashboard')), array('link' => '/account/', 'label' => $Language->getText('my_index', 'account_maintenance'))); echo '<hr SIZE="1" NoShade>'; foreach ($tabs as $tab) { $this->tab_entry($tab['link'], '', $tab['label'], strstr(getStringFromServer('REQUEST_URI'), '/my/') ? 0 : (strstr(getStringFromServer('REQUEST_URI'), '/account') ? 2 : 1), ''); } echo '<hr SIZE="1" NoShade>'; } } echo $this->getBreadCrumbs(); echo $this->getToolbar(); echo $this->_getFeedback(); $this->_feedback->display(); echo $this->getNotificationPlaceholder(); }
/** * ShowResultSet() - Show a generic result set * Very simple, plain way to show a generic result set * * @param int The result set ID * @param string The title of the result set * @param bool The option to turn URL's into links * @param bool The option to display headers * @param array The db field name -> label mapping * @param array Don't display these cols * */ function ShowResultSet($result, $title = '', $linkify = false, $displayHeaders = true, $headerMapping = array(), $excludedCols = array()) { global $group_id, $HTML; if ($result) { $rows = db_numrows($result); $cols = db_numfields($result); echo '<table border="0" width="100%">'; /* Create the headers */ $headersCellData = array(); $colsToKeep = array(); for ($i = 0; $i < $cols; $i++) { $fieldName = db_fieldname($result, $i); if (in_array($fieldName, $excludedCols)) { continue; } $colsToKeep[] = $i; if (isset($headerMapping[$fieldName])) { if (is_array($headerMapping[$fieldName])) { $headersCellData[] = $headerMapping[$fieldName]; } else { $headersCellData[] = array($headerMapping[$fieldName]); } } else { $headersCellData[] = array($fieldName); } } /* Create the title */ if (strlen($title) > 0) { $titleCellData = array(); $titleCellData[] = array($title, 'colspan="' . count($headersCellData) . '"'); echo $HTML->multiTableRow('', $titleCellData, TRUE); } /* Display the headers */ if ($displayHeaders) { echo $HTML->multiTableRow('', $headersCellData, TRUE); } /* Create the rows */ for ($j = 0; $j < $rows; $j++) { echo '<tr ' . $HTML->boxGetAltRowStyle($j) . '>'; for ($i = 0; $i < $cols; $i++) { if (in_array($i, $colsToKeep)) { if ($linkify && $i == 0) { $link = '<a href="' . getStringFromServer('PHP_SELF') . '?'; $linkend = '</a>'; if ($linkify == "bug_cat") { $link .= 'group_id=' . $group_id . '&bug_cat_mod=y&bug_cat_id=' . db_result($result, $j, 'bug_category_id') . '">'; } else { if ($linkify == "bug_group") { $link .= 'group_id=' . $group_id . '&bug_group_mod=y&bug_group_id=' . db_result($result, $j, 'bug_group_id') . '">'; } else { if ($linkify == "patch_cat") { $link .= 'group_id=' . $group_id . '&patch_cat_mod=y&patch_cat_id=' . db_result($result, $j, 'patch_category_id') . '">'; } else { if ($linkify == "support_cat") { $link .= 'group_id=' . $group_id . '&support_cat_mod=y&support_cat_id=' . db_result($result, $j, 'support_category_id') . '">'; } else { if ($linkify == "pm_project") { $link .= 'group_id=' . $group_id . '&project_cat_mod=y&project_cat_id=' . db_result($result, $j, 'group_project_id') . '">'; } else { $link = $linkend = ''; } } } } } } else { $link = $linkend = ''; } echo '<td>' . $link . db_result($result, $j, $i) . $linkend . '</td>'; } } echo '</tr>'; } echo '</table>'; } else { echo db_error(); } }
if ($ff->isError()) { echo '<h1>' . sprintf(_('No Forums Found For %1$s'), $g->getPublicName()) . '</h1>'; echo $ff->getErrorMessage(); forum_footer(array()); exit; } /* List the existing forums so they can be edited. */ for ($j = 0; $j < count($farr); $j++) { if (!is_object($farr[$j])) { //just skip it - this object should never have been placed here } elseif ($farr[$j]->isError()) { echo $farr[$j]->getErrorMessage(); } else { echo '<a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&change_status=1&group_forum_id=' . $farr[$j]->getID() . '">' . $farr[$j]->getName() . '</a><br />' . $farr[$j]->getDescription() . '<br /><a href="monitor.php?group_id=' . $group_id . '&group_forum_id=' . $farr[$j]->getID() . '">Monitoring Users</a><p>'; } } forum_footer(array()); } } } else { /* Not logged in or insufficient privileges */ if (!$group_id) { exit_no_group(); } else { exit_permission_denied(); } }
exit_error(_('Error'), $d->getErrorMessage()); } else { if ($type == 'editor') { //release the cookie for the document contents (should expire at the end of the session anyway) setcookie("gforgecurrentdocdata", "", time() - 3600); } Header('Location: ' . util_make_url('/docman/?group_id=' . $group_id . '&feedback=' . _('Document submitted sucessfully'))); exit; } } else { //if (getStringFromRequest('Option')) { //option was selected, proceed to show each one $option_selected = getStringFromRequest('option_selected'); docman_header(_('Document Manager: Submit New Documentation'), _('Project: %1$s')); echo '<p>' . _('<strong>Document Title</strong>: Refers to the relatively brief title of the document (e.g. How to use the download server)<br /><strong>Description:</strong> A brief description to be placed just under the title.') . '</p> <form name="adddata" action="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '" method="post" enctype="multipart/form-data"> <table border="0" width="75%"> <tr> <td> <strong>' . _('Document Title') . ' :</strong>' . utils_requiredField() . sprintf(_('(at least %1$s characters)'), 5) . '<br /> <input type="text" name="title" size="40" maxlength="255" /> </td> </tr> <tr> <td> <strong>' . _('Description') . ' :</strong>' . utils_requiredField() . sprintf(_('(at least %1$s characters)'), 10) . '<br /> <input type="text" name="description" size="50" maxlength="255" /> </td> </tr>'; echo '
function viewvc_utils_track_browsing($group_id, $type) { $query_string = getStringFromServer('QUERY_STRING'); $request_uri = getStringFromServer('REQUEST_URI'); if (strpos($query_string, "view=markup") !== FALSE || strpos($query_string, "view=auto") !== FALSE || strpos($request_uri, "*checkout*") !== FALSE || strpos($query_string, "annotate=") !== FALSE) { if ($type == 'svn') { $browse_column = 'svn_browse'; $table = 'group_svn_full_history'; } else { if ($type == 'cvs') { $browse_column = 'cvs_browse'; $table = 'group_cvs_full_history'; } } $user_id = user_getid(); $year = strftime("%Y"); $mon = strftime("%m"); $day = strftime("%d"); $db_day = $year . $mon . $day; $sql = "SELECT " . $browse_column . " FROM " . $table . " WHERE group_id = " . db_ei($group_id) . " AND user_id = " . $user_id . " AND day = '" . $db_day . "'"; $res = db_query($sql); if (db_numrows($res) > 0) { db_query("UPDATE " . $table . " SET " . $browse_column . "=" . $browse_column . "+1 WHERE group_id = " . db_ei($group_id) . " AND user_id = " . $user_id . " AND day = '" . $db_day . "'"); } else { db_query("INSERT INTO " . $table . " (group_id,user_id,day," . $browse_column . ") VALUES (" . db_ei($group_id) . "," . $user_id . ",'" . $db_day . "',1)"); } } }
function outerTabs($params) { global $Language, $sys_use_trove, $sys_use_snippet; $selected_top_tab = ''; if (isset($params['selected_top_tab'])) { $selected_top_tab = $params['selected_top_tab']; } $menuTree = new TreeNode(); $sthSelected = false; $menuTree->addChild(new TreeNode(array('link' => '/', 'title' => $Language->getText('menu', 'home')))); // We need to keep a reference on this node in order to set the // selected value in the data. See bottom of this function. $homeNode =& $menuTree->getChild(0); if (user_isloggedin()) { $selected = isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/' || strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/account/'); $sthSelected = $sthSelected || $selected; $mynode = new TreeNode(array('link' => '/my/', 'title' => $Language->getText('menu', 'my_personal_page'), 'selected' => $selected)); if ($selected) { $selected = isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/' || (bool) strstr(getStringFromServer('REQUEST_URI'), '/my/'); $mynode->addChild(new TreeNode(array('link' => '/my/', 'title' => $Language->getText('my_index', 'my_dashboard'), 'selected' => $selected))); $selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/account/'); $mynode->addChild(new TreeNode(array('link' => '/account/', 'title' => $Language->getText('my_index', 'account_maintenance'), 'selected' => $selected))); } $menuTree->addChild($mynode); } else { $selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/my/'); $sthSelected = $sthSelected || $selected; $menuTree->addChild(new TreeNode(array('link' => '/my/', 'title' => $Language->getText('menu', 'my_personal_page'), 'selected' => $selected))); } if ($GLOBALS['sys_use_trove'] != 0 || isset($params['group']) && $params['group']) { $selected = false; if (isset($params['group']) && $params['group']) { // get group info using the common result set $pm = ProjectManager::instance(); $project = $pm->getProject($params['group']); if ($project && is_object($project)) { if ($project->isError()) { die('is error'); } else { $sthSelected = true; $projTree = $this->project_tabs($params['toptab'], $params['group']); $projTree->setData(array('link' => '/softwaremap/', 'title' => $Language->getText('menu', 'projectree'), 'selected' => true)); //'link'=>'/projects/'.$project->getUnixName().'/' //,'title'=>$project->getPublicName() //,'selected' => true)); $menuTree->addChild($projTree); } } } else { $selected = (bool) strstr(getStringFromServer('REQUEST_URI'), 'softwaremap'); $sthSelected = $sthSelected || $selected; $menuTree->addChild(new TreeNode(array('link' => '/softwaremap/', 'title' => $Language->getText('menu', 'projectree'), 'selected' => $selected))); } } if ($GLOBALS['sys_use_snippet'] != 0) { $selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/snippet/'); $sthSelected = $sthSelected || $selected; $menuTree->addChild(new TreeNode(array('link' => '/snippet/', 'title' => $Language->getText('menu', 'code_snippet'), 'selected' => $selected))); } if (user_ismember(1, 'A')) { $selected = strpos(getStringFromServer('REQUEST_URI'), '/admin/') === 0 || $selected_top_tab === 'admin'; $sthSelected = $sthSelected || $selected; $menuTree->addChild(new TreeNode(array('link' => '/admin/', 'title' => $Language->getText('menu', 'admin'), 'selected' => $selected))); } $selected = (bool) (strstr(getStringFromServer('REQUEST_URI'), '/site/') || $selected_top_tab === 'site'); $sthSelected = $sthSelected || $selected; $menuTree->addChild(new TreeNode(array('link' => '/site/', 'title' => $Language->getText('include_layout', 'Help'), 'selected' => $selected))); $additional_tabs = array(); include $GLOBALS['Language']->getContent('layout/extra_tabs', null, null, '.php'); foreach ($additional_tabs as $t) { $sthSelected = $sthSelected || $t['selected']; $menuTree->addChild(new TreeNode($t)); } // Set selected value for 'home' link (this is the selected tab // if no other was previously selected) $homeNodeData =& $homeNode->getData(); $homeNodeData['selected'] = !$sthSelected; $buildMenuVisitor = new BuildMenuVisitor(); $menuTree->accept($buildMenuVisitor); echo $buildMenuVisitor->getHtml(); }
echo _('New Virtual Host <em>(e.g. vhost.org)</em>'); ?> </td> <td> <input type="text" size="15" maxlength="255" name="vhost_name" /> </td> <td> <input type="submit" value="<?php echo _('Create'); ?> " /> </td> </tr> </table> </form> <?php $res_db = db_query("\n\tSELECT *\n\tFROM prweb_vhost \n\tWHERE group_id='" . $group->getID() . "'\n"); if (db_numrows($res_db) > 0) { $title = array(); $title[] = _('Virtual Host'); $title[] = _('Operations'); echo $GLOBALS['HTML']->listTableTop($title); while ($row_db = db_fetch_array($res_db)) { print ' <tr> <td>' . $row_db['vhost_name'] . '</td> <td>[ <strong><a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group->getID() . '&vhostid=' . $row_db['vhostid'] . '&deletevhost=1">' . _('Delete') . '</a></strong>] </tr> '; } echo $GLOBALS['HTML']->listTableBottom(); } else { echo '<p>' . _('No VHOSTs defined') . 'No VHOSTs defined</p>'; } project_admin_footer(array());
* * @version $Id$ * */ $no_gz_buffer = true; require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfcommon . 'tracker/Artifact.class.php'; require_once $gfcommon . 'tracker/ArtifactFile.class.php'; //require_once('www/tracker/include/ArtifactFileHtml.class.php'); require_once $gfcommon . 'tracker/ArtifactType.class.php'; require_once $gfcommon . 'tracker/ArtifactType.class.php'; if (!session_loggedin()) { exit_not_logged_in(); } $arr = explode('/', getStringFromServer('REQUEST_URI')); $group_id = $arr[3]; $atid = $arr[4]; $aid = $arr[5]; $file_id = $arr[6]; if (!$group_id) { exit_no_group(); } // // get the Group object // $group =& group_get_object($group_id); if (!$group || !is_object($group) || $group->isError()) { exit_no_group(); } //
public function extra_tabs_active() { $current_page = getStringFromServer('REQUEST_URI'); foreach ($this->extra_tabs as $tab) { if (strstr($current_page, $tab['link'])) { return 'active'; } } return ''; }
function mainMenu($params) { global $sys_use_trove, $sys_use_snippet, $sys_use_people; $TABS_DIRS[] = '/'; $TABS_DIRS[] = '/my/'; if ($sys_use_trove) { $TABS_DIRS[] = '/softwaremap/'; } if ($sys_use_snippet) { $TABS_DIRS[] = '/snippet/'; } if ($sys_use_people) { $TABS_DIRS[] = '/people/'; } $TABS_TITLES[] = _('Home'); $TABS_TITLES[] = _('My Page'); if ($sys_use_trove) { $TABS_TITLES[] = _('Project Tree'); } if ($sys_use_snippet) { $TABS_TITLES[] = _('Code Snippets'); } if ($sys_use_people) { $TABS_TITLES[] = _('Project Openings'); } // outermenu hook $PLUGIN_TABS_DIRS = array(); $hookParams['DIRS'] =& $PLUGIN_TABS_DIRS; $hookParams['TITLES'] =& $TABS_TITLES; plugin_hook("outermenu", $hookParams); $TABS_DIRS = array_merge($TABS_DIRS, $PLUGIN_TABS_DIRS); if (user_ismember(1, 'A')) { $TABS_DIRS[] = '/admin/'; $TABS_TITLES[] = _('Admin'); } if (user_ismember($GLOBALS['sys_stats_group'])) { $TABS_DIRS[] = '/reporting/'; $TABS_TITLES[] = _('Reporting'); } if (isset($params['group']) && $params['group']) { // get group info using the common result set $project =& group_get_object($params['group']); if ($project && is_object($project)) { if ($project->isError()) { } elseif (!$project->isProject()) { } else { if (isset($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) { $TABS_DIRS[] = '/project/?group_id=' . $params['group']; } else { $TABS_DIRS[] = '/projects/' . $project->getUnixName() . '/'; } $TABS_TITLES[] = $project->getPublicName(); $selected = count($TABS_DIRS) - 1; } } } elseif (strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/account/') || strstr(getStringFromServer('REQUEST_URI'), '/themes/')) { $selected = array_search("/my/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), 'softwaremap')) { $selected = array_search("/softwaremap/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/snippet/')) { $selected = array_search("/snippet/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/people/')) { $selected = array_search("/people/", $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/reporting/')) { $selected = array_search('/reporting/', $TABS_DIRS); } elseif (strstr(getStringFromServer('REQUEST_URI'), '/admin/') && user_ismember(1, 'A')) { $selected = array_search('/admin/', $TABS_DIRS); } elseif (count($PLUGIN_TABS_DIRS) > 0) { foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) { if (strstr($GLOBALS['REQUEST_URI'], $PLUGIN_TABS_DIRS_VALUE)) { $selected = array_search($PLUGIN_TABS_DIRS_VALUE, $TABS_DIRS); break; } } } else { $selected = 0; } if (!isset($this->COLOR_SELECTED_TAB)) { $this->COLOR_SELECTED_TAB = '#e0e0e0'; } echo $this->tabGenerator($TABS_DIRS, $TABS_TITLES, false, $selected, $this->COLOR_SELECTED_TAB, '100%'); }
$id = getStringFromRequest('id'); $ac = new ArtifactExtraField($ath, $id); if (!$ac || !is_object($ac)) { $feedback .= 'Unable to create ArtifactExtraField Object'; } elseif ($ac->isError()) { $feedback .= $ac->getErrorMessage(); } else { ?> <p> <strong><?php echo _('Type of custom field') . ': ' . $ac->getTypeName(); ?> </strong><br /> <form action="<?php echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&id=' . $id . '&atid=' . $ath->getID(); ?> " method="post"> <input type="hidden" name="update_box" value="y" /> <input type="hidden" name="id" value="<?php echo $ac->getID(); ?> " /> <input type="hidden" name="is_required" value="0" /> <p> <strong><?php echo _('Custom Field Name'); ?> :</strong><br /> <input type="text" name="name" value="<?php echo $ac->getName();
} 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'); ?> ')"><strong>(?)</strong></a> </td> <td><?php if ($group->usesPM()) { echo ' <a href="' . getStringFromServer('PHP_SELF') . '?func=taskmgr&group_id=' . $group_id . '&atid=' . $atid . '&aid=' . $aid . '">' . html_image('ic/taskman20w.png', '20', '20', array()) . '<strong>' . _('Build Task Relation') . '</strong></a>'; } ?> </td> <td> <input type="submit" name="submit" value="<?php echo _('Submit'); ?> " /> </td> </tr> </table> <?php } ?> <table border="0" width="80%">
print "<p>" . _('Unix Group Name:') . " " . $row_grp['unix_group_name'] . "</p>"; print "<p>" . _('Submitted Description:') . "</p><blockquote>" . $row_grp['register_purpose'] . "</blockquote>"; if ($row_grp['license'] == "other") { print "<p>" . _('License Other:') . "</p><blockquote>" . $row_grp['license_other'] . "</blockquote>"; } if (isset($row_grp['status_comment'])) { print "<p>" . _('Pending reason:') . "</p><span class=\"important\">" . $row_grp['status_comment'] . "</span>"; } $res = db_query("SELECT u.user_id\n\t\t\t FROM users u, user_group ug\n\t\t\t WHERE ug.group_id='" . $row_grp['group_id'] . "' AND u.user_id=ug.user_id;"); if (db_numrows($res) >= 1) { $submitter =& user_get_object(db_result($res, 0, 'user_id')); echo '<p>' . sprintf(_('Submitted by %1$s (%2$s)'), $submitter->getRealName(), $submitter->getUnixName()) . '</p>'; } echo "<p> </p><hr /><p> </p>"; } //list of group_id's of pending projects $arr = util_result_column_to_array($res_grp, 0); $group_list = implode($arr, ','); echo ' <div align="center"> <form action="' . getStringFromServer('PHP_SELF') . '" method="post"> <input type="hidden" name="action" value="activate" /> <input type="hidden" name="list_of_groups" value="' . $group_list . '" /> <input type="submit" name="submit" value="' . _('Approve All On This Page') . '" /> </form></div> '; site_admin_footer(array()); // Local Variables: // mode: php // c-file-style: "bsd" // End:
} Header("Location: index.php?group_id={$group_id}&feedback=Successful"); } if (!$accumulated_ids) { exit_error('Error', 'No IDs Were Passed'); } else { $arr = explode(',', $accumulated_ids); $res = db_query("SELECT user_id,user_name,realname FROM users\n\t\tWHERE status='A' and type_id='1' and user_id IN ('" . implode('\',\'', $arr) . "') \n\t\tORDER BY realname ASC"); } project_admin_header(array('title' => _('Edit Role'), 'group' => $group_id)); echo ' <h2>' . _('Add Users From List') . '</h2> <p> ' . _('Choose the role for each user and then press "Add All".') . ' <p> <form action="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '" method="post">'; if (!$res || db_numrows($res) < 1) { echo "No Matching Users Found"; } else { $titles[] = _('Real name'); $titles[] = _('Unix name'); $titles[] = _('Role'); echo $HTML->listTableTop($titles); // // Everything is built on the multi-dimensial arrays in the Role object // for ($i = 0; $i < db_numrows($res); $i++) { echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '> <td>' . db_result($res, $i, 'realname') . '</td> <td>' . db_result($res, $i, 'user_name') . '</td> <td>' . role_box($group_id, 'addrole[' . db_result($res, $i, 'user_id') . ']', '') . '</td></tr>';
// make sure we're not compressing output if we are making a tarball if (isset($_GET['view']) && $_GET['view'] == 'tar') { $no_gz_buffer = true; } require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'scm/include/scm_utils.php'; require_once $gfwww . 'scm/include/viewvc_utils.php'; if (!$sys_use_scm) { exit_disabled(); } // Get the project name from query if (getStringFromGet('root') && strpos(getStringFromGet('root'), ';') === false) { $projectName = getStringFromGet('root'); } else { $queryString = getStringFromServer('QUERY_STRING'); if (preg_match_all('/[;]?([^\\?;=]+)=([^;]+)/', $queryString, $matches, PREG_SET_ORDER)) { for ($i = 0, $size = sizeof($matches); $i < $size; $i++) { $query[$matches[$i][1]] = urldecode($matches[$i][2]); } $projectName = $query['root']; } } // Remove eventual leading /root/ or root/ $projectName = ereg_replace('^..[^/]*/', '', $projectName); if (!$projectName) { exit_no_group(); } // Check permissions $Group =& group_get_object_by_name($projectName); if (!$Group || !is_object($Group) || $Group->isError()) {
protected function renderPortals($sidebar) { if (!isset($sidebar['SEARCH'])) { $sidebar['SEARCH'] = true; } if (!isset($sidebar['TOOLBOX'])) { $sidebar['TOOLBOX'] = true; } if (!isset($sidebar['LANGUAGES'])) { $sidebar['LANGUAGES'] = true; } if (session_loggedin()) { $efbox_log_text = _('Log Out'); $efbox_log_link = "/account/logout.php?return_to=" . urlencode(getStringFromServer('REQUEST_URI')); } else { $efbox_log_text = _('Log In'); $efbox_log_link = "/account/login.php?return_to=" . urlencode(getStringFromServer('REQUEST_URI')); } foreach ($sidebar as $boxName => $content) { if ($content === false) { continue; } if ($boxName == 'SEARCH') { if ($this->isCompatibilityViewEnabled()) { $this->searchBox(); } } elseif ($boxName == 'TOOLBOX') { $this->toolbox(); } elseif ($boxName == 'LANGUAGES') { $this->languageBox(); } else { $this->customBox($boxName, $content); } } }
echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id; ?> &addproject=1"><?php echo _('Add A Project'); ?> </a><br /> <?php echo _('Add a project, which can contain a set of tasks. This is different than creating a new task.'); ?> <p /> <?php } $pgf = new ProjectGroupFactory($g); if (!$pgf || !is_object($pgf)) { exit_error('Error', 'Could Not Get Factory'); } elseif ($pgf->isError()) { exit_error('Error', $pgf->getErrorMessage()); } $pg_arr =& $pgf->getProjectGroups(); if (count($pg_arr) < 1 || $pg_arr == false) { echo _('<h2>No Projects Found</h2><p>None found for this group. You may add new Projects using the "Add A Project" link above.</p>'); echo db_error(); } else { for ($i = 0; $i < count($pg_arr); $i++) { echo '<a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&group_project_id=' . $pg_arr[$i]->getID() . '&update_pg=1">' . _('Edit/Update Project') . ': <strong>' . $pg_arr[$i]->getName() . '</strong></a><p />'; } } pm_footer(array()); } } }
function advancedSearchBox($sectionsArray, $group_id, $words, $isExact) { // display the searchmask print ' <form name="advancedsearch" action="' . getStringFromServer('PHP_SELF') . '" method="post"> <input type="hidden" name="search" value="1"/> <input type="hidden" name="group_id" value="' . $group_id . '"/> <div align="center"><br /> <table border="0"> <tr> <td colspan ="2"> <input type="text" size="60" name="words" value="' . stripslashes(htmlspecialchars($words)) . '" /> <input type="submit" name="submitbutton" value="' . _('Search') . '" /> </td> </tr> <tr> <td valign="top"> <input type="radio" name="mode" value="' . SEARCH__MODE_AND . '" ' . ($isExact ? 'checked="checked"' : '') . ' />' . _('with all words') . ' </td> <td> <input type="radio" name="mode" value="' . SEARCH__MODE_OR . '" ' . (!$isExact ? 'checked="checked"' : '') . ' />' . _('with one word') . ' </td> </tr> </table><br /></div>' . $this->createUnderSections($sectionsArray) . ' </form>'; //create javascript methods for select none/all print ' <script type="text/javascript"> <!-- method for disable/enable checkboxes function setCheckBoxes(parent, checked) { for (var i = 0; i < document.advancedsearch.elements.length; i++) if (document.advancedsearch.elements[i].type == "checkbox") if (document.advancedsearch.elements[i].name.substr(0, parent.length) == parent) document.advancedsearch.elements[i].checked = checked; } //--> </script> '; }