[evolvis-commits] r7407: Solved conflicts arising from 2.6 import/merge. ↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 15:40:38 CET 2011
Author: mirabilos
Date: 2011-02-24 15:40:37 +0100 (Thu, 24 Feb 2011)
New Revision: 7407
Removed:
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Error.class
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Foundry.class
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Group.class
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Project.class
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/User.class
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/account.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/database.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/ldap.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/session.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/timezones.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/utils.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vars.php
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editpackages.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/index.php
trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/qrs.php
Log:
Solved conflicts arising from 2.6 import/merge.
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Error.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Error.class 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Error.class 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,54 +0,0 @@
-<?php
-
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: Error.class,v 1.5 2000/11/22 21:01:16 pfalcon Exp $
-
-
-/*
-
- Very simple base class to extend
-
- Provides a basic uniform API for setting and testing error conditions and
- error messages
-
- Tim Perdue, August 28, 2000
-
-*/
-
-
-class Error {
-
- var $error_state;
- var $error_message;
-
- function Error() {
- //nothing
- $this->error_state=false;
- }
-
- function setError($string) {
- $this->error_state=true;
- $this->error_message .= $string."<br>";
- }
-
- function clearError() {
- $this->error_state=false;
- $this->error_message='';
- }
-
- function getErrorMessage() {
- if ($this->error_state) return $this->error_message;
- return "No error";
- }
-
- function isError() {
- return $this->error_state;
- }
-
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Foundry.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Foundry.class 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Foundry.class 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,134 +0,0 @@
-<?php
-
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: Foundry.class,v 1.13 2000/11/03 19:03:35 tperdue Exp $
-
-
-/*
-
- An object wrapper for foundry (as opposed to project) data
-
- Extends the base object, Group
-
- Tim Perdue, August 28, 2000
-
-
-
- Example of proper use:
-
- //instantiate the object
- $grp = new Foundry($group_id);
-
- //now use the object to get the unix_name for the project
- $grp->getUnixName();
-
-
-*/
-
-/*
- associative array of foundry objects
- helps prevent the same object from being created more than once
- which would create unnecessary database calls
-*/
-
-function &foundry_get_object($group_id) {
- return group_get_object($group_id);
-}
-
-class Foundry extends Group {
-
- //foundry preferences, etc - associative array from the database
- var $foundry_data_array;
-
- //database result set handle for foundry_data
- var $foundry_db_result;
-
-
- /*
- basically just call the parent to set up everything
- */
- function Foundry($id,$res=false) {
- $this->Group($id,$res);
-
- //now set up the foundry data
-
- $this->foundry_db_result=db_query("SELECT * FROM foundry_data WHERE foundry_id='$id'");
- if (db_numrows($this->foundry_db_result) < 1) {
- //function in class we extended
- $this->setError('Foundry Data Not Found');
- $this->foundry_data_array=array();
- } else {
- //set up an associative array for use by other functions
- $this->foundry_data_array=db_fetch_array($this->foundry_db_result);
- }
- }
-
- function refreshFoundryData() {
- $this->refreshGroupData();
- $this->foundry_db_result=db_query("SELECT * FROM foundry_data WHERE foundry_id='". $this->getGroupId() ."'");
- $this->foundry_data_array=db_fetch_array($this->foundry_db_result);
- }
-
- function getFreeformHTML1() {
- return $this->foundry_data_array['freeform1_html'];
- }
-
- function getFreeformHTML2() {
- return $this->foundry_data_array['freeform2_html'];
- }
-
- function getSponsorHTML1() {
- return $this->foundry_data_array['sponsor1_html'];
- }
-
- function getSponsorHTML2() {
- return $this->foundry_data_array['sponsor2_html'];
- }
-
-
- /*
- The ID number that corresponds to the appropriate ID # in
- the db_images table
- */
- function getGuideImageID() {
- return $this->foundry_data_array['guide_image_id'];
- }
-
-
- /*
- The ID number that corresponds to the appropriate ID # in
- the db_images table
- */
- function getLogoImageID() {
- return $this->foundry_data_array['logo_image_id'];
- }
-
- function getTroveCategories() {
- return $this->foundry_data_array['trove_categories'];
- }
-
- /*
- Returns a comma separated list of member project ids
- */
- function getProjectsCommaSep() {
- return implode(',',$this->getMemberProjects());
- }
-
-
- /*
- Returns an array of member project ids
- */
- function getMemberProjects() {
- //return an array of group_id's in this project
- $sql="SELECT DISTINCT project_id FROM foundry_projects WHERE foundry_id='". $this->getGroupId() ."' ORDER BY project_id ASC";
- $result=db_query($sql);
- return util_result_column_to_array($result);
- }
-
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Group.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Group.class 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Group.class 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,681 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: Group.class,v 1.59 2000/12/13 19:22:46 tperdue Exp $
-
-/**
- *
- * Group object by
- * @author Tim Perdue, August 28, 2000
- *
- * Sets up database results and preferences for a group and abstracts this info
- *
- * Foundry.class and Project.class call this.
- *
- * Project.class contains all the deprecated API from the old group.php file
- *
- * DEPENDS on user.php being present and setup properly
- *
- * GENERALLY YOU SHOULD NEVER INSTANTIATE THIS OBJECT DIRECTLY
- * USE group_get_object() to instantiate properly
- *
- */
-
-
-$GROUP_OBJ=array();
-
-/**
- *
- * group_get_object is useful so you can pool group objects/save database queries
- * You should always use this instead of instantiating the object directly
- *
- * You can now optionally pass in a db result
- * handle. If you do, it re-uses that query
- * to instantiate the objects
- *
- * IMPORTANT! That db result must contain all fields
- * from groups table or you will have problems
- *
- * @param group_id required
- * @param res result set handle ("SELECT * FROM groups WHERE group_id=xx")
- * @returns a group object or false on failure
- *
- */
-
-function &group_get_object($group_id,$res=false) {
- //create a common set of group objects
- //saves a little wear on the database
-
- //automatically checks group_type and
- //returns appropriate object
-
- global $GROUP_OBJ;
- if (!isset($GROUP_OBJ["_".$group_id."_"])) {
- if ($res) {
- //the db result handle was passed in
- } else {
- $res=db_query("SELECT * FROM groups WHERE group_id='$group_id'");
- }
- if (!$res || db_numrows($res) < 1) {
- $GROUP_OBJ["_".$group_id."_"]=false;
- } else {
- /*
- check group type and set up object
- */
- if (db_result($res,0,'type')==1) {
- //project
- $GROUP_OBJ["_".$group_id."_"]= new Project($group_id,$res);
- } else if (db_result($res,0,'type')==2) {
- //foundry
- $GROUP_OBJ["_".$group_id."_"]= new Foundry($group_id,$res);
- } else {
- //invalid
- $GROUP_OBJ["_".$group_id."_"]=false;
- }
- }
- }
- return $GROUP_OBJ["_".$group_id."_"];
-}
-
-class Group extends Error {
-
- //associative array of data from db
- var $data_array;
-
- var $group_id;
-
- //database result set handle
- var $db_result;
-
- //permissions data row from db
- var $perm_data_array;
-
- //whether the use is an admin/super user of this project
- var $is_admin;
-
- /**
- * Group() - Group object constructor - use group_get_object() to instantiate
- *
- * @param $id required - group_id of the group you want to instantiate
- * @param $res optional database result from select query
- */
- function Group($id,$res=false) {
- $this->Error();
- $this->group_id=$id;
- if (!$res) {
- $this->db_result=db_query("SELECT * FROM groups WHERE group_id='$id'");
- } else {
- $this->db_result=$res;
- }
- if (db_numrows($this->db_result) < 1) {
- //function in class we extended
- $this->setError('Group Not Found');
- $this->data_array=array();
- } else {
- //set up an associative array for use by other functions
-
- db_reset_result($this->db_result);
-
- $this->data_array=db_fetch_array($this->db_result);
- }
- }
-
-
- /**
- * getData()
- *
- * Generally should NOT be used - here for supporting deprecated group.php
- * @returns a database result set handle
- */
- function getData() {
- db_reset_result($this->db_result);
- return $this->db_result;
- }
-
- /**
- * refreshGroupData() - May need to refresh database fields if an update occurred
- */
- function refreshGroupData() {
- $this->db_result=db_query("SELECT * FROM groups WHERE group_id='". $this->getGroupId() ."'");
- $this->data_array=db_fetch_array($this->db_result);
- }
-
- /**
- * getGroupId() - Simply return the group_id for this object
- *
- * @returns integer group_id
- */
- function getGroupId() {
- return $this->group_id;
- }
-
-
- /**
- * getType() - Foundry, project, etc
- *
- * @returns the type flag from the database
- */
- function getType() {
- return $this->data_array['type'];
- }
-
-
- /**
- * getStatus()
- *
- * Statuses include I,H,A,D
- */
- function getStatus() {
- return $this->data_array['status'];
- }
-
- /**
- * isFoundry() - Simple boolean test to see if it's a foundry or not
- *
- * @returns true/false
- */
- function isFoundry() {
- if ($this->getType()==2) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * isProject() - Simple boolean test to see if it's a project or not
- *
- * @returns true/false
- */
- function isProject() {
- if ($this->getType()==1) {
- return true;
- } else {
- return false;
- }
- }
-
-
- /**
- * isPublic() - Simply returns the is_public flag from the database
- *
- * @returns true/false
- */
- function isPublic() {
- return $this->data_array['is_public'];
- }
-
-
- /**
- * isActive() - Database field status of 'A' returns true
- *
- * @returns true/false
- */
- function isActive() {
- if ($this->getStatus()=='A') {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * getUnixName()
- *
- * @returns text unix_name
- */
- function getUnixName() {
- return strtolower($this->data_array['unix_group_name']);
- }
-
- /**
- * getPublicName()
- *
- * @returns text group_name
- */
- function getPublicName() {
- return $this->data_array['group_name'];
- }
-
- /**
- * getDescription()
- *
- * @returns text description
- */
- function getDescription() {
- return $this->data_array['short_description'];
- }
-
- /**
- * getStartDate()
- *
- * @returns integer (unix time) of registration
- */
- function getStartDate() {
- return $this->data_array['register_time'];
- }
-
- /*
-
- Common Group preferences for tools
-
- */
-
- /**
- * usesMail() - whether or not this group has opted to use mailing lists
- *
- * @returns true/false
- */
- function usesMail() {
- return $this->data_array['use_mail'];
- }
-
- /**
- * usesNews() - whether or not this group has opted to use news
- *
- * @returns true/false
- */
- function usesNews() {
- return $this->data_array['use_news'];
- }
-
- /**
- * usesForum() - whether or not this group has opted to use discussion forums
- *
- * @returns true/false
- */
- function usesForum() {
- return $this->data_array['use_forum'];
- }
-
- /**
- * usesDocman() - whether or not this group has opted to use docman
- *
- * @returns true/false
- */
- function usesDocman() {
- return $this->data_array['use_docman'];
- }
-
- /**
- * usesSurvey() - whether or not this group has opted to use surveys
- *
- * @returns true/false
- */
- function usesSurvey() {
- return $this->data_array['use_survey'];
- }
-
- /**
- * getHomePage() - The URL for this project's home page
- *
- * @returns text homepage URL
- */
- function getHomePage() {
- return $this->data_array['homepage'];
- }
-
-
- /*
-
-
- Basic user permissions that apply to all Groups
-
- These depend on user_group table and the User.class functions
-
-
- */
-
- /**
- * useIsForumAdmin() - whether the current user has form admin perms
- *
- * @returns true/false
- */
- function userIsForumAdmin() {
- return $this->userIsMember('forum_flags',2);
- }
-
- /**
- * useIsDocEditor() - whether the current user has form doc editor perms
- *
- * @returns true/false
- */
- function userIsDocEditor() {
- return $this->userIsMember('doc_flags',1);
- }
-
- /**
- * useIsReleaseTechnician() - whether the current user has FRS admin perms
- *
- * @returns true/false
- */
- function userIsReleaseTechnician() {
- return $this->userIsMember('release_flags',1);
- }
-
- /**
- * userIsMember() - Simple test to see if the current user is a member of this project
- *
- * Can optionally pass in vars to test other permissions
- * @returns true/false
- */
- function userIsMember($field='user_id',$value='-1') {
- if (user_isloggedin()) {
- if ($this->userIsAdmin()) {
- //admins are tested first so that super-users can return true
- //and admins of a project should always have full privileges
- //on their project
- return true;
- } else {
- $arr=$this->getPermData();
- if ($arr[$field] >= $value) {
- return true;
- } else {
- return false;
- }
- }
- } else {
- return false;
- }
- }
-
- /**
- * userIsAdmin() - User is an admin of the project or admin of the entire site
- *
- * @returns true/false
- */
- function userIsAdmin() {
- if (isset($this->is_admin)) {
- //have already been through here and set the var
- } else {
- if (user_isloggedin()) {
- //check to see if site super-user
- if (user_is_super_user()) {
- $this->is_admin = true;
- } else {
- $arr=$this->getPermData();
- if (stristr($arr['admin_flags'],'A')) {
- $this->is_admin = true;
- } else {
- $this->is_admin = false;
- }
- }
- db_free_result($res);
- } else {
- $this->is_admin = false;
- }
- }
- return $this->is_admin;
- }
-
- /**
- * getPermData() - Return an associative array of permissions for this group/user
- *
- * @returns - associative array of permissions
- */
- function getPermData(){
- if ($this->perm_data_array) {
- //have already been through here and set up perms data
- } else {
- if (user_isloggedin()) {
- $res=db_query("SELECT * FROM user_group WHERE user_id='".user_getid()."' and group_id='". $this->getGroupId() ."'");
- if ($res && db_numrows($res) > 0) {
- $this->perm_data_array=db_fetch_array($res);
- } else {
- echo db_error();
- $this->perm_data_array=array();
- }
- db_free_result($res);
- } else {
- $this->perm_data_array=array();
- }
- }
- return $this->perm_data_array;
- }
-
-
- /*
-
-
- Basic functions to add/remove users to/from a group
- and update their permissions
-
-
- */
-
- /**
- * addUser() - controls adding a user to a group
- *
- * @returns true/false
- */
- function addUser($user_unix_name) {
- /*
- Admins can add users to groups
- */
- if (!$this->userIsAdmin()) {
- $this->setError('You Are Not An Admin For This Group');
- return false;
- }
- /*
- get user id for this user's unix_name
- */
- $res_newuser = db_query("SELECT * FROM users WHERE user_name='" . strtolower($user_unix_name) . "'");
-
- if (db_numrows($res_newuser) > 0) {
- //
- // user was found - set new user_id var
- //
- $form_newuid = db_result($res_newuser,0,'user_id');
-
- //
- // if not already a member, add them
- //
- $res_member = db_query("SELECT user_id FROM user_group ".
- "WHERE user_id='$form_newuid' AND group_id='". $this->getGroupId() ."'");
-
- if (db_numrows($res_member) < 1) {
- //
- // user was not already a member
- //
- // if no unix account, give them a unix_uid
- //
- if ( !db_result($res_newuser,0,'unix_uid') ) {
- $user=&user_get_object($form_newuid,$res_newuser);
- $user->setUpUnixUID();
- if (!sf_ldap_create_user($form_newuid)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
-
- } else {
- //
- // User already had unix account
- //
- if (!sf_ldap_check_create_user($form_newuid)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- }
- //
- // Create this user's row in the user_group table
- //
- $res=db_query("INSERT INTO user_group (user_id,group_id) ".
- "VALUES ('$form_newuid','". $this->getGroupId() ."')");
-
- //verify the insert worked
- if (!$res || db_affected_rows($res) < 1) {
- $this->setError('ERROR - Could Not Add User To Group');
- return false;
- }
- //
- // set up their ldap info
- //
- if (!sf_ldap_group_add_user($this->getGroupId(),$form_newuid)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
-
- } else {
- //
- // user was already a member
- // make sure they are set up with a unix_uid,
- // LDAP entry and membership
- //
- $user=&user_get_object($form_newuid,$res_newuser);
- if (!$user->setUpUnixUID()) {
- $this->setError('ERROR: could not set up unix_uid for user: '.$user->getErrorMessage());
- return false;
- } else {
- $user->refreshUserData();
- if (!sf_ldap_check_create_user($form_newuid)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- if (!sf_ldap_group_add_user($this->getGroupId(),$form_newuid)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- return true;
- }
- }
- } else {
- //
- // user doesn't exist
- //
- $this->setError('ERROR: That user does not exist on SourceForge');
- return false;
- }
- //
- // audit trail
- //
- $this->addHistory('Added User',$user_unix_name);
- return true;
- }
-
- /**
- * removeUser() - controls removing a user from a group
- *
- * Users can remove themselves
- * @returns true/false
- */
- function removeUser($user_id) {
- if ($user_id==user_getid()) {
- //users can remove themselves
- //everyone else must be a project admin
- } else if (!$this->userIsAdmin()) {
- $this->setError('You Are Not An Admin For This Group');
- return false;
- }
-
- $res=db_query("SELECT * FROM user_group ".
- "WHERE group_id='".$this->getGroupId()."' AND user_id='$user_id' AND admin_flags = 'A'");
- if (db_numrows($res) > 0) {
- $this->setError('Cannot remove admin');
- return false;
- }
-
- //
- // remove user LDAP entry
- //
- if (!sf_ldap_group_remove_user($this->getGroupId(),$user_id)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
-
- $res=db_query("DELETE FROM user_group ".
- "WHERE group_id='".$this->getGroupId()."' AND user_id='$user_id' AND admin_flags <> 'A'");
- if (!$res || db_affected_rows($res) < 1) {
- $this->setError('ERROR: DB: User not removed.');
- return false;
- } else {
- //audit trail
- $this->addHistory('removed user',$user_id);
- return true;
- }
- }
-
- /**
- * updateUser() - controls updating a user's perms in this group
- *
- * @returns true/false
- */
- function updateUser($user_id,$admin_flags='',$bug_flags=1,$forum_flags=0,$project_flags=1,$patch_flags=1,$support_flags=1,$doc_flags=0,$cvs_flags=1,$release_flags=1,$member_role=100) {
- if (!$this->userIsAdmin()) {
- $this->setError('You Are Not An Admin For This Group');
- return false;
- }
-
- if (user_getid() == $user_id) {
- $admin_flags='A';
- }
-
- //
- // If user acquired admin access to CVS,
- // one to be given normal shell on CVS machine,
- // else - restrictted.
- //
- if ($cvs_flags>1) {
- if (!sf_ldap_user_set_attribute($user_id,"x-cvsShell","/bin/bash")) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- } else {
- if (!sf_ldap_user_set_attribute($user_id,"x-cvsShell","/bin/cvssh")) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- }
-
- //
- // If user acquired at least commit access to CVS,
- // one to be promoted to CVS group, else, demoted.
- //
- if ($cvs_flags>0) {
- if (!sf_ldap_group_add_user($this->getGroupId(),$user_id,1)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- } else {
- if (!sf_ldap_group_remove_user($this->getGroupId(),$user_id,1)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
- }
-
- $res = db_query('UPDATE user_group SET '
- ."admin_flags='$admin_flags',"
- ."bug_flags='$bug_flags',"
- ."forum_flags='$forum_flags',"
- ."project_flags='$project_flags', "
- ."doc_flags='$doc_flags', "
- ."patch_flags='$patch_flags', "
- ."support_flags='$support_flags', "
- ."cvs_flags='$cvs_flags', "
- ."release_flags='$release_flags', "
- ."member_role='$member_role' "
- ."WHERE user_id='$user_id' AND group_id='". $this->getGroupId() ."'");
-
- if (!$res) {
- $this->setError('ERROR: Could Not Change Member Permissions');
- return false;
- }
- return true;
- }
-
- /**
- * addHistory() - Makes an audit trail entry for this project
- *
- * @returns database result handle
- */
- function addHistory ($field_name,$old_value) {
- $sql="insert into group_history(group_id,field_name,old_value,mod_by,date) ".
- "VALUES ('". $this->getGroupId() ."','$field_name','$old_value','". user_getid() ."','".time()."')";
- return db_query($sql);
- }
-
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Project.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Project.class 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Project.class 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,179 +0,0 @@
-<?php
-
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: Project.class,v 1.21 2000/11/03 19:03:35 tperdue Exp $
-
-
-/*
-
- An object wrapper for project (as opposed to foundry) data
-
- Extends the base object, Group
-
- Tim Perdue, August 28, 2000
-
-
-
- Example of proper use:
-
- //get a local handle for the object
- $grp=project_get_object($group_id);
-
- //now use the object to get the unix_name for the project
- $grp->getUnixName();
-
-
-*/
-
-
-
-/*
- associative array of group objects
- helps prevent the same object from being created more than once
- which would create unnecessary database calls
-*/
-
-function &project_get_object($group_id) {
- return group_get_object($group_id);
-}
-
-class Project extends Group {
-
- var $project_data_array;
-
- /*
- basically just call the parent to set up everything
- */
- function Project($id,$res=false) {
- //echo "\n\nRows: ".db_numrows($res);
- $this->Group($id,$res);
-
- //for right now, just point our prefs array at Group's data array
- //this will change later when we split the project_data table off from groups table
- $this->project_data_array=$this->data_array;
- }
-
-
- function usesCVS() {
- return $this->project_data_array['use_cvs'];
- }
-
- function usesBugs() {
- return $this->project_data_array['use_bugs'];
- }
-
- function usesBugDependencies() {
- return $this->project_data_array['use_bug_depend_box'];
- }
-
- function usesSupport() {
- return $this->project_data_array['use_support'];
- }
-
- function usesPatch() {
- return $this->project_data_array['use_patch'];
- }
-
- function usesPm() {
- return $this->project_data_array['use_pm'];
- }
-
- function usesPmDependencies() {
- return $this->project_data_array['use_pm_depend_box'];
- }
-
-
- /*
- email address to send new
- bugs/patches/support requests to
- */
- function getNewBugAddress() {
- return $this->project_data_array['new_bug_address'];
- }
-
- function getNewSupportAddress() {
- return $this->project_data_array['new_support_address'];
- }
-
- function getNewPatchAddress() {
- return $this->project_data_array['new_patch_address'];
- }
-
- function getNewTaskAddress() {
- return $this->project_data_array['new_task_address'];
- }
-
-
- /*
-
- boolean flags to determine whether or not to send
- an email on every bug/patch/support update
-
- */
- function sendAllBugUpdates() {
- return $this->project_data_array['send_all_bugs'];
- }
-
- function sendAllSupportUpdates() {
- return $this->project_data_array['send_all_support'];
- }
-
- function sendAllPatchUpdates() {
- return $this->project_data_array['send_all_patches'];
- }
-
- function sendAllTaskUpdates() {
- return $this->project_data_array['send_all_tasks'];
- }
-
-
- /*
-
- Project-specific permissions in addition
- to those inherited from Group
-
- */
-
- function userIsBugAdmin() {
- return $this->userIsMember('bug_flags',2);
- }
- function userIsSupportAdmin() {
- return $this->userIsMember('support_flags',2);
- }
- function userIsPatchAdmin() {
- return $this->userIsMember('patch_flags',2);
- }
- function userIsPMAdmin() {
- return $this->userIsMember('project_flags',2);
- }
-}
-
-/*
-
- Everything below here is deprecated
-
-*/
-
-//deprecated
-function group_getname ($group_id = 0) {
- $grp = &group_get_object($group_id);
- return $grp->getPublicName();
-}
-
-//deprecated
-function group_getunixname ($group_id) {
- $grp = &group_get_object($group_id);
- return $grp->getUnixName();
-}
-
-//deprecated - should be getting objects instead
-function &group_get_result($group_id=0) {
- $grp = &group_get_object($group_id);
- return $grp->getData();
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/User.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/User.class 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/User.class 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,752 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: User.class,v 1.27 2000/12/14 02:08:29 tperdue Exp $
-
-
-/*
-
- User object by Tim Perdue, October 11, 2000
-
- Sets up database results and preferences for a user and abstracts this info
-
- GENERALLY YOU SHOULD NEVER INSTANTIATE THIS OBJECT DIRECTLY
- USE user_get_object() to instantiate properly - this will pool the objects
- and increase efficiency
-
-*/
-
-
-/**
- *
- * You can now optionally pass in a db result
- * handle. If you do, it re-uses that query
- * to instantiate the objects
- *
- * IMPORTANT! That db result must contain all fields
- * from users table or you will have problems
- *
- */
-$USER_OBJ=array();
-
-/**
- *
- * user_get_object is useful so you can pool user objects/save database queries
- * You should always use this instead of instantiating the object directly
- *
- * @param user_unix_name required
- * @param res result set handle ("SELECT * FROM USERS WHERE user_id=xx")
- * @returns a user object or false on failure
- *
- */
-
-function &user_get_object_by_name($user_name,$res=false) {
- if (!$res) {
- $res=db_query("SELECT * FROM users WHERE user_name='$user_name'");
- }
- return user_get_object(db_result($res,0,'user_id'),$res);
-}
-
-/**
- *
- * user_get_object is useful so you can pool user objects/save database queries
- * You should always use this instead of instantiating the object directly
- *
- * @param user_id required
- * @param res result set handle ("SELECT * FROM USERS WHERE user_id=xx")
- * @returns a user object or false on failure
- *
- */
-
-function &user_get_object($user_id,$res=false) {
- //create a common set of group objects
- //saves a little wear on the database
-
- //automatically checks group_type and
- //returns appropriate object
-
- global $USER_OBJ;
- if (!isset($USER_OBJ["_".$user_id."_"])) {
- if ($res) {
- //the db result handle was passed in
- } else {
- $res=db_query("SELECT * FROM users WHERE user_id='$user_id'");
- }
- if (!$res || db_numrows($res) < 1) {
- $USER_OBJ["_".$user_id."_"]=false;
- } else {
- $USER_OBJ["_".$user_id."_"]= new User($user_id,$res);
- }
- }
- return $USER_OBJ["_".$user_id."_"];
-}
-
-class User extends Error {
- //associative array of data from db
- var $data_array;
-
- var $user_id;
-
- //database result set handle
- var $db_result;
-
- //is this person a site super-admin?
- var $is_super_user;
-
- //is this person the logged in user?
- var $is_logged_in;
-
- //array of preferences
- var $user_pref;
-
- /**
- * User($id,$res) - CONSTRUCTOR - GENERALLY DON'T USE THIS
- *
- * instead use the user_get_object() function call
- * @param $id required - user_id
- * @param $res optional - database result set
- */
- function User($id,$res=false) {
- $this->Error();
- $this->user_id=$id;
- if (!$res) {
- $this->db_result=db_query("SELECT * FROM users WHERE user_id='$id'");
- } else {
- $this->db_result=$res;
- }
- if (db_numrows($this->db_result) < 1) {
- //function in class we extended
- $this->setError('User Not Found');
- $this->data_array=array();
- } else {
- //set up an associative array for use by other functions
-
- db_reset_result($this->db_result);
-
- $this->data_array=db_fetch_array($this->db_result);
- }
- $this->user_id=$this->data_array['user_id'];
- $this->is_super_user=false;
- $this->is_logged_in=false;
- }
-
-
- /**
- * getData() - Return database result handle for direct access
- *
- * Generally should NOT be used - here for supporting deprecated group.php
- * @returns database result set handle
- */
- function getData() {
- db_reset_result($this->db_result);
- return $this->db_result;
- }
-
- /**
- * refreshUserData() - May need to refresh database fields
- *
- * if an update occurred and you need to access the updated info
- */
- function refreshUserData() {
- $this->db_result=db_query("SELECT * FROM users WHERE user_id='". $this->getUserId() ."'");
- $this->data_array=db_fetch_array($this->db_result);
- }
-
- /**
- * getUserId() - Simply return the user_id for this object
- *
- * @returns this user's user_id number
- */
- function getUserId() {
- return $this->user_id;
- }
-
- /**
- * getStatus()
- *
- * Statuses include P,A,D
- * @returns this user's status flag
- */
- function getStatus() {
- return $this->data_array['status'];
- }
-
- /**
- * isActive()
- *
- * Database field status of 'A' returns true
- * @returns true or false
- */
- function isActive() {
- if ($this->getStatus()=='A') {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * getUnixStatus() - Status of activation of unix account
- *
- * @returns (N)one, (A)ctive, (S)uspended or (D)eleted
- */
- function getUnixStatus() {
- return $this->data_array['unix_status'];
- }
-
- /**
- * setUnixStatus() - Sets status of activation of unix account
- *
- * @returns true/false
- */
- function setUnixStatus($status) {
- $res=db_query("UPDATE users ".
- "SET unix_status='$status' ".
- "WHERE user_id='". $this->getUserId()."'");
-
- if (!$res) {
- $this->setError('ERROR - Could Not Update User Unix Status');
- return false;
- } else {
- $this->data_array['unix_status']=$status;
- return true;
- }
- }
-
- /**
- * getUnixName()
- *
- * @returns this user's unix/login name
- */
- function getUnixName() {
- return strtolower($this->data_array['user_name']);
- }
-
- /**
- * getUnixPasswd()
- *
- * @returns this user's unix crypted passwd
- */
- function getUnixPasswd() {
- return $this->data_array['unix_pw'];
- }
-
- /**
- * getMD5Passwd()
- *
- * @returns this user's MD5-crypted passwd
- */
- function getMD5Passwd() {
- return $this->data_array['user_pw'];
- }
-
- /**
- * getEmail()
- *
- * @returns this user's email address
- */
- function getEmail() {
- return $this->data_array['email'];
- }
-
- /**
- * setEmail()
- *
- * @sets user's email address
- */
- function setEmail($email) {
- $res=db_query("UPDATE users ".
- "SET email='$email' ".
- "WHERE user_id='". $this->getUserId()."'");
-
- if (!$res) {
- $this->setError('ERROR - Could Not Update User Email');
- return false;
- } else {
- $this->data_array['email']=$email;
- return true;
- }
- }
-
- /**
- * getRealName()
- *
- * @returns this user's timezone setting
- */
- function getRealName() {
- return $this->data_array['realname'];
- }
-
- /**
- * getAddDate()
- *
- * @returns this user's unix time since account was opened
- */
- function getAddDate() {
- return $this->data_array['add_date'];
- }
-
- /**
- * getTimeZone()
- *
- * @returns this user's timezone setting
- */
- function getTimeZone() {
- return $this->data_array['timezone'];
- }
-
- /**
- * getShell()
- *
- * @returns this user's preferred shell
- */
- function getShell() {
- return $this->data_array['shell'];
- }
-
- /**
- * setShell()
- *
- * @sets user's preferred shell
- */
- function setShell($shell) {
- if (!sf_ldap_user_set_attribute($this->getUserId(),"loginShell",$shell)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
-
- $res=db_query("UPDATE users ".
- "SET shell='$shell' ".
- "WHERE user_id='". $this->getUserId()."'");
-
- if (!$res) {
- $this->setError('ERROR - Could Not Update User Unix Shell');
- return false;
- } else {
- $this->data_array['shell']=$shell;
- return true;
- }
- }
-
- /**
- * getUnixUid()
- *
- * @returns this user's unix_uid
- */
- function getUnixUID() {
- return $this->data_array['unix_uid'];
- }
-
- /**
- * getLanguage()
- *
- * @returns this user's language_id
- */
- function getLanguage() {
- return $this->data_array['language_id'];
- }
-
- /**
- * setLoggedIn($val) - Really only used by session code
- *
- * @param $val optional
- */
- function setLoggedIn($val=true) {
- $this->is_logged_in=$val;
- if ($val) {
- //if this is the logged in user -
- //see if they are a super user
- $sql="SELECT * FROM user_group ".
- "WHERE user_id='". $this->getUserId() ."' AND group_id='1' AND admin_flags='A'";
- $result=db_query($sql);
- if (!$result || db_numrows($result) < 1) {
- $this->is_super_user=false;
- } else {
- $this->is_super_user=true;
- }
- }
- }
-
- /**
- * isLoggedIn()
- *
- * @returns true or false
- */
- function isLoggedIn() {
- return $this->is_logged_in;
- }
-
- /**
- * isSuperUser()
- *
- * @returns true or false
- */
- function isSuperUser() {
- return $this->is_super_user;
- }
-
- /**
- * setPreference($preference_name,$value)
- *
- * @param $preference_name the unique field name for this preference
- * @param $value the value you are setting this preference to
- * @returns true or false on failure
- */
- function setPreference($preference_name,$value) {
- $preference_name=strtolower(trim($preference_name));
- $result=db_query("UPDATE user_preferences SET preference_value='$value',set_date='". time() ."' ".
- "WHERE user_id='". $this->getUserId() ."' ".
- "AND preference_name='$preference_name'");
- if (db_affected_rows($result) < 1) {
- //echo db_error();
- $result=db_query("INSERT INTO user_preferences (user_id,preference_name,preference_value,set_date) ".
- "VALUES ('". $this->getUserId() ."','$preference_name','$value','". time() ."')");
- return $result;
- }
- }
-
- /**
- * getPreference($preference_name)
- *
- * @param $preference_name the unique field name for this preference
- * @returns the preference or false on failure
- */
- function getPreference($preference_name) {
- $preference_name=strtolower(trim($preference_name));
- /*
- First check to see if we have already fetched the preferences
- */
- if ($this->user_pref) {
- //echo "\n\nPrefs were fetched already";
- if ($this->user_pref["$preference_name"]) {
- //we have fetched prefs - return part of array
- return $this->user_pref["$preference_name"];
- } else {
- //we have fetched prefs, but this pref hasn't been set
- return false;
- }
- } else {
- //we haven't returned prefs - go to the db
- $result=db_query("SELECT preference_name,preference_value FROM user_preferences ".
- "WHERE user_id='". $this->getUserId() ."'");
- if (db_numrows($result) < 1) {
- // echo "\n\nNo Prefs Found";
- return false;
- } else {
- //$pref=array();
- //iterate and put the results into an array
- for ($i=0; $i<db_numrows($result); $i++) {
- $pref[db_result($result,$i,'preference_name')]=db_result($result,$i,'preference_value');
- }
- $this->user_pref=$pref;
- if ($this->user_pref["$preference_name"]) {
- //we have fetched prefs - return part of array
- return $this->user_pref["$preference_name"];
- } else {
- //we have fetched prefs, but this pref hasn't been set
- return false;
- }
- }
- }
- }
-
- /**
- * setUpUnixUID() - Sets up this user's unix_uid for shell access
- *
- * @returns true on success false on failure
- */
- function setUpUnixUID() {
- global $sys_database_type;
- if ($this->getUnixUID() > 1) {
- //
- // already have unix_uid
- //
- return true;
- }
- //get the next unix uid
-
- /*
- hack to simulate sequences in mysql
- */
- if ($sys_database_type=='mysql') {
- $res=db_query("INSERT INTO unix_uids (id) values ('')");
- $unixid=db_insertid($res,'unix_uids','id');
- db_free_result($res);
- } else {
- $res=db_query("SELECT nextval('unix_uid_seq')");
- $unixid=db_result($res,0,0);
- db_free_result($res);
- }
- if (!$unixid) {
- $this->setError('ERROR - Could Not Get Next Unix UID');
- return false;
- } else {
- $res=db_query("UPDATE users ".
- "SET unix_status='A',unix_uid='$unixid' ".
- "WHERE user_id='". $this->getUserId()."'");
-
- if (!$res || db_affected_rows($res) < 1) {
- $this->setError('ERROR - Could Not Update User Account Flags');
- return false;
- } else {
- $this->data_array['unix_uid']=$unixid;
- return true;
- }
- }
- }
-
- /**
- * setPasswd($passwd) - Changes user's password
- *
- * @returns true on success false on failure
- */
- function setPasswd($passwd) {
- $unix_pw=account_genunixpw($passwd);
-
- if (!sf_ldap_user_set_attribute($this->getUserId(),"userPassword",'{crypt}'.$unix_pw)) {
- $this->setError(sf_ldap_get_error_msg());
- return false;
- }
-
- $res=db_query("UPDATE users SET user_pw='" . md5($passwd) . "',"
- . "unix_pw='" . $unix_pw . "' WHERE "
- . "user_id=" . $this->getUserId());
-
- if (!$res || db_affected_rows($res) < 1) {
- $this->setError('ERROR - Could Not Change User Password');
- return false;
- } else {
- return true;
- }
- }
-
-}
-
-
-/*
-
-
- Session wrapping code
-
-
-*/
-
-/**
- * user_getid()
- * Get user_id of logged in user
- */
-
-function user_getid() {
- global $G_SESSION;
- if ($G_SESSION) {
- return $G_SESSION->getUserId();
- } else {
- return false;
- }
-}
-
-/**
- * user_isloggedin()
- * See if user is logged in
- */
-function user_isloggedin() {
- global $G_SESSION;
-
- if ($G_SESSION) {
- return $G_SESSION->isLoggedIn();
- } else {
- return false;
- }
-}
-
-/**
- * user_is_super_user()
- * Check if logged in user is super user
- */
-function user_is_super_user() {
- global $G_SESSION;
- if ($G_SESSION) {
- return $G_SESSION->isSuperUser();
- } else {
- return false;
- }
-}
-
-
-/*
-
-
-
-
- EVERYTHING BELOW HERE IS DEPRECATED
-
-
- DO NOT USE FOR ANY NEW CODE
-
-
-
-*/
-
-
-
-//DEPRECATED
-function user_ismember($group_id,$type=0) {
- if (!user_isloggedin()) {
- return false;
- }
-
- $project=&group_get_object($group_id);
-
- $type=strtoupper($type);
-
- switch ($type) {
- case 'B2' : {
- //bug admin
- return $project->userIsBugAdmin();
- break;
- }
- case 'P2' : {
- //pm admin
- return $project->userIsPMAdmin();
- break;
- }
- case 'C2' : {
- //patch admin
- return $project->userIsPatchAdmin();
- break;
- }
- case 'F2' : {
- //forum admin
- return $project->userIsForumAdmin();
- break;
- }
- case 'S2' : {
- //support admin
- return $project->userIsSupportAdmin();
- break;
- }
- case '0' : {
- //just in this group
- return $project->userIsMember();
- break;
- }
- case 'A' : {
- //admin for this group
- return $project->userIsAdmin();
- break;
- }
- case 'D1' : {
- //document editor
- return $project->userIsDocEditor();
- break;
- }
- case 'R1' : {
- //release technician
- return $project->userIsReleaseTechnician();
- break;
- }
- default : {
- //fubar request
- return false;
- }
- }
- return false;
-}
-
-//deprecated
-function user_getname($user_id = false) {
- // use current user if one is not passed in
- if (!$user_id) {
- if (user_isloggedin()) {
- $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';
- }
- }
-}
-
-//deprecated
-function user_getrealname($user_id) {
- $user=&user_get_object($user_id);
- if ($user) {
- return $user->getUnixName();
- } else {
- return 'Invalid User';
- }
-}
-
-//deprecated
-function user_get_result_set($user_id) {
- $user=&user_get_object($user_id);
- if ($user) {
- return $user->getData();
- } else {
- return false;
- }
-}
-
-//deprecated
-function user_get_result_set_from_unix($user_name) {
- return db_query("SELECT * FROM users WHERE user_name='$user_name'");
-}
-
-//deprecated
-function user_get_timezone() {
- if (user_isloggedin()) {
- $user=&user_get_object(user_getid());
- return $user->getTimeZone();
- } else {
- return false;
- }
-}
-
-//deprecated
-function user_get_language() {
- if (user_isloggedin()) {
- $user=&user_get_object(user_getid());
- return $user->getLanguage();
- } else {
- return false;
- }
-}
-
-//deprecated
-function &user_set_preference($preference_name,$value) {
- if (user_isloggedin()) {
- $user=&user_get_object(user_getid());
- //echo "\n\nSetting Preference: ";
- //$success=$user->setPreference($preference_name,$value);
- //echo $success;
- //return $success;
- return $user->setPreference($preference_name,$value);
- } else {
- return false;
- }
-}
-
-//deprecated
-function &user_get_preference($preference_name) {
- if (user_isloggedin()) {
- $user=&user_get_object(user_getid());
- return $user->getPreference($preference_name);
- } else {
- return false;
- }
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/account.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/account.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/account.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,206 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: account.php,v 1.35 2000/11/03 02:17:32 tperdue Exp $
-//
-// adduser.php - All the forms and functions to manage unix users
-//
-
-/*
-
- Create a new user account
-
- returns user_id/false and $feedback
-
-
-*/
-function account_register_new($unix_name,$realname,$password1,$password2,$email,$language,$timezone,$mail_site,$mail_va,$language_id,$timezone) {
- global $feedback;
-
- if (db_numrows(db_query("SELECT user_id FROM users WHERE user_name LIKE '$unix_name'")) > 0) {
- $feedback .= "That username already exists.";
- return false;
- }
- if (!$unix_name) {
- $feedback .= "You must supply a username.";
- return false;
- }
- if (!$password1) {
- $feedback .= "You must supply a password.";
- return false;
- }
- if ($password1 != $password2) {
- $feedback .= "Passwords do not match.";
- return false;
- }
- if (!account_pwvalid($password1)) {
- $feedback .= ' Password must be at least 6 characters. ';
- return false;
- }
- if (!account_namevalid($unix_name)) {
- $feedback .= ' Invalid Unix Name ';
- return false;
- }
- if (!validate_email($email)) {
- $feedback .= ' Invalid Email Address ';
- return false;
- }
- // if we got this far, it must be good
- $confirm_hash = substr(md5($session_hash . $HTTP_POST_VARS['form_pw'] . time()),0,16);
-
- $result=db_query("INSERT INTO users (user_name,user_pw,unix_pw,realname,email,add_date,"
- . "shell,status,confirm_hash,mail_siteupdates,mail_va,language,timezone) "
- . "VALUES ('$unix_name',".
- "'". md5($password1) . "',".
- "'". account_genunixpw($password1) . "',".
- "'". "$realname',".
- "'$email',".
- "'" . time() . "',".
- "'/bin/cvssh',".
- "'P',".
- "'$confirm_hash',".
- "'". (($mail_site)?"1":"0") . "',".
- "'". (($mail_va)?"1":"0") . "',".
- "'$language_id',".
- "'$timezone')");
- $user_id=db_insertid($result,'users','user_id');
-
- if (!$result || !$user_id) {
- $feedback .= ' Insert Failed '.db_error();
- return false;
- } else {
-
- // send mail
- $message = "Thank you for registering on the SourceForge web site. In order\n"
- . "to complete your registration, visit the following url: \n\n"
- . "<https://". $GLOBALS['HTTP_HOST'] ."/account/verify.php?confirm_hash=$confirm_hash>\n\n"
- . "Enjoy the site.\n\n"
- . " -- the SourceForge staff\n";
-
- mail($email,"SourceForge Account Registration",$message,"From: noreply@".$GLOBALS['HTTP_HOST']);
-
- return $user_id;
- }
-}
-
-function account_pwvalid($pw) {
- if (strlen($pw) < 6) {
- $GLOBALS['register_error'] = "Password must be at least 6 characters.";
- return 0;
- }
- return 1;
-}
-
-function account_namevalid($name) {
- // no spaces
- if (strrpos($name,' ') > 0) {
- $GLOBALS['register_error'] = "There cannot be any spaces in the login name.";
- return 0;
- }
-
- // must have at least one character
- if (strspn($name,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") == 0) {
- $GLOBALS['register_error'] = "There must be at least one character.";
- return 0;
- }
-
- // must contain all legal characters
- //if (strspn($name,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#\$%^&*()-_\\/{}[]<>+=|;:?.,`~")
- if (strspn($name,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_")
- != strlen($name)) {
- $GLOBALS['register_error'] = "Illegal character in name.";
- return 0;
- }
-
- // min and max length
- if (strlen($name) < 3) {
- $GLOBALS['register_error'] = "Name is too short. It must be at least 3 characters.";
- return 0;
- }
- if (strlen($name) > 15) {
- $GLOBALS['register_error'] = "Name is too long. It must be less than 15 characters.";
- return 0;
- }
-
- // illegal names
- if (eregi("^((root)|(bin)|(daemon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)"
- . "|(uucp)|(operator)|(games)|(mysql)|(httpd)|(nobody)|(dummy)"
- . "|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download))$",$name)) {
- $GLOBALS['register_error'] = "Name is reserved.";
- return 0;
- }
- if (eregi("^(anoncvs_)",$name)) {
- $GLOBALS['register_error'] = "Name is reserved for CVS.";
- return 0;
- }
-
- return 1;
-}
-
-function account_groupnamevalid($name) {
- if (!account_namevalid($name)) return 0;
-
- // illegal names
- if (eregi("^((www[0-9]?)|(cvs[0-9]?)|(shell[0-9]?)|(ftp[0-9]?)|(irc[0-9]?)|(news[0-9]?)"
- . "|(mail[0-9]?)|(ns[0-9]?)|(download[0-9]?)|(pub)|(users)|(compile)|(lists)"
- . "|(slayer)|(orbital)|(tokyojoe)|(webdev)|(projects)|(cvs)|(slayer)|(monitor)|(mirrors?))$",$name)) {
- $GLOBALS['register_error'] = "Name is reserved for DNS purposes.";
- return 0;
- }
-
- if (eregi("_",$name)) {
- $GLOBALS['register_error'] = "Group name cannot contain underscore for DNS reasons.";
- return 0;
- }
-
- return 1;
-}
-
-// The following is a random salt generator
-function account_gensalt(){
- function rannum(){
- mt_srand((double)microtime()*1000000);
- $num = mt_rand(46,122);
- return $num;
- }
- function genchr(){
- do {
- $num = rannum();
- } while ( ( $num > 57 && $num < 65 ) || ( $num > 90 && $num < 97 ) );
- $char = chr($num);
- return $char;
- }
-
- $a = genchr();
- $b = genchr();
- $salt = "$1$" . "$a$b";
- return $salt;
-}
-
-// generate unix pw
-function account_genunixpw($plainpw) {
- return crypt($plainpw,account_gensalt());
-}
-
-// print out shell selects
-function account_shellselects($current) {
- $shells = file("/etc/shells");
- $shells[count($shells)] = "/bin/cvssh";
-
- for ($i = 0; $i < count($shells); $i++) {
- $this_shell = chop($shells[$i]);
-
- if ($current == $this_shell) {
- echo "<option selected value=$this_shell>$this_shell</option>\n";
- } else {
- if (! ereg("^#",$this_shell)){
- echo "<option value=$this_shell>$this_shell</option>\n";
- }
- }
- }
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/database.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/database.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/database.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,259 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: database.php,v 1.57 2000/12/07 18:31:26 tperdue Exp $
-//
-
-/*
-
- This is the PostgreSQL version of our
- database connection/querying layer
-
-*/
-
-//$conn - database connection handle
-$sys_db_row_pointer=array(); //current row for each result set
-
-
-/**
- *
- * Connect to the database
- * Notice the global vars that must be set up
- * Sets up a global $conn variable which is used
- * in other functions in this library
- *
- */
-
-function db_connect() {
- global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$conn,$sys_dbname;
- $conn = @pg_pconnect("user=$sys_dbuser dbname=$sys_dbname host=$sys_dbhost password=$sys_dbpasswd");
- #return $conn;
-}
-
-/**
- *
- * Query the database
- *
- * @param qstring - SQL statement
- * @param limit - how many rows do you want returned
- * @param offset - of matching rows, return only rows starting here
- *
- */
-
-function db_query($qstring,$limit='-1',$offset=0) {
- global $QUERY_COUNT;
- $QUERY_COUNT++;
-
- if ($limit > 0) {
- if (!$offset || $offset < 0) {
- $offset=0;
- }
- $qstring=$qstring." LIMIT $limit OFFSET $offset";
- }
-
- if ($GLOBALS['IS_DEBUG'])
- $GLOBALS['G_DEBUGQUERY'] .= $qstring . "<P><BR>\n";
- global $conn;
- return @pg_exec($conn,$qstring);
-}
-
-/**
- * db_begin()
- *
- * begin a transaction
- */
-function db_begin() {
- return db_query("BEGIN WORK");
-}
-
-/**
- * db_commit()
- *
- * commit a transaction
- */
-function db_commit() {
- return db_query("COMMIT");
-}
-
-/**
- * db_rollback()
- *
- * rollback a transaction
- */
-function db_rollback() {
- return db_query("ROLLBACK");
-}
-
-/**
- * db_numrows()
- *
- * Returns the number of rows in this result set
- * @param qhandle query result set handle
- */
-
-function db_numrows($qhandle) {
- return @pg_numrows($qhandle);
-}
-
-/**
- *
- * Frees a database result properly
- *
- * @param qhandle query result set handle
- *
- */
-
-function db_free_result($qhandle) {
- return @pg_freeresult($qhandle);
-}
-
-/**
- *
- * Reset is useful for db_fetch_array
- * sometimes you need to start over
- *
- * @param qhandle query result set handle
- * @param row - integer row number
- *
- */
-
-function db_reset_result($qhandle,$row=0) {
- global $sys_db_row_pointer;
- return $sys_db_row_pointer[$qhandle]=$row;
-}
-
-/**
- *
- * Returns a field from a result set
- *
- * @param qhandle query result set handle
- * @param row - integer row number
- * @param field - text field name
- *
- */
-
-function db_result($qhandle,$row,$field) {
- return @pg_result($qhandle,$row,$field);
-}
-
-/**
- *
- * Returns the number of fields in this result set
- *
- * @param qhandle query result set handle
- *
- */
-
-function db_numfields($lhandle) {
- return @pg_numfields($lhandle);
-}
-
-/**
- *
- * Returns the number of rows changed in the last query
- *
- * @param qhandle - query result set handle
- * @param fnumber - column number
- *
- */
-
-function db_fieldname($lhandle,$fnumber) {
- return @pg_fieldname($lhandle,$fnumber);
-}
-
-/**
- *
- * Returns the number of rows changed in the last query
- *
- * @param qhandle query result set handle
- *
- */
-
-function db_affected_rows($qhandle) {
- return @pg_cmdtuples($qhandle);
-}
-
-/**
- *
- * Returns an associative array from
- * the current row of this database result
- * Use db_reset_result to seek a particular row
- *
- * @param qhandle query result set handle
- *
- */
-
-function db_fetch_array($qhandle) {
- global $sys_db_row_pointer;
- $sys_db_row_pointer[$qhandle]++;
- return @pg_fetch_array($qhandle,($sys_db_row_pointer[$qhandle]-1));
-}
-
-/**
- *
- * Returns the last primary key from an insert
- *
- * @param qhandle query result set handle
- * @param table_name is the name of the table you inserted into
- * @param pkey_field_name is the field name of the primary key
- *
- */
-
-function db_insertid($qhandle,$table_name,$pkey_field_name) {
- $oid=@pg_getlastoid($qhandle);
- if ($oid) {
- $sql="SELECT $pkey_field_name AS id FROM $table_name WHERE oid='$oid'";
- //echo $sql;
- $res=db_query($sql);
- if (db_numrows($res) >0) {
- return db_result($res,0,'id');
- } else {
- // echo "No Rows Matched";
- // echo db_error();
- return 0;
- }
- } else {
-// echo "No OID";
-// echo db_error();
- return 0;
- }
-}
-
-/**
- *
- * Returns the last error from the database
- *
- */
-
-function db_error() {
- global $conn;
- return @pg_errormessage($conn);
-}
-
-function db_drop_table_if_exists ($tn) {
- $sql = "SELECT COUNT(*) FROM pg_class WHERE relname='$tn';";
- $rel = db_query($sql);
- echo db_error();
- $count = db_result($rel,0,0);
- if ($count != 0) {
- $sql = "DROP TABLE $tn;";
- $rel = db_query ($sql);
- echo db_error();
- }
-}
-
-function db_drop_sequence_if_exists ($tn) {
- $sql = "SELECT COUNT(*) FROM pg_class WHERE relname='$tn';";
- $rel = db_query($sql);
- echo db_error();
- $count = db_result($rel,0,0);
- if ($count != 0) {
- $sql = "DROP SEQUENCE $tn;";
- $rel = db_query ($sql);
- echo db_error();
- }
-}
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/ldap.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/ldap.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/ldap.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,424 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// SourceForge LDAP module
-// pfalcon at users.sourceforge.net 2000-10-17
-//
-// $Id: ldap.php,v 1.7 2000/11/22 00:05:51 pfalcon Exp $
-
-
-/*
- * Auxilary functions
- */
-
-/*
- * Error message passing facility
- */
-
-//var $_sf_ldap_error_msg;
-function sf_ldap_set_error_msg($msg) {
- global $_sf_ldap_error_msg;
- $_sf_ldap_error_msg .= $msg;
-}
-function sf_ldap_get_error_msg() {
- global $_sf_ldap_error_msg;
- return $_sf_ldap_error_msg;
-}
-function sf_ldap_reset_error_msg() {
- global $_sf_ldap_error_msg;
- $_sf_ldap_error_msg='';
-}
-
-/*
- * Wrappers for PHP LDAP functions
- */
-
-function sf_ldap_connect() {
- global $sys_ldap_host,$sys_ldap_port;
- global $sys_ldap_bind_dn,$sys_ldap_passwd,$ldap_conn;
-
- if (!$ldap_conn) {
- sf_ldap_reset_error_msg();
- $ldap_conn = @ldap_connect($sys_ldap_host,$sys_ldap_port);
- if (!$ldap_conn) {
- sf_ldap_set_error_msg('ERROR: Cannot connect to LDAP server<br>');
- return false;
- }
- ldap_bind($ldap_conn,$sys_ldap_bind_dn,$sys_ldap_passwd);
- }
- return true;
-}
-
-function sf_ldap_add($dn,$entry) {
- global $ldap_conn;
- return @ldap_add($ldap_conn,$dn,$entry);
-}
-
-function sf_ldap_delete($dn) {
- global $ldap_conn;
- return @ldap_delete($ldap_conn,$dn);
-}
-
-function sf_ldap_modify($dn,$entry) {
- global $ldap_conn;
- return @ldap_modify($ldap_conn,$dn,$entry);
-}
-
-function sf_ldap_mod_add($dn,$entry) {
- global $ldap_conn;
- return @ldap_mod_add($ldap_conn,$dn,$entry);
-}
-
-function sf_ldap_mod_del($dn,$entry) {
- global $ldap_conn;
- return @ldap_mod_del($ldap_conn,$dn,$entry);
-}
-
-function sf_ldap_read($dn,$filter,$attrs=0) {
- global $ldap_conn;
- return @ldap_read($ldap_conn,$dn,$filter,$attrs);
-}
-
-function sf_ldap_error() {
- global $ldap_conn;
- return ldap_error($ldap_conn);
-}
-
-function sf_ldap_errno() {
- global $ldap_conn;
- return ldap_errno($ldap_conn);
-}
-
-function sf_ldap_already_exists() {
- global $ldap_conn;
- return ldap_errno($ldap_conn)==20;
-}
-
-function sf_ldap_does_not_exist() {
- global $ldap_conn;
- return ldap_errno($ldap_conn)==16;
-}
-
-/*
- * User management functions
- */
-
-function sf_ldap_check_user($user_id) {
- global $ldap_conn;
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- if (!sf_ldap_connect()) return false;
- $user = &user_get_object($user_id);
- $dn = 'uid='.$user->getUnixName().',ou=People,'.$sys_ldap_base_dn;
- $res=sf_ldap_read($dn,"objectClass=*",array("uid"));
- if ($res) {
- ldap_free_result($res);
- return true;
- }
- return false;
-}
-
-function sf_ldap_create_user($user_id) {
- $user = &user_get_object($user_id);
-//echo "sf_ldap_create_user(".$user->getUnixName().")<br>";
- return sf_ldap_create_user_from_object($user);
-}
-
-function sf_ldap_check_create_user($user_id) {
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
-//echo "sf_ldap_check_create_user(".$user_id.")<br>";
-
- if (!sf_ldap_check_user($user_id)){
- $user = &user_get_object($user_id);
- return sf_ldap_create_user_from_object($user);
- }
- return true;
-}
-
-function sf_ldap_create_user_from_object(&$user) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
-//echo "sf_ldap_create_user_from_object(".$user->getUnixName().")<br>";
- if (!sf_ldap_connect()) return false;
- $dn = 'uid='.$user->getUnixName().',ou=People,'.$sys_ldap_base_dn;
- $entry['objectClass'][0]='top';
- $entry['objectClass'][1]='account';
- $entry['objectClass'][2]='posixAccount';
- $entry['objectClass'][3]='shadowAccount';
- $entry['objectClass'][4]='x-sourceforgeAccount';
- $entry['uid']=$user->getUnixName();
- $entry['cn']=$user->getRealName();
- $entry['gecos']=$user->getRealName();
- $entry['userPassword']='{crypt}'.$user->getUnixPasswd();
- $entry['homeDirectory']="/home/users/".$user->getUnixName();
- $entry['loginShell']=$user->getShell();
- $entry['x-cvsShell']="/bin/cvssh"; // unless explicitly set otherwise, developer has write access
- $entry['uidNumber']=$user->getUnixUID();
- $entry['gidNumber']=100; // users
- $entry['shadowLastChange']=0; // TODO FIXME
- $entry['shadowMax']=99999;
- $entry['shadowWarning']=7;
-
- if (!sf_ldap_add($dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot add LDAP user entry '".
- $user->getUnixName()."': ".sf_ldap_error()."<br>");
- return false;
- }
- return true;
-}
-
-function sf_ldap_remove_user($user_id) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $user = &user_get_object($user_id);
-//echo "sf_ldap_remove_user(".$user->getUnixName().")<br>";
- if (!sf_ldap_connect()) return false;
- $dn = 'uid='.$user->getUnixName().',ou=People,'.$sys_ldap_base_dn;
-
- if (!sf_ldap_delete($dn)) {
- sf_ldap_set_error_msg("ERROR: cannot delete LDAP user entry '".
- $user->getUnixName()."': ".sf_ldap_error()."<br>");
- return false;
- }
- return true;
-}
-
-function sf_ldap_user_set_attribute($user_id,$attr,$value) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $user = &user_get_object($user_id);
-//echo "sf_ldap_user_set_attribute(".$user->getUnixName().",".$attr.",".$value.")<br>";
- if (!sf_ldap_connect()) return false;
- $dn = 'uid='.$user->getUnixName().',ou=People,'.$sys_ldap_base_dn;
- $entry[$attr]=$value;
-
- if (!sf_ldap_modify($dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot change LDAP attribute '$attr' for user '".
- $user->getUnixName()."': ".sf_ldap_error()."<br>");
- return false;
- }
- return true;
-}
-
-/*
- * Group management functions
- */
-
-function sf_ldap_check_group($group_id) {
- global $ldap_conn;
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $group = &group_get_object($group_id);
-//echo "sf_ldap_check_group(".$group->getUnixName().")";
- if (!sf_ldap_connect()) return false;
- $dn = 'cn='.$group->getUnixName().',ou=Group,'.$sys_ldap_base_dn;
- $res=sf_ldap_read($dn,"objectClass=*",array("cn"));
- if ($res) {
- ldap_free_result($res);
- return true;
- }
- return false;
-}
-
-function sf_ldap_create_group($group_id,$with_members=1) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $group = &group_get_object($group_id);
-//echo "sf_ldap_create_group(".$group->getUnixName().",$with_members)<br>";
- if (!sf_ldap_connect()) return false;
- $dn = 'cn='.$group->getUnixName().',ou=Group,'.$sys_ldap_base_dn;
- $entry['objectClass'][0]='top';
- $entry['objectClass'][1]='posixGroup';
- $entry['cn']=$group->getUnixName();
- $entry['userPassword']='{crypt}x';
- $entry['gidNumber']=$group->getGroupId();
-
- if ($with_members) {
-//echo "adding members:<br>";
- $res=db_query("SELECT users.user_name,user_group.cvs_flags ".
- "FROM users,user_group ".
- "WHERE user_group.group_id=".$group->getGroupId().
- " AND user_group.user_id=users.user_id");
-
- $i=0; $i_cvs=0;
- while ($user_row=db_fetch_array($res)) {
-//echo "+",$user_row[user_name],"<br>";
- $entry['memberUid'][$i++]=$user_row[user_name];
- if ($user_row[cvs_flags]>0) {
- $cvs_member_list[$i_cvs++]=$user_row[user_name];
- }
- }
- }
-
- $ret_val=true;
-
- if (!sf_ldap_add($dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot add LDAP group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- // If there's error, that's bad. But don't stop.
- $ret_val=false;
- }
-
- //
- // Now create CVS group
- //
-
- $dn = 'cn='.$group->getUnixName().',ou=cvsGroup,'.$sys_ldap_base_dn;
- if ($cvs_member_list) $entry['memberUid']=$cvs_member_list;
- else unset($entry['memberUid']);
- if (!sf_ldap_add($dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot add LDAP CVS group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- $ret_val=false;
- }
-
- return $ret_val;
-}
-
-function sf_ldap_remove_group($group_id) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $group = &group_get_object($group_id);
-//echo "sf_ldap_remove_group(".$group->getUnixName().")<br>";
- if (!sf_ldap_connect()) return false;
-
- //
- // Remove shell LDAP group
- //
- $ret_val=true;
-
- $dn = 'cn='.$group->getUnixName().',ou=Group,'.$sys_ldap_base_dn;
- if (!sf_ldap_delete($dn)) {
- sf_ldap_set_error_msg("ERROR: cannot delete LDAP group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- $ret_val=false;
- }
-
- //
- // Remove CVS LDAP group
- //
- $dn = 'cn='.$group->getUnixName().',ou=cvsGroup,'.$sys_ldap_base_dn;
- if (!sf_ldap_delete($dn)) {
- sf_ldap_set_error_msg("ERROR: cannot delete LDAP cvs group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- $ret_val=false;
- }
-
- return $ret_val;
-}
-
-function sf_ldap_group_add_user($group_id,$user_id,$cvs_only=0) {
- global $ldap_conn;
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $group = &group_get_object($group_id);
- $user = &user_get_object($user_id);
- if (!sf_ldap_connect()) return false;
- $dn = 'cn='.$group->getUnixName().',ou=Group,'.$sys_ldap_base_dn;
- $cvs_dn = 'cn='.$group->getUnixName().',ou=cvsGroup,'.$sys_ldap_base_dn;
- $entry['memberUid']=$user->getUnixName();
-
- //
- // Check if user already a member of CVS group
- //
- $res=sf_ldap_read($cvs_dn,"memberUid=".$user->getUnixName(),array("cn"));
- if ($res && ldap_count_entries($ldap_conn,$res)>0) {
-//echo "already a member of CVS<br>";
- } else {
- //
- // No, add one
- //
-
- if (!sf_ldap_mod_add($cvs_dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot add member to LDAP CVS group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- return false;
- }
- }
- ldap_free_result($res);
-
- if ($cvs_only) return true;
-
- //
- // Check if user already a member of shell group
- //
- $res=sf_ldap_read($dn,"memberUid=".$user->getUnixName(),array("cn"));
- if ($res && ldap_count_entries($ldap_conn,$res)>0) {
-//echo "already a member<br>";
- } else {
- //
- // No, add one
- //
-
- if (!sf_ldap_mod_add($dn,$entry)) {
- sf_ldap_set_error_msg("ERROR: cannot add member to LDAP group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."<br>");
- return false;
- }
- }
- ldap_free_result($res);
-
- return true;
-}
-
-function sf_ldap_group_remove_user($group_id,$user_id,$cvs_only=0) {
- global $sys_ldap_base_dn;
-
- global $sys_use_ldap;
- if (!$sys_use_ldap) return true;
-
- $group = &group_get_object($group_id);
- $user = &user_get_object($user_id);
- if (!sf_ldap_connect()) return false;
- $dn = 'cn='.$group->getUnixName().',ou=Group,'.$sys_ldap_base_dn;
- $cvs_dn = 'cn='.$group->getUnixName().',ou=cvsGroup,'.$sys_ldap_base_dn;
- $entry['memberUid']=$user->getUnixName();
-
- $ret_val=true;
- if (!sf_ldap_mod_del($cvs_dn,$entry) && !sf_ldap_does_not_exist()) {
- sf_ldap_set_error_msg("ERROR: cannot remove member from LDAP CVS group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."(".sf_ldap_errno().")"."<br>");
- $ret_val=false;
- }
-
- if ($cvs_only) return $ret_val;
-
- if (!sf_ldap_mod_del($dn,$entry) && !sf_ldap_does_not_exist()) {
- sf_ldap_set_error_msg("ERROR: cannot remove member from LDAP group entry '".
- $group->getUnixName()."': ".sf_ldap_error()."(".sf_ldap_errno().")"."<br>");
- $ret_val=false;
- }
-
- return $ret_val;
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/session.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/session.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/session.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,227 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: session.php,v 1.126 2000/12/05 19:10:49 tperdue Exp $
-//
-
-//G_SESSION is now a User object if user is logged in
-$G_SESSION=false;
-
-function session_login_valid($form_loginname,$form_pw,$allowpending=0) {
- global $session_hash,$feedback;
-
- if (!$form_loginname || !$form_pw) {
- $feedback = 'Missing Password Or users Name';
- return false;
- }
-
- //get the users from the database using user_id and password
- $res = db_query("SELECT user_id,status FROM users WHERE "
- . "user_name='$form_loginname' "
- . "AND user_pw='" . md5($form_pw) . "'");
- if (!$res || db_numrows($res) < 1) {
- //invalid password or user_name
- $feedback='Invalid Password Or user Name';
- return false;
- } else {
- // check status of this user
- $usr = db_fetch_array($res);
-
- // if allowpending (for verify.php) then allow
- if ($allowpending && ($usr['status'] == 'P')) {
- //1;
- } else {
- if ($usr['status'] == 'S') {
- //acount suspended
- $feedback = 'Account Suspended';
- return false;
- }
- if ($usr['status'] == 'P') {
- //account pending
- $feedback = 'Account Pending';
- return false;
- }
- if ($usr['status'] == 'D') {
- //account deleted
- $feedback = 'Account Deleted';
- return false;
- }
- if ($usr['status'] != 'A') {
- //unacceptable account flag
- $feedback = 'Account Not Active';
- return false;
- }
- }
- //create a new session
- session_set_new(db_result($res,0,'user_id'));
-
- return true;
- }
-}
-
-function session_checkip($oldip,$newip) {
- $eoldip = explode(".",$oldip);
- $enewip = explode(".",$newip);
-
- // ## require same class b subnet
- if (($eoldip[0]!=$enewip[0])||($eoldip[1]!=$enewip[1])) {
- return 0;
- } else {
- return 1;
- }
-}
-
-function session_issecure() {
- return (getenv('SERVER_PORT') == '443');
-}
-
-function session_cookie($n,$v) {
- setcookie($n,$v,0,'/','',0);
-}
-
-function session_redirect($loc) {
- header('Location: http' . (session_issecure()?'s':'') . '://' . getenv('HTTP_HOST') . $loc);
- print("\n\n");
- exit;
-}
-
-/**
- *
- * Method of easily enforcing permissions
- * Page will terminate with error message if you fail checks
- *
- */
-
-function session_require($req) {
- if (!user_isloggedin()) {
- exit_permission_denied();
- }
-
- /*
- SF Admins always have permission
- */
- if (user_is_super_user()) {
- return true;
- }
-
- if ($req['group']) {
- $group=&group_get_object($req['group']);
- if (!$group) {
- exit_no_group();
- }
- if ($req['admin_flags']) {
- //$query .= " AND admin_flags = '$req[admin_flags]'";
- if (!$group->userIsAdmin()) {
- exit_permission_denied();
- }
- } else {
- if (!$group->userIsMember()) {
- exit_permission_denied();
- }
- }
- } else if ($req['isloggedin']) {
- //no need to check as long as the check is present at top of function
- } else {
- exit_permission_denied();
- }
-}
-
-function session_set_new($user_id) {
- global $G_SESSION;
- // concatinate current time, and random seed for MD5 hash
- // continue until unique hash is generated (SHOULD only be once)
-
- $pre_hash = time() . rand() . $GLOBALS['REMOTE_ADDR'] . microtime();
- $GLOBALS['session_hash'] = md5($pre_hash);
-
- // set session cookie
- session_cookie("session_hash",$GLOBALS['session_hash']);
-
- // make new session entries into db
- db_query("INSERT INTO session (session_hash, ip_addr, time,user_id) VALUES "
- . "('$GLOBALS[session_hash]','$GLOBALS[REMOTE_ADDR]'," . time() . ",'$user_id')");
-
- //
- // check uniqueness of the session_hash in the database
- //
- $res=session_getdata($GLOBALS['session_hash']);
-
- if (!$res || db_numrows($res) < 1) {
- exit_error("ERROR","ERROR - SESSION HASH NOT FOUND IN DATABASE: ".db_error());
- } elseif (db_numrows($res) > 1) {
- //somehow, more than one entry in database...
- db_query("DELETE FROM session WHERE session_hash='$GLOBALS[session_hash]'");
- exit_error("ERROR","ERROR - two people had the same hash - backarrow and re-login. It should never happen again");
- } else {
- //set up the new user object
-
- $G_SESSION = user_get_object($user_id,$res);
- if ($G_SESSION) {
- $G_SESSION->setLoggedIn(true);
- }
- }
-}
-
-function session_getdata($session_hash) {
- //
- // important - this must be updated with new
- // columns from the users, themes tables
- //
- $res=db_query("SELECT s.session_hash, s.ip_addr, s.time,
-
- u.user_id, u.user_name, u.email, u.user_pw,
- u.realname, u.status, u.shell, u.unix_pw, u.unix_status,
- u.unix_uid, u.unix_box, u.add_date, u.confirm_hash,
- u.mail_siteupdates, u.mail_va, u.authorized_keys,
- u.email_new, u.people_view_skills, u.people_resume, u.timezone,
-
- sl.language_id, sl.name, sl.filename, sl.classname, sl.language_code
-
- FROM users u,
- supported_languages sl,
- session s
- WHERE u.language=sl.language_id
- AND s.user_id=u.user_id
- AND s.session_hash='$session_hash'");
- return $res;
-}
-
-function session_set() {
- global $G_SESSION;
-
- // assume bad session_hash and session. If all checks work, then allow
- // otherwise make new session
- $id_is_good = false;
-
- // here also check for good hash, set if new session is needed
- if ($GLOBALS['session_hash']) {
- $result=session_getdata($GLOBALS['session_hash']);
-
- // does hash exist?
- if (db_numrows($result) > 0) {
- if (session_checkip(db_result($result,0,'ip_addr'),$GLOBALS['REMOTE_ADDR'])) {
- $id_is_good = true;
- } else {
- $id_is_good = false;
- session_cookie('session_hash','');
- }
- } else {
- $id_is_good = false;
- session_cookie('session_hash','');
- }
- } // else (hash does not exist) or (session hash is bad)
-
- if ($id_is_good) {
- $G_SESSION=user_get_object(db_result($result,0,'user_id'),$result);
- if ($G_SESSION) {
- $G_SESSION->setLoggedIn(true);
- }
- } else {
- $G_SESSION=false;
- }
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/timezones.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/timezones.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/timezones.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,471 +0,0 @@
-<?php
-
-$TZs[]='US/Alaska';
-$TZs[]='US/Aleutian';
-$TZs[]='US/Arizona';
-$TZs[]='US/Central';
-$TZs[]='US/Eastern';
-$TZs[]='US/East-Indiana';
-$TZs[]='US/Hawaii';
-$TZs[]='US/Indiana-Starke';
-$TZs[]='US/Michigan';
-$TZs[]='US/Mountain';
-$TZs[]='US/Pacific';
-$TZs[]='US/Samoa';
-$TZs[]='Africa/Abidjan';
-$TZs[]='Africa/Accra';
-$TZs[]='Africa/Addis_Ababa';
-$TZs[]='Africa/Algiers';
-$TZs[]='Africa/Asmera';
-$TZs[]='Africa/Bamako';
-$TZs[]='Africa/Bangui';
-$TZs[]='Africa/Banjul';
-$TZs[]='Africa/Bissau';
-$TZs[]='Africa/Blantyre';
-$TZs[]='Africa/Brazzaville';
-$TZs[]='Africa/Bujumbura';
-$TZs[]='Africa/Cairo';
-$TZs[]='Africa/Casablanca';
-$TZs[]='Africa/Ceuta';
-$TZs[]='Africa/Conakry';
-$TZs[]='Africa/Dakar';
-$TZs[]='Africa/Dar_es_Salaam';
-$TZs[]='Africa/Djibouti';
-$TZs[]='Africa/Douala';
-$TZs[]='Africa/El_Aaiun';
-$TZs[]='Africa/Freetown';
-$TZs[]='Africa/Gaborone';
-$TZs[]='Africa/Harare';
-$TZs[]='Africa/Johannesburg';
-$TZs[]='Africa/Kampala';
-$TZs[]='Africa/Khartoum';
-$TZs[]='Africa/Kigali';
-$TZs[]='Africa/Kinshasa';
-$TZs[]='Africa/Lagos';
-$TZs[]='Africa/Libreville';
-$TZs[]='Africa/Lome';
-$TZs[]='Africa/Luanda';
-$TZs[]='Africa/Lubumbashi';
-$TZs[]='Africa/Lusaka';
-$TZs[]='Africa/Malabo';
-$TZs[]='Africa/Maputo';
-$TZs[]='Africa/Maseru';
-$TZs[]='Africa/Mbabane';
-$TZs[]='Africa/Mogadishu';
-$TZs[]='Africa/Monrovia';
-$TZs[]='Africa/Nairobi';
-$TZs[]='Africa/Ndjamena';
-$TZs[]='Africa/Niamey';
-$TZs[]='Africa/Nouakchott';
-$TZs[]='Africa/Ouagadougou';
-$TZs[]='Africa/Porto-Novo';
-$TZs[]='Africa/Sao_Tome';
-$TZs[]='Africa/Timbuktu';
-$TZs[]='Africa/Tripoli';
-$TZs[]='Africa/Tunis';
-$TZs[]='Africa/Windhoek';
-$TZs[]='America/Adak';
-$TZs[]='America/Anchorage';
-$TZs[]='America/Anguilla';
-$TZs[]='America/Antigua';
-$TZs[]='America/Araguaina';
-$TZs[]='America/Aruba';
-$TZs[]='America/Asuncion';
-$TZs[]='America/Atka';
-$TZs[]='America/Barbados';
-$TZs[]='America/Belem';
-$TZs[]='America/Belize';
-$TZs[]='America/Boa_Vista';
-$TZs[]='America/Bogota';
-$TZs[]='America/Boise';
-$TZs[]='America/Buenos_Aires';
-$TZs[]='America/Cambridge_Bay';
-$TZs[]='America/Cancun';
-$TZs[]='America/Caracas';
-$TZs[]='America/Catamarca';
-$TZs[]='America/Cayenne';
-$TZs[]='America/Cayman';
-$TZs[]='America/Chicago';
-$TZs[]='America/Chihuahua';
-$TZs[]='America/Cordoba';
-$TZs[]='America/Costa_Rica';
-$TZs[]='America/Cuiaba';
-$TZs[]='America/Curacao';
-$TZs[]='America/Dawson';
-$TZs[]='America/Dawson_Creek';
-$TZs[]='America/Denver';
-$TZs[]='America/Detroit';
-$TZs[]='America/Dominica';
-$TZs[]='America/Edmonton';
-$TZs[]='America/El_Salvador';
-$TZs[]='America/Ensenada';
-$TZs[]='America/Fortaleza';
-$TZs[]='America/Fort_Wayne';
-$TZs[]='America/Glace_Bay';
-$TZs[]='America/Godthab';
-$TZs[]='America/Goose_Bay';
-$TZs[]='America/Grand_Turk';
-$TZs[]='America/Grenada';
-$TZs[]='America/Guadeloupe';
-$TZs[]='America/Guatemala';
-$TZs[]='America/Guayaquil';
-$TZs[]='America/Guyana';
-$TZs[]='America/Halifax';
-$TZs[]='America/Havana';
-$TZs[]='America/Hermosillo';
-$TZs[]='America/Indiana/Indianapolis';
-$TZs[]='America/Indiana/Knox';
-$TZs[]='America/Indiana/Marengo';
-$TZs[]='America/Indiana/Vevay';
-$TZs[]='America/Indianapolis';
-$TZs[]='America/Inuvik';
-$TZs[]='America/Iqaluit';
-$TZs[]='America/Jamaica';
-$TZs[]='America/Jujuy';
-$TZs[]='America/Juneau';
-$TZs[]='America/Knox_IN';
-$TZs[]='America/La_Paz';
-$TZs[]='America/Lima';
-$TZs[]='America/Los_Angeles';
-$TZs[]='America/Louisville';
-$TZs[]='America/Maceio';
-$TZs[]='America/Managua';
-$TZs[]='America/Manaus';
-$TZs[]='America/Martinique';
-$TZs[]='America/Mazatlan';
-$TZs[]='America/Mendoza';
-$TZs[]='America/Menominee';
-$TZs[]='America/Mexico_City';
-$TZs[]='America/Miquelon';
-$TZs[]='America/Montevideo';
-$TZs[]='America/Montreal';
-$TZs[]='America/Montserrat';
-$TZs[]='America/Nassau';
-$TZs[]='America/New_York';
-$TZs[]='America/Nipigon';
-$TZs[]='America/Nome';
-$TZs[]='America/Noronha';
-$TZs[]='America/Panama';
-$TZs[]='America/Pangnirtung';
-$TZs[]='America/Paramaribo';
-$TZs[]='America/Phoenix';
-$TZs[]='America/Port-au-Prince';
-$TZs[]='America/Porto_Acre';
-$TZs[]='America/Port_of_Spain';
-$TZs[]='America/Porto_Velho';
-$TZs[]='America/Puerto_Rico';
-$TZs[]='America/Rainy_River';
-$TZs[]='America/Rankin_Inlet';
-$TZs[]='America/Regina';
-$TZs[]='America/Rosario';
-$TZs[]='America/Santiago';
-$TZs[]='America/Santo_Domingo';
-$TZs[]='America/Sao_Paulo';
-$TZs[]='America/Scoresbysund';
-$TZs[]='America/Shiprock';
-$TZs[]='America/St_Johns';
-$TZs[]='America/St_Kitts';
-$TZs[]='America/St_Lucia';
-$TZs[]='America/St_Thomas';
-$TZs[]='America/St_Vincent';
-$TZs[]='America/Swift_Current';
-$TZs[]='America/Tegucigalpa';
-$TZs[]='America/Thule';
-$TZs[]='America/Thunder_Bay';
-$TZs[]='America/Tijuana';
-$TZs[]='America/Tortola';
-$TZs[]='America/Vancouver';
-$TZs[]='America/Virgin';
-$TZs[]='America/Whitehorse';
-$TZs[]='America/Winnipeg';
-$TZs[]='America/Yakutat';
-$TZs[]='America/Yellowknife';
-$TZs[]='Antarctica/Casey';
-$TZs[]='Antarctica/Davis';
-$TZs[]='Antarctica/DumontDUrville';
-$TZs[]='Antarctica/Mawson';
-$TZs[]='Antarctica/McMurdo';
-$TZs[]='Antarctica/Palmer';
-$TZs[]='Antarctica/South_Pole';
-$TZs[]='Antarctica/Syowa';
-$TZs[]='Arctic/Longyearbyen';
-$TZs[]='Asia/Aden';
-$TZs[]='Asia/Almaty';
-$TZs[]='Asia/Amman';
-$TZs[]='Asia/Anadyr';
-$TZs[]='Asia/Aqtau';
-$TZs[]='Asia/Aqtobe';
-$TZs[]='Asia/Ashkhabad';
-$TZs[]='Asia/Baghdad';
-$TZs[]='Asia/Bahrain';
-$TZs[]='Asia/Baku';
-$TZs[]='Asia/Bangkok';
-$TZs[]='Asia/Beirut';
-$TZs[]='Asia/Bishkek';
-$TZs[]='Asia/Brunei';
-$TZs[]='Asia/Calcutta';
-$TZs[]='Asia/Chungking';
-$TZs[]='Asia/Colombo';
-$TZs[]='Asia/Dacca';
-$TZs[]='Asia/Damascus';
-$TZs[]='Asia/Dili';
-$TZs[]='Asia/Dubai';
-$TZs[]='Asia/Dushanbe';
-$TZs[]='Asia/Gaza';
-$TZs[]='Asia/Harbin';
-$TZs[]='Asia/Hong_Kong';
-$TZs[]='Asia/Hovd';
-$TZs[]='Asia/Irkutsk';
-$TZs[]='Asia/Istanbul';
-$TZs[]='Asia/Jakarta';
-$TZs[]='Asia/Jayapura';
-$TZs[]='Asia/Jerusalem';
-$TZs[]='Asia/Kabul';
-$TZs[]='Asia/Kamchatka';
-$TZs[]='Asia/Karachi';
-$TZs[]='Asia/Kashgar';
-$TZs[]='Asia/Katmandu';
-$TZs[]='Asia/Krasnoyarsk';
-$TZs[]='Asia/Kuala_Lumpur';
-$TZs[]='Asia/Kuching';
-$TZs[]='Asia/Kuwait';
-$TZs[]='Asia/Macao';
-$TZs[]='Asia/Magadan';
-$TZs[]='Asia/Manila';
-$TZs[]='Asia/Muscat';
-$TZs[]='Asia/Nicosia';
-$TZs[]='Asia/Novosibirsk';
-$TZs[]='Asia/Omsk';
-$TZs[]='Asia/Phnom_Penh';
-$TZs[]='Asia/Pyongyang';
-$TZs[]='Asia/Qatar';
-$TZs[]='Asia/Rangoon';
-$TZs[]='Asia/Riyadh';
-$TZs[]='Asia/Riyadh87';
-$TZs[]='Asia/Riyadh88';
-$TZs[]='Asia/Riyadh89';
-$TZs[]='Asia/Saigon';
-$TZs[]='Asia/Samarkand';
-$TZs[]='Asia/Seoul';
-$TZs[]='Asia/Shanghai';
-$TZs[]='Asia/Singapore';
-$TZs[]='Asia/Taipei';
-$TZs[]='Asia/Tashkent';
-$TZs[]='Asia/Tbilisi';
-$TZs[]='Asia/Tehran';
-$TZs[]='Asia/Tel_Aviv';
-$TZs[]='Asia/Thimbu';
-$TZs[]='Asia/Tokyo';
-$TZs[]='Asia/Ujung_Pandang';
-$TZs[]='Asia/Ulaanbaatar';
-$TZs[]='Asia/Ulan_Bator';
-$TZs[]='Asia/Urumqi';
-$TZs[]='Asia/Vientiane';
-$TZs[]='Asia/Vladivostok';
-$TZs[]='Asia/Yakutsk';
-$TZs[]='Asia/Yekaterinburg';
-$TZs[]='Asia/Yerevan';
-$TZs[]='Atlantic/Azores';
-$TZs[]='Atlantic/Bermuda';
-$TZs[]='Atlantic/Canary';
-$TZs[]='Atlantic/Cape_Verde';
-$TZs[]='Atlantic/Faeroe';
-$TZs[]='Atlantic/Jan_Mayen';
-$TZs[]='Atlantic/Madeira';
-$TZs[]='Atlantic/Reykjavik';
-$TZs[]='Atlantic/South_Georgia';
-$TZs[]='Atlantic/Stanley';
-$TZs[]='Atlantic/St_Helena';
-$TZs[]='Australia/ACT';
-$TZs[]='Australia/Adelaide';
-$TZs[]='Australia/Brisbane';
-$TZs[]='Australia/Broken_Hill';
-$TZs[]='Australia/Canberra';
-$TZs[]='Australia/Darwin';
-$TZs[]='Australia/Hobart';
-$TZs[]='Australia/LHI';
-$TZs[]='Australia/Lindeman';
-$TZs[]='Australia/Lord_Howe';
-$TZs[]='Australia/Melbourne';
-$TZs[]='Australia/North';
-$TZs[]='Australia/NSW';
-$TZs[]='Australia/Perth';
-$TZs[]='Australia/Queensland';
-$TZs[]='Australia/South';
-$TZs[]='Australia/Sydney';
-$TZs[]='Australia/Tasmania';
-$TZs[]='Australia/Victoria';
-$TZs[]='Australia/West';
-$TZs[]='Australia/Yancowinna';
-$TZs[]='Brazil/Acre';
-$TZs[]='Brazil/DeNoronha';
-$TZs[]='Brazil/East';
-$TZs[]='Brazil/West';
-$TZs[]='Canada/Atlantic';
-$TZs[]='Canada/Central';
-$TZs[]='Canada/Eastern';
-$TZs[]='Canada/East-Saskatchewan';
-$TZs[]='Canada/Mountain';
-$TZs[]='Canada/Newfoundland';
-$TZs[]='Canada/Pacific';
-$TZs[]='Canada/Saskatchewan';
-$TZs[]='Canada/Yukon';
-$TZs[]='CET';
-$TZs[]='Chile/Continental';
-$TZs[]='Chile/EasterIsland';
-$TZs[]='China/Beijing';
-$TZs[]='China/Shanghai';
-$TZs[]='CST6CDT';
-$TZs[]='Cuba';
-$TZs[]='EET';
-$TZs[]='Egypt';
-$TZs[]='Eire';
-$TZs[]='EST';
-$TZs[]='EST5EDT';
-$TZs[]='Europe/Amsterdam';
-$TZs[]='Europe/Andorra';
-$TZs[]='Europe/Athens';
-$TZs[]='Europe/Belfast';
-$TZs[]='Europe/Belgrade';
-$TZs[]='Europe/Berlin';
-$TZs[]='Europe/Bratislava';
-$TZs[]='Europe/Brussels';
-$TZs[]='Europe/Bucharest';
-$TZs[]='Europe/Budapest';
-$TZs[]='Europe/Chisinau';
-$TZs[]='Europe/Copenhagen';
-$TZs[]='Europe/Dublin';
-$TZs[]='Europe/Gibraltar';
-$TZs[]='Europe/Helsinki';
-$TZs[]='Europe/Istanbul';
-$TZs[]='Europe/Kaliningrad';
-$TZs[]='Europe/Kiev';
-$TZs[]='Europe/Lisbon';
-$TZs[]='Europe/Ljubljana';
-$TZs[]='Europe/London';
-$TZs[]='Europe/Luxembourg';
-$TZs[]='Europe/Madrid';
-$TZs[]='Europe/Malta';
-$TZs[]='Europe/Minsk';
-$TZs[]='Europe/Monaco';
-$TZs[]='Europe/Moscow';
-$TZs[]='Europe/Oslo';
-$TZs[]='Europe/Paris';
-$TZs[]='Europe/Prague';
-$TZs[]='Europe/Riga';
-$TZs[]='Europe/Rome';
-$TZs[]='Europe/Samara';
-$TZs[]='Europe/San_Marino';
-$TZs[]='Europe/Sarajevo';
-$TZs[]='Europe/Simferopol';
-$TZs[]='Europe/Skopje';
-$TZs[]='Europe/Sofia';
-$TZs[]='Europe/Stockholm';
-$TZs[]='Europe/Tallinn';
-$TZs[]='Europe/Tirane';
-$TZs[]='Europe/Tiraspol';
-$TZs[]='Europe/Uzhgorod';
-$TZs[]='Europe/Vaduz';
-$TZs[]='Europe/Vatican';
-$TZs[]='Europe/Vienna';
-$TZs[]='Europe/Vilnius';
-$TZs[]='Europe/Warsaw';
-$TZs[]='Europe/Zagreb';
-$TZs[]='Europe/Zaporozhye';
-$TZs[]='Europe/Zurich';
-$TZs[]='Factory';
-$TZs[]='GB';
-$TZs[]='GB-Eire';
-$TZs[]='GMT';
-$TZs[]='GMT0';
-$TZs[]='GMT-0';
-$TZs[]='GMT+0';
-$TZs[]='Greenwich';
-$TZs[]='Hongkong';
-$TZs[]='HST';
-$TZs[]='Iceland';
-$TZs[]='Indian/Antananarivo';
-$TZs[]='Indian/Chagos';
-$TZs[]='Indian/Christmas';
-$TZs[]='Indian/Cocos';
-$TZs[]='Indian/Comoro';
-$TZs[]='Indian/Kerguelen';
-$TZs[]='Indian/Mahe';
-$TZs[]='Indian/Maldives';
-$TZs[]='Indian/Mauritius';
-$TZs[]='Indian/Mayotte';
-$TZs[]='Indian/Reunion';
-$TZs[]='Iran';
-$TZs[]='Israel';
-$TZs[]='Jamaica';
-$TZs[]='Japan';
-$TZs[]='Kwajalein';
-$TZs[]='Libya';
-$TZs[]='MET';
-$TZs[]='Mexico/BajaNorte';
-$TZs[]='Mexico/BajaSur';
-$TZs[]='Mexico/General';
-$TZs[]='Mideast/Riyadh87';
-$TZs[]='Mideast/Riyadh88';
-$TZs[]='Mideast/Riyadh89';
-$TZs[]='MST';
-$TZs[]='MST7MDT';
-$TZs[]='Navajo';
-$TZs[]='NZ';
-$TZs[]='NZ-CHAT';
-$TZs[]='Pacific/Apia';
-$TZs[]='Pacific/Auckland';
-$TZs[]='Pacific/Chatham';
-$TZs[]='Pacific/Easter';
-$TZs[]='Pacific/Efate';
-$TZs[]='Pacific/Enderbury';
-$TZs[]='Pacific/Fakaofo';
-$TZs[]='Pacific/Fiji';
-$TZs[]='Pacific/Funafuti';
-$TZs[]='Pacific/Galapagos';
-$TZs[]='Pacific/Gambier';
-$TZs[]='Pacific/Guadalcanal';
-$TZs[]='Pacific/Guam';
-$TZs[]='Pacific/Honolulu';
-$TZs[]='Pacific/Johnston';
-$TZs[]='Pacific/Kiritimati';
-$TZs[]='Pacific/Kosrae';
-$TZs[]='Pacific/Kwajalein';
-$TZs[]='Pacific/Majuro';
-$TZs[]='Pacific/Marquesas';
-$TZs[]='Pacific/Midway';
-$TZs[]='Pacific/Nauru';
-$TZs[]='Pacific/Niue';
-$TZs[]='Pacific/Norfolk';
-$TZs[]='Pacific/Noumea';
-$TZs[]='Pacific/Pago_Pago';
-$TZs[]='Pacific/Palau';
-$TZs[]='Pacific/Pitcairn';
-$TZs[]='Pacific/Ponape';
-$TZs[]='Pacific/Port_Moresby';
-$TZs[]='Pacific/Rarotonga';
-$TZs[]='Pacific/Saipan';
-$TZs[]='Pacific/Samoa';
-$TZs[]='Pacific/Tahiti';
-$TZs[]='Pacific/Tarawa';
-$TZs[]='Pacific/Tongatapu';
-$TZs[]='Pacific/Truk';
-$TZs[]='Pacific/Wake';
-$TZs[]='Pacific/Wallis';
-$TZs[]='Pacific/Yap';
-$TZs[]='Poland';
-$TZs[]='Portugal';
-$TZs[]='PRC';
-$TZs[]='PST8PDT';
-$TZs[]='ROC';
-$TZs[]='ROK';
-$TZs[]='Singapore';
-$TZs[]='Turkey';
-$TZs[]='UCT';
-$TZs[]='Universal';
-$TZs[]='UTC';
-$TZs[]='WET';
-$TZs[]='W-SU';
-$TZs[]='Zulu';
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/utils.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/utils.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,415 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: utils.php,v 1.125 2000/11/09 20:53:04 pfalcon Exp $
-
-function util_prep_string_for_sendmail($body) {
- //$body=str_replace("\\","\\\\",$body);
- $body=str_replace("`","\\`",$body);
- $body=str_replace("\"","\\\"",$body);
- $body=str_replace("\$","\\\$",$body);
- return $body;
-}
-
-function util_unconvert_htmlspecialchars($string) {
- if (strlen($string) < 1) {
- return '';
- } else {
- $string=str_replace(' ',' ',$string);
- $string=str_replace('"','"',$string);
- $string=str_replace('>','>',$string);
- $string=str_replace('<','<',$string);
- $string=str_replace('&','&',$string);
- return $string;
- }
-}
-
-function util_result_columns_to_assoc($result, $col_key=0, $col_val=1) {
- /*
- Takes a result set and turns the column pair into
- an associative array
- */
- $rows=db_numrows($result);
-
- if ($rows > 0) {
- $arr=array();
- for ($i=0; $i<$rows; $i++) {
- $arr[db_result($result,$i,$col_key)]=db_result($result,$i,$col_val);
- }
- } else {
- $arr=array();
- }
- return $arr;
-}
-
-function util_result_column_to_array($result, $col=0) {
- /*
- Takes a result set and turns the optional column into
- an array
- */
- $rows=db_numrows($result);
-
- if ($rows > 0) {
- $arr=array();
- for ($i=0; $i<$rows; $i++) {
- $arr[$i]=db_result($result,$i,$col);
- }
- } else {
- $arr=array();
- }
- return $arr;
-}
-
-function result_column_to_array($result, $col=0) {
- /*
- backwards compatibility
- */
- return util_result_column_to_array($result, $col);
-}
-
-function util_wrap_find_space($string,$wrap) {
- //echo"\n";
- $start=$wrap-5;
- $try=1;
- $found=false;
-
- while (!$found) {
- //find the first space starting at $start
- $pos=@strpos($string,' ',$start);
-
- //if that space is too far over, go back and start more to the left
- if (($pos > ($wrap+5)) || !$pos) {
- $try++;
- $start=($wrap-($try*5));
- //if we've gotten so far left , just truncate the line
- if ($start<=10) {
- return $wrap;
- }
- $found=false;
- } else {
- $found=true;
- }
- }
-
- return $pos;
-}
-
-function util_line_wrap ($text, $wrap = 80, $break = "\n") {
- $paras = explode("\n", $text);
-
- $result = array();
- $i = 0;
- while ($i < count($paras)) {
- if (strlen($paras[$i]) <= $wrap) {
- $result[] = $paras[$i];
- $i++;
- } else {
- $pos=util_wrap_find_space($paras[$i],$wrap);
-
- $result[] = substr($paras[$i], 0, $pos);
-
- $new = trim(substr($paras[$i], $pos, strlen($paras[$i]) - $pos));
- if ($new != '') {
- $paras[$i] = $new;
- $pos=util_wrap_find_space($paras[$i],$wrap);
- } else {
- $i++;
- }
- }
- }
- return implode($break, $result);
-}
-
-function util_make_links ($data='') {
- if(empty($data)) { return $data; }
-
- $lines = split("\n",$data);
- while ( list ($key,$line) = each ($lines)) {
- $line = eregi_replace("([ \t]|^)www\."," http://www.",$line);
- $text = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]>#?/&=])", "<a href=\"\\1://\\2\\3\" target=\"_blank\" target=\"_new\">\\1://\\2\\3</a>", $line);
- $text = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "<a href=\"mailto:\\1\" target=\"_new\">\\1</a>", $text);
- $newText .= $text;
- }
- return $newText;
-}
-
-function show_priority_colors_key() {
-
- echo '<P><B>Priority Colors:</B><BR>
-
- <TABLE BORDER=0><TR>';
-
- for ($i=1; $i<10; $i++) {
- echo '
- <TD BGCOLOR="'.get_priority_color($i).'">'.$i.'</TD>';
- }
- echo '</tr></table>';
-}
-
-
-function get_priority_color ($index) {
- /*
- Return the color value for the index that was passed in
- (defined in $sys_urlroot/themes/<selected theme>/theme.php)
- */
- global $bgpri;
-
- return $bgpri[$index];
-}
-
-function build_priority_select_box ($name='priority', $checked_val='5', $nochange=false) {
- /*
- Return a select box of standard priorities.
- The name of this select box is optional and so is the default checked value
- */
- ?>
- <SELECT NAME="<?php echo $name; ?>">
-<?php if($nochange) { ?>
- <OPTION VALUE="100"<?php if ($nochange) {echo " SELECTED";} ?>>No Change</OPTION>
-<?php }?>
- <OPTION VALUE="1"<?php if ($checked_val=="1") {echo " SELECTED";} ?>>1 - Lowest</OPTION>
- <OPTION VALUE="2"<?php if ($checked_val=="2") {echo " SELECTED";} ?>>2</OPTION>
- <OPTION VALUE="3"<?php if ($checked_val=="3") {echo " SELECTED";} ?>>3</OPTION>
- <OPTION VALUE="4"<?php if ($checked_val=="4") {echo " SELECTED";} ?>>4</OPTION>
- <OPTION VALUE="5"<?php if ($checked_val=="5") {echo " SELECTED";} ?>>5 - Medium</OPTION>
- <OPTION VALUE="6"<?php if ($checked_val=="6") {echo " SELECTED";} ?>>6</OPTION>
- <OPTION VALUE="7"<?php if ($checked_val=="7") {echo " SELECTED";} ?>>7</OPTION>
- <OPTION VALUE="8"<?php if ($checked_val=="8") {echo " SELECTED";} ?>>8</OPTION>
- <OPTION VALUE="9"<?php if ($checked_val=="9") {echo " SELECTED";} ?>>9 - Highest</OPTION>
- </SELECT>
-<?php
-
-}
-
-// ########################################### checkbox array
-// ################# mostly for group languages and environments
-
-function utils_buildcheckboxarray($options,$name,$checked_array) {
- $option_count=count($options);
- $checked_count=count($checked_array);
-
- for ($i=1; $i<=$option_count; $i++) {
- echo '
- <BR><INPUT type="checkbox" name="'.$name.'" value="'.$i.'"';
- for ($j=0; $j<$checked_count; $j++) {
- if ($i == $checked_array[$j]) {
- echo ' CHECKED';
- }
- }
- echo '> '.$options[$i];
- }
-}
-
-Function GraphResult($result,$title) {
-
-/*
- GraphResult by Tim Perdue, PHPBuilder.com
-
- Takes a database result set.
- The first column should be the name,
- and the second column should be the values
-
- ####
- #### Be sure to include (HTML_Graphs.php) before hitting these graphing functions
- ####
-*/
-
- /*
- db_ should be replaced with your database, aka mysql_ or pg_
- */
- $rows=db_numrows($result);
-
- if ((!$result) || ($rows < 1)) {
- echo 'None Found.';
- } else {
- $names=array();
- $values=array();
-
- for ($j=0; $j<db_numrows($result); $j++) {
- if (db_result($result, $j, 0) != '' && db_result($result, $j, 1) != '' ) {
- $names[$j]= db_result($result, $j, 0);
- $values[$j]= db_result($result, $j, 1);
- }
- }
-
- /*
- This is another function detailed below
- */
- GraphIt($names,$values,$title);
- }
-}
-
-Function GraphIt($name_string,$value_string,$title) {
- GLOBAL $HTML;
-
- /*
- GraphIt by Tim Perdue, PHPBuilder.com
- */
- $counter=count($name_string);
-
- /*
- Can choose any color you wish
- */
- $bars=array();
-
- for ($i = 0; $i < $counter; $i++) {
- $bars[$i]=$HTML->COLOR_LTBACK1;
- }
-
- $counter=count($value_string);
-
- /*
- Figure the max_value passed in, so scale can be determined
- */
-
- $max_value=0;
-
- for ($i = 0; $i < $counter; $i++) {
- if ($value_string[$i] > $max_value) {
- $max_value=$value_string[$i];
- }
- }
-
- if ($max_value < 1) {
- $max_value=1;
- }
-
- /*
- I want my graphs all to be 800 pixels wide, so that is my divisor
- */
-
- $scale=(400/$max_value);
-
- /*
- I create a wrapper table around the graph that holds the title
- */
-
- $title_arr=array();
- $title_arr[]=$title;
-
- echo html_build_list_table_top ($title_arr);
- echo '<TR><TD>';
- /*
- Create an associate array to pass in. I leave most of it blank
- */
-
- $vals = array(
- 'vlabel'=>'',
- 'hlabel'=>'',
- 'type'=>'',
- 'cellpadding'=>'',
- 'cellspacing'=>'0',
- 'border'=>'',
- 'width'=>'',
- 'background'=>'',
- 'vfcolor'=>'',
- 'hfcolor'=>'',
- 'vbgcolor'=>'',
- 'hbgcolor'=>'',
- 'vfstyle'=>'',
- 'hfstyle'=>'',
- 'noshowvals'=>'',
- 'scale'=>$scale,
- 'namebgcolor'=>'',
- 'valuebgcolor'=>'',
- 'namefcolor'=>'',
- 'valuefcolor'=>'',
- 'namefstyle'=>'',
- 'valuefstyle'=>'',
- 'doublefcolor'=>'');
-
- /*
- This is the actual call to the HTML_Graphs class
- */
-
- html_graph($name_string,$value_string,$bars,$vals);
-
- echo '
- </TD></TR></TABLE>
- <!-- end outer graph table -->';
-}
-
-Function ShowResultSet($result,$title="Untitled",$linkify=false) {
- global $group_id,$HTML;
- /*
- Very simple, plain way to show a generic result set
- Accepts a result set and title
- Makes certain items into HTML links
- */
-
- if ($result) {
- $rows = db_numrows($result);
- $cols = db_numfields($result);
-
- echo '
- <TABLE BORDER="0" WIDTH="100%">';
-
- /* Create the title */
-
- echo '
- <TR BGCOLOR="'.$HTML->COLOR_HTMLBOX_TITLE.'">
- <TD COLSPAN="'.$cols.'"><B><FONT COLOR="'. $HTML->FONTCOLOR_HTMLBOX_TITLE .'">'.$title.'</B></TD></TR>';
-
- /* Create the headers */
- echo '
- <tr>';
- for ($i=0; $i < $cols; $i++) {
- echo '<td><B>'.db_fieldname($result, $i).'</B></TD>';
- }
- echo '</tr>';
-
- /* Create the rows */
- for ($j = 0; $j < $rows; $j++) {
- echo '<TR BGCOLOR="'. html_get_alt_row_color($j) .'">';
- for ($i = 0; $i < $cols; $i++) {
- if ($linkify && $i == 0) {
- $link = '<A HREF="'.$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();
- }
-}
-
-// Email Verification
-function validate_email ($address) {
- return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $address));
-}
-
-function util_is_valid_filename ($file) {
- if (ereg("[]~`! ~@#\"$%^,&*();=|[{}<>?/]",$file)) {
- return false;
- } else {
- if (strstr($file,'..')) {
- return false;
- } else {
- return true;
- }
- }
-}
-
-?>
Deleted: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vars.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vars.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vars.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,84 +0,0 @@
-<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: vars.php,v 1.15 2000/06/03 08:14:22 tperdue Exp $
-
-
-$LICENSE = array();
-$LICENSE['gpl'] = 'GNU General Public License';
-$LICENSE['lgpl'] = 'GNU Library Public License';
-$LICENSE['bsd'] = 'BSD License';
-$LICENSE['mit'] = 'MIT/X Consortium License';
-$LICENSE['artistic'] = 'Artistic License';
-$LICENSE['mpl'] = 'Mozilla Public License';
-$LICENSE['qpl'] = 'Qt Public License';
-$LICENSE['ibm'] = 'IBM Public License';
-$LICENSE['cvw'] = 'Collaborative Virtual Workspace License';
-$LICENSE['rscpl'] = 'Ricoh Source Code Public License';
-$LICENSE['python'] = 'Python License';
-$LICENSE['zlib'] = 'zlib/libpng License';
-$LICENSE['website'] = 'WebSite Only';
-$LICENSE['other'] = 'Other';
-$LICENSE['public'] = 'Public Domain';
-
-/*
-
-//
-// deprecated stuff from the old software map
-//
-
-$SOFTENV = array();
-$SOFTENV[1] = 'Other Environment';
-$SOFTENV[2] = 'Linux/Unix Console';
-$SOFTENV[3] = 'Linux/Unix X/Graphical';
-$SOFTENV[4] = 'Windows';
-$SOFTENV[5] = 'Web Environment';
-$SOFTENV[6] = 'MacOS';
-$SOFTENV[7] = 'PalmOS';
-$SOFTENV[8] = 'BeOS';
-
-$SOFTLANG = array();
-$SOFTLANG[1] = 'Other Language';
-$SOFTLANG[2] = 'C';
-$SOFTLANG[3] = 'C++';
-$SOFTLANG[4] = 'Perl';
-$SOFTLANG[5] = 'PHP';
-$SOFTLANG[6] = 'Python';
-$SOFTLANG[7] = 'Unix Shell';
-$SOFTLANG[8] = 'Java';
-$SOFTLANG[9] = 'AppleScript';
-$SOFTLANG[10] = 'Visual Basic';
-$SOFTLANG[11] = 'TCL';
-$SOFTLANG[12] = 'Lisp';
-
-$ENVFILE = array();
-$ENVFILE[1] = 'env-oth.png';
-$ENVFILE[2] = 'env-tux.png';
-$ENVFILE[3] = 'env-x.png';
-$ENVFILE[4] = 'env-win.png';
-$ENVFILE[5] = 'env-web1.png';
-$ENVFILE[6] = 'env-mac.png';
-$ENVFILE[7] = 'env-palm.png';
-$ENVFILE[8] = 'env-be.png';
-
-$ENVLINK = array();
-$ENVLINK[2] = 'http://www.linux.com';
-$ENVLINK[3] = 'http://www.x.org';
-$ENVLINK[4] = 'http://www.windows.com';
-$ENVLINK[6] = 'http://www.apple.com';
-$ENVLINK[7] = 'http://www.palm.com';
-$ENVLINK[8] = 'http://www.beos.com';
-
-*/
-
-$SHELLS = array();
-$SHELLS[1] = '/bin/bash';
-$SHELLS[2] = '/bin/sh';
-$SHELLS[3] = '/bin/ksh';
-$SHELLS[4] = '/bin/tcsh';
-$SHELLS[5] = '/bin/csh';
-
-?>
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editpackages.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editpackages.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editpackages.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,19 +1,32 @@
<?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.16 2000/12/12 18:50:17 dbrogdon Exp $
+/**
+ *
+ * Project Admin: Edit Packages
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version $Id: editpackages.php,v 1.22 2001/05/22 19:48:40 pfalcon Exp $
+ *
+ */
-require ('pre.php');
-require ($DOCUMENT_ROOT.'/project/admin/project_admin_utils.php');
+require_once('pre.php');
+require_once('www/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();
+$project =& group_get_object($group_id);
+exit_assert_object($project,'Project');
+
+$perm =& $project->getPermission(session_get_user());
+
+if (!$perm->isReleaseTechnician()) {
+ exit_permission_denied();
+}
+
+$is_admin=$perm->isAdmin();
+
/*
@@ -39,9 +52,9 @@
} else if ($func=='update_package' && $package_id && $package_name && $status_id) {
if ($status_id != 1) {
//if hiding a package, refuse if it has releases under it
- $res=db_query("SELECT * FROM frs_release WHERE package_id='$package_id'");
+ $res=db_query("SELECT * FROM frs_release WHERE package_id='$package_id' AND status_id=1");
if (db_numrows($res) > 0) {
- $feedback .= ' Sorry - you cannot delete a package that still contains file releases ';
+ $feedback .= ' Sorry - you cannot hide a package that contains active releases ';
$status_id=1;
}
}
@@ -55,7 +68,7 @@
}
-project_admin_header(array('title'=>'Release/Edit File Releases','group'=>$group_id));
+project_admin_header(array('title'=>'Release/Edit File Releases','group'=>$group_id,'pagename'=>'project_admin_editpackages','sectionvals'=>array(group_getname($group_id))));
echo '<h3>QRS:</h3>';
echo 'Click here for to <a href="qrs.php?package_id=' . $package_id . '&group_id=' . $group_id . '">quick-release a file</a>.<br>';
@@ -77,7 +90,7 @@
<B><a href=ftp://$user_unix_name@$sys_upload_host/incoming/>$sys_upload_host</a></B>. Once you have the files uploaded, you can then <B>create releases</B>
of your packages.
<P>
-Once you have have packages defined, you can start creating new <B>releases of packages.</B>
+Once you have packages defined, you can start creating new <B>releases of packages.</B>
<P>
<H3>Releases of Packages</H3>
<P>
@@ -103,7 +116,7 @@
$res=db_query("SELECT status_id,package_id,name AS package_name FROM frs_package WHERE group_id='$group_id'");
$rows=db_numrows($res);
if (!$res || $rows < 1) {
- echo '<h4>You Have No Packges Defined</h4>';
+ echo '<h4>You Have No Packages Defined</h4>';
} else {
$title_arr=array();
$title_arr[]='Releases';
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,24 +1,39 @@
<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: editreleases.php,v 1.50 2000/12/13 18:59:36 dbrogdon Exp $
+/**
+ *
+ * Project Admin: Edit Releases of Packages
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version $Id: editreleases.php,v 1.56 2001/07/09 21:46:15 pfalcon Exp $
+ *
+ */
+
/* Updated rewrite of the File Release System to clean up the UI
* a little and incorporate FRS.class. -Darrell
*/
-require ('pre.php');
-require ('frs.class');
-require ($DOCUMENT_ROOT.'/project/admin/project_admin_utils.php');
+require_once('pre.php');
+require_once('frs.class');
+require_once('www/project/admin/project_admin_utils.php');
+
session_require(array('group'=>$group_id));
-$project=&group_get_object($group_id);
-if (!$project->userIsReleaseTechnician()) exit_permission_denied();
-project_admin_header(array('title'=>'Release New File Version','group'=>$group_id));
+$project =& group_get_object($group_id);
+exit_assert_object($project,'Project');
+
+$perm =& $project->getPermission(session_get_user());
+
+if (!$perm->isReleaseTechnician()) {
+ exit_permission_denied();
+}
+
+project_admin_header(array('title'=>'Release New File Version','group'=>$group_id,'pagename'=>'project_admin_editreleases','sectionvals'=>array(group_getname($group_id))));
+
// Create a new FRS object
$frs = new FRS($group_id);
@@ -27,7 +42,15 @@
*/
// Edit release info
-if ($step1) {
+if ($step1) {
+ if (!util_check_fileupload($uploaded_notes)
+ || !util_check_fileupload($uploaded_changes)) {
+ $feedback .= ' Invalid filename';
+ project_admin_footer(array());
+ exit();
+
+ }
+
$exec_changes = true;
// Check for uploaded release notes
@@ -37,7 +60,7 @@
$feedback .= " Release Notes Are Either Too Small Or Too Large ";
$exec_changes = false;
}
- } else {
+ } else {
$notes = $release_notes;
}
@@ -65,9 +88,7 @@
// Add file(s) to the release
if ($step2) {
$group_unix_name=group_getunixname($group_id);
- $user_unix_name=user_getname();
- $project_files_dir=ereg_replace("<GROUP>",$group_unix_name,$FTPFILES_DIR);
- $user_incoming_dir=ereg_replace("<USER>",$user_unix_name,$FTPINCOMING_DIR);
+ $project_files_dir=$FTPFILES_DIR . '/' . $group_unix_name;
// For every file selected add that file to this release
for($x=0;$x<count($file_list);$x++) {
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/index.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/index.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/index.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,22 +1,41 @@
<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ *
+ * Project Admin Main Page
+ *
+ * This page contains administrative information for the project as well
+ * as allows to manage it. This page should be accessible to all project
+ * members, but only admins may perform most functions.
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version $Id$
+ *
+ */
-require ('pre.php');
-require ($DOCUMENT_ROOT.'/project/admin/project_admin_utils.php');
-require ('account.php');
+require_once('pre.php');
+require_once('www/project/admin/project_admin_utils.php');
+require_once('common/include/account.php');
+
session_require(array('group'=>$group_id));
// get current information
-$project=&group_get_object($group_id);
-$res_grp = $project->getData();
-$is_admin=$project->userIsAdmin();
+$group =& group_get_object($group_id);
+exit_assert_object($group,'Group');
+$perm =& $group->getPermission( session_get_user() );
+exit_assert_object($perm,'Permission');
+
+// only site admin get access inactive projects
+if (!$group->isActive() && !$perm->isSuperUser()) {
+ exit_error('Permission denied', 'Group is inactive.');
+}
+
+$is_admin = $perm->isAdmin();
+
// Only admin can make modifications via this page
if ($is_admin && $func) {
/*
@@ -27,18 +46,18 @@
add user to this project
*/
- if (!$project->addUser($form_unix_name)) {
- $feedback .= $project->getErrorMessage();
+ if (!$group->addUser($form_unix_name)) {
+ $feedback .= $group->getErrorMessage();
} else {
$feedback = ' User Added Successfully ';
}
} else if ($func=='rmuser') {
/*
- remove a user from this portal
+ remove a user from this group
*/
- if (!$project->removeUser($rm_id)) {
- $feedback .= $project->getErrorMessage();
+ if (!$group->removeUser($rm_id)) {
+ $feedback .= $group->getErrorMessage();
} else {
$feedback = ' User Removed Successfully ';
}
@@ -46,41 +65,58 @@
}
-$project->clearError();
+$group->clearError();
-project_admin_header(array('title'=>"Project Admin: ".group_getname($group_id),'group'=>$group_id));
+project_admin_header(array('title'=>"Project Admin: ".$group->getPublicName(),'group'=>$group->getID(),'pagename'=>'project_admin','sectionvals'=>array($group->getPublicName())));
/*
Show top box listing trove and other info
*/
-echo '<TABLE width=100% cellpadding=2 cellspacing=2 border=0>
-<TR valign=top><TD width=50%>';
+?>
-$HTML->box1_top("Misc. Project Information");
+<TABLE width=100% cellpadding=2 cellspacing=2 border=0>
+<TR valign=top><TD width=50%>
-print '
+<?php $HTML->box1_top("Misc. Project Information"); ?>
+
+
<BR>
-Short Description: '. db_result($res_grp,0,'short_description') .'
+Short Description: <?php echo $group->getDescription(); ?>
<P>
-Homepage Link: <B>'. db_result($res_grp,0,'homepage') .'</B>
+Homepage Link: <b><?php echo $group->getHomepage(); ?></b>
+<p>
+Group shell (SSH) server: <b><?php echo $group->getUnixName().'.'.$GLOBALS['sys_default_domain']; ?>
+<p>
+Group directory on shell server: <b><?php echo account_group_homedir($group->getUnixName()); ?>
+<p>
+Project WWW directory on shell server <a href="/docman/display_doc.php?docid=774&group_id=1">(how to upload)</a>:
+<b><?php echo account_group_homedir($group->getUnixName()).'/htdocs'; ?>
+
<P align=center>
-<A HREF="http://'.$GLOBALS['sys_cvs_host'].'/cvstarballs/'. db_result($res_grp,0,'unix_group_name') .'-cvsroot.tar.gz">[ Download Your Nightly CVS Tree Tarball ]</A>
+<A HREF="http://<?php echo $GLOBALS['sys_cvs_host']; ?>/cvstarballs/<?php echo $group->getUnixName(); ?>-cvsroot.tar.gz">[ Download Your Nightly CVS Tree Tarball ]</A>
<P>
<HR NOSHADE>
<P>
-<H4>Trove Categorization:</H4>
+<H4>Trove Categorization:
+<A href="/project/admin/group_trove.php?group_id=<?php echo $group->getID(); ?>">
+[Edit]</A></H4>
<P>
-<A href="/project/admin/group_trove.php?group_id='.$group_id.'">'
-.'<B>[Edit Trove Categorization]</B></A>
-<P>
<HR NOSHADE>
<P>
<H4>Showing The SourceForge Logo:</H4>
+<p>
+<font size=-1>
+If you use SourceForge services, we ask you to display our logo
+on project homepage, as explained
+<a href="http://sourceforge.net/docman/display_doc.php?docid=790&group_id=1">here
+</a>
+</font>
+</p>
<P>
-'.
-htmlspecialchars('<A href="http://'.$GLOBALS['sys_default_domain'].'">
+<?php
+echo htmlspecialchars('<A href="http://'.$GLOBALS['sys_default_domain'].'">
<IMG src="http://'.$GLOBALS['sys_default_domain'].'/sflogo.php?group_id='. $group_id .'" width="88" height="31"
border="0" alt="SourceForge Logo"></A>');
@@ -103,109 +139,126 @@
$res_memb = db_query("SELECT users.realname,users.user_id,users.user_name,user_group.admin_flags ".
"FROM users,user_group ".
"WHERE users.user_id=user_group.user_id ".
- "AND user_group.group_id=$group_id");
+ "AND user_group.group_id='$group_id'");
- print '<TABLE WIDTH="100%" BORDER="0">
-';
- while ($row_memb=db_fetch_array($res_memb)) {
- if ($row_memb['admin_flags']=='A') $img="trash-x.png";
- else $img="trash.png";
- if ($is_admin) $button='<INPUT TYPE="IMAGE" NAME="DELETE" SRC="/images/ic/'.$img.'" HEIGHT="16" WIDTH="16" BORDER="0">';
- else $button=' ';
- print '
- <FORM ACTION="'. $PHP_SELF .'" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="func" VALUE="rmuser">'.
+print '<TABLE WIDTH="100%" BORDER="0">';
+
+while ($row_memb=db_fetch_array($res_memb)) {
+
+ if (stristr($row_memb['admin_flags'], 'A')) {
+ $img="trash-x.png";
+ } else {
+ $img="trash.png";
+ }
+ if ($is_admin) {
+ $button='<INPUT TYPE="IMAGE" NAME="DELETE" SRC="/images/ic/'.$img.'" HEIGHT="16" WIDTH="16" BORDER="0">';
+ } else {
+ $button=' ';
+ }
+ print '
+ <FORM ACTION="rmuser.php" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="func" VALUE="rmuser">'.
+ '<INPUT TYPE="HIDDEN" NAME="return_to" VALUE="'.$REQUEST_URI.'">'.
'<INPUT TYPE="HIDDEN" NAME="rm_id" VALUE="'.$row_memb['user_id'].'">'.
'<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="'. $group_id .'">'.
'<TR><TD ALIGN="MIDDLE">'.$button.'</TD></FORM>'.
'<TD><A href="/users/'.$row_memb['user_name'].'/">'.$row_memb['realname'].'</A></TD></TR>';
- }
- print '</TABLE>
-';
+}
+print '</TABLE>';
/*
Add member form
*/
-if ($is_admin)
-echo '
+if ($is_admin) {
+
+ // After adding user, we go to the permission page for one
+?>
<HR NoShade SIZE="1">
- <FORM ACTION="'. $PHP_SELF .'" METHOD="POST">
+ <FORM ACTION="userpermedit.php?group_id=<?php echo $group->getID(); ?>" METHOD="POST">
<INPUT TYPE="hidden" NAME="func" VALUE="adduser">
- <INPUT TYPE="HIDDEN" NAME="group_id" VALUE="'. $group_id .'">
<TABLE WIDTH="100%" BORDER="0">
<TR><TD><B>Unix Name:</B></TD><TD><INPUT TYPE="TEXT" NAME="form_unix_name" SIZE=10 VALUE=""></TD></TR>
- <TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Add User"></TD></TR></FORM>
+ <TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Add User"></TD></TR></FORM>
</TABLE>
<HR NoShade SIZE="1">
<div align="center">
- <A href="/project/admin/userperms.php?group_id='. $group_id.'">[Edit Member Permissions]</A>
+ <A href="/project/admin/userperms.php?group_id=<?php echo $group->getID(); ?>">[Edit Member Permissions]</A>
</div>
</TD></TR>
-';
+
+<?php
+}
+?>
-$HTML->box1_bottom();
+<?php $HTML->box1_bottom();?>
-echo '</TD></TR>
+</TD></TR>
-<TR valign=top><TD width=50%>';
+<TR valign=top><TD width=50%>
+<?php
+
/*
Tool admin pages
*/
$HTML->box1_top('Tool Admin');
-echo '
+?>
+
<BR>
-<A HREF="/docman/admin/?group_id='.$group_id.'">DocManager Admin</A><BR>
-<A HREF="/bugs/admin/?group_id='.$group_id.'">Bug Admin</A><BR>
-<A HREF="/patch/admin/?group_id='.$group_id.'">Patch Admin</A><BR>
-<A HREF="/mail/admin/?group_id='.$group_id.'">Mail Admin</A><BR>
-<A HREF="/news/admin/?group_id='.$group_id.'">News Admin</A><BR>
-<A HREF="/pm/admin/?group_id='.$group_id.'">Task Manager Admin</A><BR>
-<A HREF="/support/admin/?group_id='.$group_id.'">Support Manager Admin</A><BR>
-<A HREF="/forum/admin/?group_id='.$group_id.'">Forum Admin</A><BR>
-';
+<A HREF="/tracker/admin/?group_id=<?php echo $group->getID(); ?>">Tracker Admin</A><BR>
+<A HREF="/docman/admin/?group_id=<?php echo $group->getID(); ?>">DocManager Admin</A><BR>
+<A HREF="/mail/admin/?group_id=<?php echo $group->getID(); ?>">Mail Admin</A><BR>
+<A HREF="/news/admin/?group_id=<?php echo $group->getID(); ?>">News Admin</A><BR>
+<A HREF="/pm/admin/?group_id=<?php echo $group->getID(); ?>">Task Manager Admin</A><BR>
+<A HREF="/forum/admin/?group_id=<?php echo $group->getID(); ?>">Forum Admin</A><BR>
-$HTML->box1_bottom();
+<?php $HTML->box1_bottom(); ?>
-echo '</TD>
+</TD>
<TD> </TD>
-<TD width=50%>';
+<TD width=50%>
+<?php
/*
Show filerelease info
*/
+?>
-$HTML->box1_top("File Releases"); ?>
+<?php $HTML->box1_top("File Releases"); ?>
<BR>
<CENTER>
<A href="editpackages.php?group_id=<?php print $group_id; ?>"><B>[Edit/Add File Releases]</B></A>
</CENTER>
<HR>
- <B>Packages:</B> <A href="/docman/display_doc.php?docid=780&group_id=1">Documentation</A> (Very Important!)
+ <B>Packages:</B> <A href="/docman/display_doc.php?docid=780&group_id=1"><i>What is this?</i></A> (Very Important!)
- <P><?php
+ <P>
- $res_module = db_query("SELECT * FROM frs_package WHERE group_id=$group_id");
+ <?php
+
+ $res_module = db_query("SELECT * FROM frs_package WHERE group_id='$group_id'");
while ($row_module = db_fetch_array($res_module)) {
print "$row_module[name]<BR>";
}
- echo $HTML->box1_bottom(); ?>
+ echo $HTML->box1_bottom();
+ ?>
</TD>
</TR>
</TABLE>
<?php
+
project_admin_footer(array());
?>
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/qrs.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/qrs.php 2011-02-24 14:40:37 UTC (rev 7406)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/qrs.php 2011-02-24 14:40:37 UTC (rev 7407)
@@ -1,27 +1,51 @@
<?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: qrs.php,v 1.4 2000/11/28 20:06:14 dbrogdon Exp $
+/**
+ *
+ * Project Admin: Quick Release System (QRS)
+ *
+ * This page allows one-step release of a file.
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version $Id: qrs.php,v 1.17 2001/07/09 21:26:28 pfalcon Exp $
+ *
+ */
-require ('pre.php');
-require ($DOCUMENT_ROOT.'/project/admin/project_admin_utils.php');
+require_once('pre.php');
+require_once('www/project/admin/project_admin_utils.php');
+require_once('frs.class');
+
/*
Quick file release system , Darrell Brogdon, SourceForge, Aug, 2000
With much code horked from editreleases.php
*/
-session_require(array('group'=>$group_id,'admin_flags'=>'A'));
-project_admin_header(array('title'=>'Release New File Version','group'=>$group_id));
+session_require(array('group'=>$group_id));
+$project =& group_get_object($group_id);
+
+exit_assert_object($project, 'Project');
+
+$perm =& $project->getPermission(session_get_user());
+
+if (!$perm->isReleaseTechnician()) {
+ exit_permission_denied();
+}
+
+project_admin_header(array('title'=>'Release New File Version','group'=>$group_id,'pagename'=>'project_admin_qrs','sectionvals'=>array(group_getname($group_id))));
+
if( $submit ) {
- if (!$release_name) {
- $feedback .= ' Must must define a release name. ';
+ if (!util_check_fileupload($userfile)) {
+ $feedback .= ' Invalid filename';
+ } else if (!$release_name) {
+ $feedback .= ' Must define a release name. ';
echo db_error();
+ } else if (!$package_id) {
+ $feedback .= ' Must select a package. ';
} else {
//create a new release of this package
@@ -31,33 +55,17 @@
$feedback .= ' | Package Doesn\'t Exist Or Isn\'t Yours ';
echo db_error();
} else {
- // package_id was fine - now insert the release (if need be)
- // see if a release by this name exists and belongs to this project
- $sql="SELECT frs_release.release_id FROM frs_package,frs_release ".
- "WHERE frs_package.group_id=$group_id ".
- "AND frs_release.package_id=frs_package.package_id ".
- "AND frs_release.name='$release_name' ".
- "ORDER BY frs_release.release_id ASC" ;
- // echo "\nSQL = $sql <br>\n" ;
- $res1=db_query($sql);
- // echo "res1 = $res1 <br>\n" ;
- // echo "numrows = " . db_numrows($res1) . " <br>\n" ;
- if (!$res1 || db_numrows($res1) < 1) { // Release does not already exist
- $res=db_query("INSERT INTO frs_release (package_id,name,notes,changes,status_id,release_date,released_by) ".
- "VALUES ('$package_id','$release_name','$release_notes','$release_changes','$status_id','". time() ."','". user_getid() ."')");
- if (!$res) {
- $feedback .= ' | Adding Release Failed ';
- echo db_error();
- //insert failed - go back to definition screen
- } else {
- //release added - now show the detail page for this new release
- $release_id=db_insertid($res,'frs_release','release_id');
- $feedback .= ' Added Release <BR>';
- }
- } else { // A release already exists by the same name in the same project
- $row = db_fetch_array($res1) ;
- $release_id = $row[release_id] ;
- $feedback .= ' Not Adding (Already Existing) Release | ';
+ //package_id was fine - now insert the release
+ $res=db_query("INSERT INTO frs_release (package_id,name,notes,changes,status_id,preformatted,release_date,released_by) ".
+ "VALUES ('$package_id','$release_name','$release_notes','$release_changes','$status_id','$preformatted','". time() ."','". user_getid() ."')");
+ if (!$res) {
+ $feedback .= ' | Adding Release Failed ';
+ echo db_error();
+ //insert failed - go back to definition screen
+ } else {
+ //release added - now show the detail page for this new release
+ $release_id=db_insertid($res,'frs_release','release_id');
+ $feedback .= ' Added Release <BR>';
}
}
@@ -148,6 +156,20 @@
if (!$res) {
$feedback .= " | Couldn't Add FileName: $file_name ";
echo db_error();
+ } else {
+ // Finally, send out email notification
+ $frs = new FRS($group_id);
+ $frs->frsSendNotice($group_id, $release_id, $package_id);
+ if( !$frs->isError() ) {
+ $feedback .= '<br>Email Notice Sent';
+ }
+ ?>
+ <p>
+ Please note that file(s) may not appear immediately
+ on the <a href="/project/showfiles.php?group_id=<?php echo $group_id;?>">
+ download page</a>. Allow several hours for propogation.
+ </p>
+ <?php
}
} else {
$feedback .= " | FileName Invalid Or Does Not Exist: $file_name ";
@@ -174,13 +196,14 @@
</TD>
<TD>
<?php
- $sql="SELECT * FROM frs_package WHERE group_id='$group_id'";
+ $sql="SELECT * FROM frs_package WHERE group_id='$group_id' AND status_id='1'";
$res=db_query($sql);
$rows=db_numrows($res);
if (!$res || $rows < 1) {
echo '<H4>No File Types Available</H4>';
} else {
echo '<SELECT NAME="package_id">';
+ echo '<OPTION VALUE="">(select)</OPTION>';
for ($i=0; $i<$rows; $i++) {
echo '<OPTION VALUE="' . db_result($res,$i,'package_id') . '">' . db_result($res,$i,'name') . '</OPTION>';
}
@@ -227,7 +250,7 @@
if(is_dir($user_incoming_dir)){
$dirhandle = opendir($user_incoming_dir);
- echo '<SELECT NAME="file_name">\n';
+ echo '<SELECT NAME="file_name">';
echo ' <OPTION VALUE="qrs_newfile">Select a file</OPTION>';
//iterate and show the files in the upload directory
while ($file = readdir($dirhandle)) {
@@ -287,6 +310,8 @@
<TR>
<TD COLSPAN="2" ALIGN="CENTER">
<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="<?php echo $group_id; ?>">
+ <input type="checkbox" name="preformatted" value="1" <?php echo ((db_result($result,0,'preformatted'))?'checked':''); ?>> Preserve my pre-formatted text.
+ <p>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Release File">
</TD>
</TR>
More information about the evolvis-commits
mailing list