summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfs_webdemo/registerd20
1 files changed, 11 insertions, 9 deletions
diff --git a/fs_webdemo/registerd b/fs_webdemo/registerd
index e6c071d70..e10acf2fe 100755
--- a/fs_webdemo/registerd
+++ b/fs_webdemo/registerd
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
-# $Id: registerd,v 1.3 2000-03-03 05:47:24 ivan Exp $
+# $Id: registerd,v 1.4 2000-03-03 06:03:15 ivan Exp $
use strict;
use vars qw(
@@ -42,8 +42,10 @@ $pass = "maelcolm";
@pw_set = ( 'a'..'z', '0'..'9' );
@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
-die "not running as system user freeside"
- unless $> == scalar(getpwnam('freeside'));
+#die "not running as system user freeside"
+# unless $> == scalar(getpwnam('freeside'));
+die "not running as root user"
+ unless $> == 0;
$dbh = DBI->connect( $datasrc, $user, $pass, {
'AutoCommit' => 'true',
@@ -86,17 +88,17 @@ while ( 1 ) {
system("/usr/bin/mysqladmin --user=$user --password=$pass ".
"create demo_$username >/dev/null");
- system "cp $mysql_data/demo_template/* $mysql_data/demo_$username";
+ system "cp -p $mysql_data/demo_template/* $mysql_data/demo_$username";
mkdir "${freeside_conf}conf.DBI:mysql:demo_$username", 0755;
- system "cp -r ${freeside_conf}conf.DBI:mysql:demo_template/* ".
+ system "cp -pr ${freeside_conf}conf.DBI:mysql:demo_template/* ".
"${freeside_conf}conf.DBI:mysql:demo_$username";
mkdir "${freeside_conf}counters.DBI:mysql:demo_$username", 0755;
- system "cp ${freeside_conf}counters.DBI:mysql:demo_template/* ".
+ system "cp -p ${freeside_conf}counters.DBI:mysql:demo_template/* ".
"${freeside_conf}counters.DBI:mysql:demo_$username";
- system "cp ${freeside_conf}dbdef.DBI:mysql:demo_template ".
+ system "cp -p ${freeside_conf}dbdef.DBI:mysql:demo_template ".
"${freeside_conf}dbdef.DBI:mysql:demo_$username";
open(INVOICE_FROM, ">${freeside_conf}conf.DBI:mysql:demo_$username/invoice_from")
@@ -135,7 +137,7 @@ while ( 1 ) {
crypt($user_pw,$saltset[int(rand(64))].$saltset[int(rand(64))]);
$sth = $dbh->prepare(
- 'UPDATE mysql_auth SET passwd = "$crypt_pw" WHERE username = "$username"'
+ 'UPDATE mysql_auth SET passwd = "$crypt_pw", status = "done" WHERE username = "$username"'
);
$sth->execute or die $sth->errstr;
@@ -147,7 +149,7 @@ while ( 1 ) {
'Bcc: ivan-fsreg_bcc@sisd.com',
'Sender: ivan-fsreg@sisd.com',
'Reply-To: ivan-fsreg@sisd.com',
- 'Date: '. time2str("%a, %d %b %Y %X %z", time),
+ 'Date: '. time2str("%a, %d %b %Y %X %z", time, 'US/Pacific'),
'Subject: Freeside demo information',
] );
$msg = Mail::Internet->new(