head	1.11;
access;
symbols
	TIGRIS_1_1_0RC2:1.4
	TIGRIS_1_1_0RC1:1.4
	TIGRIS_1_1:1.4.0.6
	TIGRIS_1_0_8:1.4
	TIGRIS_1_0_8RC3:1.4
	TIGRIS_1_0_8RC2:1.4
	TIGRIS_1_0_8RC1:1.4
	TIGRIS_1_0_7:1.4
	TIGRIS_1_0_7RC3:1.4
	TIGRIS_1_0_7RC2:1.4
	TIGRIS_1_0_7RC1:1.4
	TIGRIS_1_0_6:1.4
	TIGRIS_1_0_6RC5:1.4
	TIGRIS_1_0_6RC4:1.4
	TIGRIS_1_0_6RC3:1.4
	TIGRIS_1_0_6RC2:1.4
	TIGRIS_1_0_6RC1:1.4
	TIGRIS_1_0_5:1.4
	TIGRIS_1_0_5RC6:1.4
	TIGRIS_1_0_5RC5:1.4
	TIGRIS_1_0_5RC4:1.4
	TIGRIS_1_0_5RC3:1.4
	TIGRIS_1_0_5RC2:1.4
	TIGRIS_1_0_5RC1:1.4
	TIGRIS_1_0_4:1.4
	TIGRIS_1_0_3:1.4
	TIGRIS_1_0_2:1.4
	TIGRIS_1_0_1:1.4
	TIGRIS_1_0:1.4.0.8
	TIGRIS_1_0_0:1.4
	TIGRIS_1_0_0_RC1:1.4.0.4
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.4
	TIGRIS_0_9_2_3:1.4
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.4
	TIGRIS_0_9_2_1:1.4
	TIGRIS_0_9_2:1.4.0.2
	TIGRIS_0_9_0:1.2.0.4
	TIGRIS_0_8_4:1.2.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.11
date	2001.07.30.18.07.19;	author kmaples;	state dead;
branches;
next	1.10;

1.10
date	2001.06.05.22.36.18;	author kmaples;	state Exp;
branches;
next	1.9;

1.9
date	2001.05.11.00.09.24;	author kmaples;	state Exp;
branches;
next	1.8;

1.8
date	2001.05.11.00.01.14;	author kmaples;	state Exp;
branches;
next	1.7;

1.7
date	2001.05.10.20.05.15;	author kmaples;	state Exp;
branches;
next	1.6;

1.6
date	2001.04.18.02.02.58;	author kmaples;	state Exp;
branches;
next	1.5;

1.5
date	2001.04.17.04.44.54;	author kmaples;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.13.02.04.52;	author kmaples;	state Exp;
branches;
next	1.3;

1.3
date	2000.12.27.22.57.44;	author kmaples;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.16.00.38.49;	author kmaples;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.12.21.17.39;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.39;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.36.20;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Issue number: 4544, 4242
Making the world a better place by removing the scripts the taskrunner
used to need to run to create IZ users.
@
text
@#!/usr/bin/perl

# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# 
# $Id: issuezilla-user-edit,v 1.10 2001/06/05 22:36:18 kmaples Exp $
# --------------------
# 

# Flush buffer, just in case:
$| = 1;

use strict;
use DBI;

# Process arguments
my $project_name       = $ARGV[0] || ''; # unused
my $dbname             = $ARGV[1] || '';
my $domain_name        = $ARGV[2] || '';
my $realname           = $ARGV[3] || ''; 
my $old_username       = $ARGV[4] || '';
my $new_username       = $ARGV[5] || '';
my $issues_role        = $ARGV[6] || '';
my $multiple_dbs       = $ARGV[7] || ''; # unused 

# Some email address for issuezilla:
my $email_sfx      = "\@@$domain_name"; 
my $old_login_name = $old_username . $email_sfx;
my $new_login_name = $new_username . $email_sfx;

# String for current sql statement
my $command;

# Placeholder vars for db work:
my ($select, $ret);
 
# NOTE - this script requires the info necessary to connect
# to the correct DB, e.g., username/password, DB name, etc.

my $dbuser         = $ENV{DATABASE_USER}     || '';
my $dbpass         = $ENV{DATABASE_PASSWORD} || '';

# Grab just the filename portion of this script to use as a 
# log identifier:
my $script_name = $0;
$script_name =~ s/^.*\/([^\/]+)$/  $1/;

