예제 #1
0
/**
 * Module of support routines for Site Admin
 *
 * Copyright 1999-2001 (c) VA Linux Systems
 *
 * @version   $Id$
 *
 * 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 site_admin_header($params)
{
    global $feedback, $HTML;
    session_require(array('group' => '1', 'admin_flags' => 'A'));
    $HTML->header($params);
    echo html_feedback_top($feedback);
}
 function request()
 {
     $request =& HTTPRequest::instance();
     session_require(array('group' => $request->get('group_id'), 'admin_flags' => 'A'));
     if ($request->exist('view')) {
         switch ($request->get('view')) {
             case 'creation':
                 $this->view = 'creation';
                 break;
             case 'edit':
                 $this->view = 'edit';
                 break;
             default:
                 $this->view = 'browse';
                 break;
         }
     } else {
         $this->view = 'browse';
     }
     if ($request->exist('action')) {
         switch ($request->get('action')) {
             case 'do_edit':
                 $this->action = 'do_edit';
                 break;
             case 'do_create':
                 $this->action = 'do_create';
                 break;
             case 'do_delete':
                 $this->action = 'do_delete';
                 break;
             default:
                 break;
         }
     }
 }
 function PluginsAdministration()
 {
     session_require(array('group' => '1', 'admin_flags' => 'A'));
 }
예제 #4
0
 * 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
 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
session_require(array('isloggedin' => 1));
if (getStringFromRequest('submit')) {
    if (!form_key_is_valid(getStringFromRequest('form_key'))) {
        exit_form_double_submit();
    }
    $newemail = getStringFromRequest('newemail');
    if (!validate_email($newemail)) {
        form_release_key(getStringFromRequest('form_key'));
        exit_error(_('Error'), _('Invalid email address.'));
    }
    $confirm_hash = substr(md5($session_hash . time()), 0, 16);
    $u =& user_get_object(user_getid());
    if (!$u || !is_object($u)) {
        form_release_key(getStringFromRequest('form_key'));
        exit_error('Error', 'Could Not Get User');
    } elseif ($u->isError()) {
예제 #5
0
/**
 * Mandate current session to be site admin otherwise redirect to an error page
 */
function session_require_site_admin()
{
    session_require(array('group' => '1', 'admin_flags' => 'A'));
}
예제 #6
0
 private function getUGroupRow($ugroupId)
 {
     $res = ugroup_db_get_ugroup($ugroupId);
     if ($res && !db_error($res) && db_numrows($res) == 1) {
         $row = db_fetch_array($res);
         session_require(array('group' => $row['group_id'], 'admin_flags' => 'A'));
         if ($row['group_id'] == 100) {
             $row = null;
         }
     } else {
         exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_admin_editugroup', 'ug_not_found', array($ugroupId, db_error())));
     }
     return $row;
 }
예제 #7
0
<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: tos.php,v 1.2 2003/11/13 11:29:26 helix Exp $
require "pre.php";
// Initial db and session library, opens session
session_require(array(isloggedin => 1));
$HTML->header(array(title => "Terms of Service"));
print "<p><h2>Step 2: Terms of Service Agreement</h2></p>";
include "../tos/tos_text.php";
?>
 

<BR><HR><BR>

<P align=center>By clicking below, you acknowledge that you have read 
and understand the Terms of Service agreement. Clicking "I AGREE" will
constitute your legal signature on this document.
<P><H3 align=center><A href="basicinfo.php">[I AGREE]</A>
&nbsp;&nbsp;<A href="/">[I DISAGREE]</A></H3>

<?php 
$HTML->footer(array());
?>

예제 #8
0
 function process()
 {
     session_require(array('group' => '1', 'admin_flags' => 'A'));
     $request =& HTTPRequest::instance();
     $valid = new Valid('offset');
     $valid->setErrorMessage('Invalid offset submitted. Force it to 0 (zero).');
     $valid->addRule(new Rule_Int());
     $valid->addRule(new Rule_GreaterOrEqual(0));
     if ($request->valid($valid)) {
         $offset = $request->get('offset');
     } else {
         $offset = 0;
     }
     $valid = new Valid('day');
     $valid->addRule(new Rule_Date(), 'Invalid date submitted. Force it to today.');
     if ($request->valid($valid)) {
         $day = $request->get('day');
     } else {
         $day = date('Y-n-j');
     }
     $userLogManager = new UserLogManager();
     $userLogManager->displayLogs($offset, $day);
 }
 function PluginCreationWizard()
 {
     session_require(array('group' => '1', 'admin_flags' => 'A'));
 }
