--- tabea.cgi 2002/06/27 15:57:10 1.30
+++ tabea.cgi 2002/06/28 15:02:08 1.31
@@ -191,7 +191,7 @@
}
elsif ($form eq 'cfgedit' ) {
-# $page .= &run($cgi->param('configslist') );
+ $page .= &cfgedit();
}
elsif ($form eq 'logout' ) {
$cgi->param(-name => 'username', -value => "");
@@ -209,8 +209,6 @@
$page .= $cgi->hidden(-name => 'akt_user', -default => $akt_user);
$page .= $cgi->hidden(-name => 'del_u_files', -default => $cgi->param('del_u_files'));
-# A special for admin section and chpw for tabea
-#$page .= $cgi->hidden(-name => 'akt_user', -default => $akt_user);
$page .= $cgi->endform;
my $out = $MY->{TEMPLATE};
@@ -851,7 +849,6 @@
my @userlistarray = split(/\s/, $userlist);
$akt_user = $username;
- $text .= "Username: $username; User: $user";
$text .= "<table>" .
"<td>".
@@ -922,7 +919,7 @@
my ($user) = @_;
my $ctext;
- $ctext .= "<br>Aktueller User: $user<br>";
+ $ctext .= "<br>Changing the password of $user<br><br>";
$ctext .= "<table cellspacing=0 cellpadding=0>" ;
if ( (($username eq $cfghash{'TabeaUser'}) && ($user eq $cfghash{'TabeaUser'}) )
|| ($username ne $cfghash{'TabeaUser'}) ) {
@@ -1086,8 +1083,6 @@
my $nu_error = 1;
- $ntext .= "Here is newuser $nuser<br>";
-
if ( $nuser !~ /^[A-Za-z0-9]+$/ ) {
$nuser = "";
}
@@ -1098,9 +1093,6 @@
"</font>" .
$cgi->submit(-name => 'dialog_mainw', -value => 'Back');
} else {
- $ntext .= "Writing new user";
-
- $ntext .= "<br>Checking passwdord file<br>" ;
$pwdin = IO::File->new("<$pwdfile");
while (<$pwdin>) {
$_ =~ s|^(\w+):(.+)$|{$uname=$1}|eg;
@@ -1108,15 +1100,11 @@
}
$pwdin->close();
- $ntext .= "<br>Checking subdir file<br>" ;
-
$dirlist = &readsubdir($cfghash{'BaseDir'} . $cfghash{'ConfigDir'} . "/");
- $ntext .= "<br>$dirlist<br>" ;
( $dirlist =~ m|$nuser| ) && do { $nu_error = 0; };
if ($nu_error) {
- $ntext .= "<br>Creatin subdir file<br>" ;
my $newdir = $cfghash{'BaseDir'} . $cfghash{'ConfigDir'} . "/" . $nuser;
system("mkdir $newdir ") ;
@@ -1124,7 +1112,6 @@
my $dirok = 1;
( $dirlist !~ m|$nuser| ) && do { $dirok = 0; };
if ($dirok) {
- $ntext .= "<br>Reading password file<br>" ;
$pwdin = IO::File->new("<$pwdfile");
while (<$pwdin>) {
$pwdfiletext .= $_;
@@ -1132,13 +1119,9 @@
# I need an existing password as an example
}
$pwdin->close();
- $ntext .= "<br><br>" . "$pwdfiletext" . "<br><br>" ;
$pwdfiletext .= $nuser . ":" . (crypt('foobar', $pwd)) ;
-
- $ntext .= "<br><br>" . "$pwdfiletext" . "<br><br>" ;
-
$pwdin = IO::File->new(">$pwdfile");
print $pwdin $pwdfiletext;
$pwdin->close();
@@ -1146,7 +1129,7 @@
$ntext .= "<font color=red>" .
- "User $nuser created</font><br>" .
+ "User $nuser created</font><br><br>" .
$cgi->submit(-name => 'dialog_mainw', -value => 'Back');
@@ -1170,7 +1153,7 @@
my $text;
my $derror = 0;
- if ($duser =~ $cfghash{'TabeaUser'} ) {
+ if ($duser =~ m/^$cfghash{'TabeaUser'}$/ ) {
$derror = 1;
}
@@ -1249,14 +1232,8 @@
"$duser" .
"</td>" .
- "</table>" .
+ "</table>" ;
- "<br><br>" .
-
- "And his files wil be " ;
-
- $dtext .= $cgi->param('del_u_files') . "<br>";
-
if ($cgi->param('del_u_files')) {
$dtext .= "<br>The files of the user will be deleted" ;
} else {
@@ -1346,7 +1323,21 @@
return $d3text;
}
########################################################################################
+
+########################################################################################
+sub cfgedit {
+########################################################################################
+ my $text;
+
+ $text .= &editconfig($cfghash{'BaseDir'} . "tabea.cfg", 'w', $cfghash{'TabeaUser'} );
+ $text .= $cgi->hidden(-name => 'editfile', -default => $cfghash{'BaseDir'} . "tabea.cfg" );
+
+
+ return $text;
+}
+########################################################################################
+
########################################################################################
sub copy {
|