#---------------------------------------------------------------
# MAIN
#---------------------------------------------------------------
# Fail if we don't have what we need to talk to the database:
unless($dbname && $dbuser && $dbpass){
    print "$script_name: envrionmentals for DB access not set\n";
    exit(1);
}

my $dbc = join(':',"DBI:mysql:$dbname",$ENV{DATABASE_HOST},$ENV{DATABASE_PORT});
my $CONN = DBI->connect($dbc, $dbuser, $dbpass);

# Check for a good connection:
unless( $CONN =~ m/HASH/){
    print "$script_name: no connection to database: $!\n";
    exit(1);
}

# Do the sql quoting for the values we're gonna play with:
foreach($old_login_name, $new_login_name, $realname){    
    $_ = $CONN->quote( $_ );
}

# Since the login_name is essentially a primary key, check to 
# see if this is one of the values being edited:
if($new_login_name ne $old_login_name){
	print "$script_name: checking for previous entry\n";
	$command = qq[
	  SELECT *
	  FROM profiles
	  WHERE login_name = $new_login_name
	];
	
	$select = $CONN->prepare($command);
	$ret    = $select->execute;
	
	if($ret && $ret ne '0E0'){
	    print "$script_name: conflicting record found for $new_login_name\n";
	    exit(1);
    }    
}

# Safe to perform update:
print "$script_name: performing update\n";
$command = qq[
  UPDATE profiles SET 
    login_name    = $new_login_name,
    realname      = $realname,
  WHERE login_name  = $old_login_name 
];

$select = $CONN->prepare($command);
$ret    = $select->execute;

unless($ret){
    print "$script_name: unable to perform insert: $!\n";
    $CONN->disconnect;
    exit(1);
}    


# Clean up and leave quietly:
$select->finish();
$CONN->disconnect;

#---------------------------------------------------------------
# END MAIN
#---------------------------------------------------------------
@


1.10
log
@Issue number: 4242
Completely removing IZ's password and LDAP code.  This is in advance of
more signifigant changes to persuade IZ to obtain permission information
directly from Helm.

This is a large-scale cleanup of code which is useless to IZ, since it
obtains the information it uses for authentication from Helm in any event.
Password information was merely dummy strings that acted as placeholders
in the profiles table; as of now, it is sufficient to have an entry in
the profiles table (non-disabled, of course) for access.

Related changes can be found in issuezilla/
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.9 2001/05/11 00:09:24 kmaples Exp $
@


1.9
log
@Extra comma.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.8 2001/05/11 00:01:14 kmaples Exp $
a70 2
my $issues_password    = $ENV{ISSUZILLA_PASSWORD};

