File: ia64_dump.pl

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (30 lines) | stat: -rwxr-xr-x 1,109 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
#
# $Id: ia64_dump.pl 4059 2005-03-03 21:38:26Z cbayle $
#
# dump_database.pl - script to dump data from the database to flat files so the ofher perl
#		     scripts can process it without needing to access the database.
use DBI;

require("../include.pl");  # Include all the predefined functions

my $user_array = ();

&db_connect;

# Dump the users Table information
my $query = "select unix_uid, unix_status, user_name, shell, unix_pw, realname from users where unix_status != \"N\"";
my $query = "select users.unix_uid, users.unix_status, users.user_name, users.shell, users.unix_pw, users.realname from users,intel_agreement where users.unix_status != 'N' AND users.user_id=intel_agreement.user_id AND intel_agreement.is_approved='1'";
my $c = $dbh->prepare($query);
$c->execute();
	
while(my ($id, $status, $username, $shell, $passwd, $realname) = $c->fetchrow()) {
	$home_dir = $homedir_prefix.$username;

	$userlist = "$id:$status:$username:$shell:$passwd:$realname\n";

	push @user_array, $userlist;
}

# Now write out the files
write_array_file($file_dir."/ia64_dump", @user_array);