~ubuntu-branches/ubuntu/natty/otrs2/natty-updates

« back to all changes in this revision

Viewing changes to scripts/syncuser_csv2otrs.pl

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2007-04-14 17:58:55 UTC
  • mto: (20.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: package-import@ubuntu.com-20070414175855-9ne0w01yu1q44ch0
Tags: upstream-2.1.7
ImportĀ upstreamĀ versionĀ 2.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl -w
2
2
# --
3
3
# syncuser_csv2otrs.pl - sync csv user list or otrs
4
 
# Copyright (C) 2001-2003 Martin Edenhofer <martin+code@otrs.org>
 
4
# Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
5
5
# --
6
 
# $Id: syncuser_csv2otrs.pl,v 1.1 2003/03/02 13:45:09 martin Exp $
 
6
# $Id: syncuser_csv2otrs.pl,v 1.2 2006/10/03 14:34:47 mh Exp $
7
7
# --
8
8
# This program is free software; you can redistribute it and/or modify
9
9
# it under the terms of the GNU General Public License as published by
10
10
# the Free Software Foundation; either version 2 of the License, or
11
11
# (at your option) any later version.
12
 
 
12
#
13
13
# This program is distributed in the hope that it will be useful,
14
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
16
# GNU General Public License for more details.
17
 
 
17
#
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
20
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
51
51
use Kernel::System::User;
52
52
# --
53
53
# common objects
54
 
# -- 
 
54
# --
55
55
my %CommonObject = ();
56
56
$CommonObject{ConfigObject} = Kernel::Config->new();
57
57
$CommonObject{LogObject} = Kernel::System::Log->new(
58
58
    LogPrefix => 'OTRS-syncuser_csv2otrs.pl',
59
 
    %CommonObject 
 
59
    %CommonObject
60
60
);
61
61
$CommonObject{DBObject} = Kernel::System::DB->new(%CommonObject);
62
62
$CommonObject{UserObject} = Kernel::System::User->new(%CommonObject);
63
 
# -- 
 
63
# --
64
64
# get options
65
65
# --
66
66
my %Opts = ();
67
67
getopt('s',  \%Opts);
68
68
my $End = "\n";
69
69
if (!$Opts{'s'}) {
70
 
    die "Need -s <CSV_FILE>\n"; 
 
70
    die "Need -s <CSV_FILE>\n";
71
71
}
72
 
# -- 
 
72
# --
73
73
# read csv file
74
74
# --
75
75
open (IN, "< $Opts{'s'}") || die "Can't read $Opts{'s'}: $!";
97
97
            UserID => 1,
98
98
        );
99
99
    }
100
 
    # add user 
 
100
    # add user
101
101
    else {
102
102
        print "Add user '$Line[$Fields{Login}]'\n";
103
103
        $CommonObject{UserObject}->UserAdd(