d112 1
a112 1
foreach($issues_password, $old_login_name, $new_login_name, $realname){    
a140 2
    password      = $issues_password,
    cryptpassword = ENCRYPT($issues_password)
@


1.8
log
@Fixing check for previous entry.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.7 2001/05/10 20:05:15 kmaples Exp $
d144 1
a144 1
    cryptpassword = ENCRYPT($issues_password),
@


1.7
log
@Syncing unimplemented functions.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.6 2001/04/18 02:02:58 kmaples Exp $
a60 5
# For the sake of -T:
$ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin";
# Detaint the args by brute force:
@@ARGV = detaint_array(@@ARGV);

d62 1
a62 1
my $project_name       = $ARGV[0] || '';
d69 1
a69 1
my $multiple_dbs       = $ARGV[7] || '';  
d74 1
a74 1
my $email_sfx      = "\@@$project_name.$domain_name"; 
d118 18
a135 9
print "$script_name: checking for previous entry\n";
$command = qq[
  SELECT count(*)
  FROM profiles
  WHERE login_name = $new_login_name
];

$select = $CONN->prepare($command);
$ret    = $select->execute;
d137 1
@


1.6
log
@Undoing yesterday's commit - my hastiness to implement some sort of logging
level notion into these scripts caused me great pain.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.4 2001/01/13 02:04:52 kmaples Exp $
d70 5
a74 4
my $issues_realname    = $ARGV[3] || ''; # : - sep. list
my $issues_username    = $ARGV[4] || ''; # : - sep. list
my $issues_role        = $ARGV[5] || '';
my $multiple_dbs       = $ARGV[6] || '';  
a77 6
# GIVE UP - THIS ISN'T REMOTELY IMPLEMENTED:
print "NOT IMPLEMENTED\n";
exit;



d79 3
a81 2
my $login_name = "issues\@@$project_name" .'.'."$domain_name";
my $realname   = "$project_name issues mailing list";
a87 1
my $profiles_index = 0;
d119 1
a119 1
foreach($project_name, $domain_name, $issues_password, $login_name, $realname){
d123 28
a150 17
    print "$script_name: performing update\n";
    $command = qq[

    UPDATE profiles SET 
	password      = $issues_password,
	cryptpassword = ENCRYPT($issues_password),
    WHERE login_name  = $login_name 
    ];

    $select = $CONN->prepare($command);
    $ret    = $select->execute;

    unless($ret){
        print "$script_name: unable to perform insert: $!\n";
        $CONN->disconnect;
        exit(1);
    }    
a159 19


# A crude attempt to overcome data tainting in perl:
#-------------------
sub detaint_array {
#-------------------
    my @@unclean = @@_;
    my @@clean = ();

    foreach(@@unclean){
        # We don't really have rules for this, so at the moment
        # this acts as a passthrough:
        $_ =~ m/^(.*)$/;
        push(@@clean,$1);
    }

    return(@@clean);
}

@


1.5
log
@Scripts now use IN_PRODUCTION to determine logging level
@
text
@a54 5
my $scripts_dir = $ENV{'SANDBOX'} . '/helm/perl/scripts';

require "$scripts_dir/ParentChildArgumentBridge.pl"
    or die "Require failed: $!\n";

d78 1
a78 1
print_log(1, "NOT IMPLEMENTED\n");
d110 1
a110 1
    print_log(1, "$script_name: envrionmentals for DB access not set\n");
d119 1
a119 1
    print_log(1, "$script_name: no connection to database: $!\n");
d128 1
a128 1
    print_log(1, "$script_name: performing update\n");
d141 1
a141 1
        print_log(1, "$script_name: unable to perform insert: $!\n");
@


1.4
log
@First furtive attempts to support remote databases.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.3 2000/12/27 22:57:44 kmaples Exp $
d55 5
d83 1
a83 1
print "NOT IMPLEMENTED\n";
d115 1
a115 1
    print "$script_name: envrionmentals for DB access not set\n";
d124 1
a124 1
    print "$script_name: no connection to database: $!\n";
d133 1
a133 1
    print "$script_name: performing update\n";
d146 1
a146 1
        print "$script_name: unable to perform insert: $!\n";
@


1.3
log
@Framework changes to recognize whether database type is set to single or
multiple.  This implements no changes in the behavior of the scripts, only
changes in the framework.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.2 2000/11/16 00:38:49 kmaples Exp $
d114 1
a114 1
my $dbc = "DBI:mysql:$dbname";
@


1.2
log
@Changed presumptive mailing addresses to be <user>@@<project>.<domain>
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.1.1.1 2000/11/12 21:17:39 dlr Exp $
d73 2
@


1.1
log
@Initial revision
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.7 2000/11/07 20:58:04 kmaples Exp $
d67 6
a72 5
my $dbname             = $ARGV[0] || '';
my $domain_name        = $ARGV[1] || '';
my $issues_realname    = $ARGV[2] || ''; # : - sep. list
my $issues_username    = $ARGV[3] || ''; # : - sep. list
my $issues_role        = $ARGV[4] || '';
d82 1
a82 1
my $login_name = "$project_name-issues\@@$domain_name";
d90 1
a90 1
my $profiles_index 0;
d143 1
a143 1
}
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d51 1
a51 1
# $Id: issuezilla-user-edit,v 1.4 2001/01/13 02:04:52 kmaples Exp $
d67 5
a71 8
my $project_name       = $ARGV[0] || '';
my $dbname             = $ARGV[1] || '';
my $domain_name        = $ARGV[2] || '';
my $issues_realname    = $ARGV[3] || ''; # : - sep. list
my $issues_username    = $ARGV[4] || ''; # : - sep. list
my $issues_role        = $ARGV[5] || '';
my $multiple_dbs       = $ARGV[6] || '';  

d81 1
a81 1
my $login_name = "issues\@@$project_name" .'.'."$domain_name";
d89 1
a89 1
my $profiles_index = 0;
d111 1
a111 1
my $dbc = join(':',"DBI:mysql:$dbname",$ENV{DATABASE_HOST},$ENV{DATABASE_PORT});
d142 1
a142 1

@

