Skip to content

Commit

Permalink
new file for user/project adding
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@886 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Apr 4, 2002
1 parent ecdd9f2 commit 8d11a80
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions proj_user_add2.php
@@ -0,0 +1,37 @@
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
<?php include( "core_API.php" ) ?>
<?php login_cookie_check() ?>
<?php
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
check_access( MANAGER );

# check for no projects
if ( !isset( $f_project_id ) ) {
$f_project_id = "";
}

# Add user to project(s)
$result = 0;
$count = count( $f_project_id );
for ($i=0;$i<$count;$i++) {
$t_project_id = $f_project_id[$i];
$query = "INSERT
INTO $g_mantis_project_user_list_table
(project_id, user_id, access_level)
VALUES
('$t_project_id', '$f_user_id', '$f_access_level')";
$result = db_query( $query );
}

$t_redirect_url = $g_manage_user_page."?f_id=".$f_user_id;
if ( $result ) {
print_header_redirect( $t_redirect_url );
} else {
print_mantis_error( ERROR_GENERIC );
}
?>

0 comments on commit 8d11a80

Please sign in to comment.