예제 #10
0
} else {
    exit_error($Language->getText('global', 'error'), 'No ldap plugin');
}
// User group id exists
$vUgroupId = new Valid_UInt('ugroup_id');
$vUgroupId->required();
if ($request->valid($vUgroupId)) {
    $ugroupId = $request->get('ugroup_id');
} else {
    exit_error($Language->getText('global', 'error'), $Language->getText('project_admin_editugroup', 'ug_not_found'));
}
// Do not try to modify ugroups of project 100
$res = ugroup_db_get_ugroup($ugroupId);
if ($res && !db_error($res) && db_numrows($res) == 1) {
    $row = db_fetch_array($res);
    session_require(array('group' => $row['group_id'], 'admin_flags' => 'A'));
    if ($row['group_id'] == 100) {
        exit_error($Language->getText('global', 'error'), "Cannot modify this ugroup with LDAP plugin");
    }
} else {
    exit_error($Language->getText('global', 'error'), $Language->getText('project_admin_editugroup', 'ug_not_found', array($ugroupId, db_error())));
}
$group_id = $row['group_id'];
$ldapUserGroupManager = new LDAP_UserGroupManager($ldapPlugin->getLdap());
$ldapUserGroupManager->setId($ugroupId);
$hp = Codendi_HTMLPurifier::instance();
$btn_update = $Language->getText('plugin_ldap', 'ugroup_edit_btn_update');
$vSubmit = new Valid_WhiteList('submit', array($btn_update));
$vSubmit->required();
if ($request->isPost() && $request->valid($vSubmit)) {
    if ($request->get('submit') == $btn_update) {
예제 #11
0
function site_project_header($params)
{
    global $HTML, $Language;
    /*
    	Check to see if active
    	Check to see if private (if private check if user_ismember)
    */
    $group_id = $params['group'];
    //get the project object
    $pm = ProjectManager::instance();
    $project = $pm->getProject($group_id);
    //group doesn't exist
    if ($project->isError()) {
        exit_error($Language->getText('include_html', 'invalid_g'), $Language->getText('include_html', 'g_not_exist'));
    }
    //group is private
    if (!$project->isPublic() && isset($params['user_has_special_access']) && !$params['user_has_special_access']) {
        //if its a private group, you must be a member of that group
        session_require(array('group' => $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(array('group' => '1'));
    }
    if (isset($params['pv']) && $params['pv'] != 0) {
        // Printer version: no right column, no tabs...
        echo $HTML->pv_header($params);
    } else {
        site_header($params);
    }
}
예제 #12
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Codendi; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once 'pre.php';
require_once 'www/project/admin/project_admin_utils.php';
require_once 'www/project/admin/include/UserImportHtml.class.php';
if (!user_isloggedin()) {
    exit_not_logged_in();
    return;
}
if (!isset($_REQUEST['group_id'])) {
    exit_no_group();
}
session_require(array('group' => $_REQUEST['group_id'], 'admin_flags' => 'A'));
$import = new UserImportHtml($_REQUEST['group_id']);
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "parse") {
    $import->displayParse($_FILES['user_filename']['tmp_name']);
} else {
    if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "import") {
        $import->displayImport($_REQUEST['parsed_users']);
    } else {
        if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == "showformat") {
            $import->displayShowFormat();
        } else {
            $import->displayInput();
        }
    }
}
예제 #13
0
/**
 *	site_project_header() - everything required to handle
 *	security and state checks for a project web page
 *
 *	@param params array() must contain $toptab and $group
 */
function site_project_header($params)
{
    global $HTML;
    /*
    	Check to see if active
    	Check to see if project rather than foundry
    	Check to see if private (if private check if user_ismember)
    */
    $group_id = $params['group'];
    //get the project object
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_error("GROUP PROBLEM", "PROBLEM CREATING GROUP OBJECT");
    } else {
        if ($project->isError()) {
            exit_error("Group Problem", $project->getErrorMessage());
        }
    }
    //group is private
    if (!$project->isPublic()) {
        //if it's a private group, you must be a member of that group
        session_require(array('group' => $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(array('group' => '1'));
    }
    if (isset($params['title'])) {
        $params['title'] = $project->getPublicName() . ': ' . $params['title'];
    } else {
        $params['title'] = $project->getPublicName();
    }
    echo $HTML->header($params);
    if (isset($GLOBALS['feedback'])) {
        echo html_feedback_top($GLOBALS['feedback']);
    }
    //	echo $HTML->project_tabs($params['toptab'],$params['group'],$params['tabtext']);
}
예제 #14
0
 *
 * 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
 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $sys_path_to_jpgraph . '/jpgraph.php';
require_once $sys_path_to_jpgraph . '/jpgraph_line.php';
require_once $gfcommon . 'reporting/ReportUserAdded.class.php';
session_require(array('group' => $sys_stats_group));
$SPAN = getStringFromRequest('SPAN');
$start = getStringFromRequest('start');
$end = getStringFromRequest('end');
//
//	Create Report
//
$report = new ReportUserAdded($SPAN, $start, $end);
//
//	Check for error, such as license key problem
//
if ($report->isError()) {
    echo $report->getErrorMessage();
    exit;
}
// Some data
예제 #15
0
 function DataGenerator()
 {
     session_require(array('group' => '1', 'admin_flags' => 'A'));
 }
예제 #16
0
<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: editpackages.php,v 1.2 2003/11/13 11:29:26 helix Exp $
require 'pre.php';
require $DOCUMENT_ROOT . '/project/admin/project_admin_utils.php';
session_require(array('group' => $group_id));
$project =& group_get_object($group_id);
if (!$project->userIsReleaseTechnician()) {
    exit_permission_denied();
}
$is_admin = $project->userIsAdmin();
/*
	Relatively simple form to edit/add packages of releases
*/
// only admin can modify packages (vs modifying releases of packages)
if ($is_admin && $submit) {
    /*
    	make updates to the database
    */
    if ($func == 'add_package' && $package_name) {
        //create a new package
        db_query("INSERT INTO frs_package (group_id,name,status_id) " . "VALUES ('{$group_id}','" . htmlspecialchars($package_name) . "','1')");
        $feedback .= ' Added Package ';
    } else {
        if ($func == 'update_package' && $package_id && $package_name && $status_id) {
            if ($status_id != 1) {
예제 #17
0
if (!$request->valid($vGroupId)) {
    exit_error($Language->getText('project_admin_index', 'invalid_p'), $Language->getText('project_admin_index', 'p_not_found'));
}
$group_id = $request->get('group_id');
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
//
//  get the Project
//
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
if (!$project || !is_object($project) || $project->isError()) {
    exit_no_group();
}
//if the project isn't active, require you to be a member of the super-admin group
if ($project->getStatus() != 'A') {
    session_require(array('group' => 1));
}
$vFunc = new Valid_WhiteList('func', array('member_req_notif_group', 'member_req_notif_message'));
$vFunc->required();
if ($request->isPost() && $request->valid($vFunc)) {
    /*
      updating the database
    */
    switch ($request->get('func')) {
        case 'member_req_notif_group':
            $vUGroups = new Valid_UInt('ugroups');
            $vUGroups->required();
            if ($request->validArray($vUGroups)) {
                $ugroups = $request->get('ugroups');
                // Remove ugroups that are empty or contain no project admins
                $result = ugroup_filter_ugroups_by_project_admin($group_id, $ugroups);
예제 #18
0
<?php

//
// Codendi
// Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
// http://www.codendi.com
//
//
require_once 'pre.php';
require '../admin/project_admin_utils.php';
require './source_code_access_utils.php';
require 'www/project/export/access_logs_export.php';
// Only for project administrators
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
if (!$group_id) {
    exit_error($Language->getText('project_admin_userperms', 'invalid_g'), $Language->getText('project_admin_userperms', 'group_not_exist'));
}
$project = new Project($group_id);
if (isset($_REQUEST['SUBMIT'])) {
    switch ($view) {
        case "monthly":
            $period = $span * 30.5;
            break;
        case "weekly":
            $period = $span * 7;
            break;
        case 'daily':
            $period = $span;
            break;
    }
    // Send the result in CSV format
예제 #19
0
function site_project_header($params)
{
    global $HTML;
    /*
    	Check to see if active
    	Check to see if project rather than foundry
    	Check to see if private (if private check if user_ismember)
    */
    $group_id = $params['group'];
    //get the project object
    $project =& project_get_object($group_id);
    if (!$project || $project->isError()) {
        exit_error("Group Problem", $project->getErrorMessage());
    }
    //group is private
    if (!$project->isPublic()) {
        //if it's a private group, you must be a member of that group
        session_require(array('group' => $group_id));
    }
    //for dead projects must be member of alexandria project
    if (!$project->isActive()) {
        //only SF group can view non-active, non-holding groups
        session_require(array('group' => '1'));
    }
    echo $HTML->header($params);
    echo html_feedback_top($GLOBALS['feedback']);
    echo $HTML->project_tabs($params['toptab'], $params['group']);
}