From c590e897d5a79d26c52b5e747e4ba227a65e6233 Mon Sep 17 00:00:00 2001 From: katagia Date: Thu, 23 Oct 2003 18:25:55 +0000 Subject: [PATCH] added test-function in landaemon.pl --- lam/docs/README.lamdaemon.pl | 24 +++++++++++++++++++++++- lam/lib/account.inc | 12 ------------ lam/lib/lamdaemon.pl | 8 ++++++-- lam/templates/account/hostedit.php | 2 +- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/lam/docs/README.lamdaemon.pl b/lam/docs/README.lamdaemon.pl index c9fe6aca..9d9b9834 100644 --- a/lam/docs/README.lamdaemon.pl +++ b/lam/docs/README.lamdaemon.pl @@ -56,7 +56,29 @@ thins to get it work. admin-user was encrypted with {SSHA}. I had to change encryption for admin-accounts to {CRYPT} to get ssh work. +5. Test lamdaemon.pl + I've installed a test-function in lamdaemon.pl. Please run lamdaemon.pl + with the following attributes to test it: + lamdaemon.pl $ssh-server $lam_path_on_host $admin-username $admin-password *test + $ssh-server is the remote host lamdaemon.pl should be run + $lam_path_on_host is the path to lamdaemon.pl on remote host + $admin-username is the name of the user which is allowed to run lamdaemon.pl + as root. It's the same user in /etc/sudoers + $admin-password is the password of admin-user + *test is the command which tells lamdaemon.pl to test settings + + You have to run the coammd as the user your webserver is running as, e.g. + + wwwrun@tilo:/srv/www/htdocs/lam/lib> /srv/www/htdocs/lam/lib/lamdaemon.pl \ + 127.0.0.1 /srv/www/htdocs/lam/lib/lamdaemon.pl root secret *test + + You should get the following response: + Net::SSH::Perl successfully installed. + sudo set up correctly. + Perl quota module successfully installed. + If you have'nt seen any error lamdaemon.pl should set up successfully. + Now everything should work fine -This is a very incomplete Documention for Alpha-Release only. +This is a very incomplete Documention for Beta-Release only. Pleas send a mail to TiloLutz@gmx.de if you have any suggsestion diff --git a/lam/lib/account.inc b/lam/lib/account.inc index fc3d5aa0..4c49a5bd 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -1669,8 +1669,6 @@ function createhost($values) { $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); $attr['description'] = utf8_encode($values->general_gecos); // Set unix password - $attr['userPassword'] = pwd_hash(''); - $attr['shadowLastChange'] = getdays(); // Samba attributes if ($_SESSION['config']->is_samba3()) { @@ -1771,12 +1769,6 @@ function modifyhost($values,$values_old) { if ($values->smb_displayName != $values_old->smb_displayName) $attr['displayName'] = utf8_encode($values->smb_displayName); - // Set unix password - if ($values->smb_password_no) { - $attr['userPassword'] = pwd_hash(''); - $attr['shadowLastChange'] = getdays(); // shadowAccount_may - } - // Samba attributes if ($_SESSION['config']->is_samba3()) { if (!in_array('sambaSamAccount', $values->general_objectClass)) { @@ -1837,8 +1829,6 @@ function modifyhost($values,$values_old) { $attr['sambaNTPassword'] = '0CB6948805F797BF2A82807973B89537'; $attr['sambaLMPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; $attr['sambaPwdLastSet'] = time(); // sambaAccount_may - $attr['userPassword'] = ''; - $attr['shadowLastChange'] = getdays(); } if ($values->smb_domain->name!=$values_old->smb_domain->name) $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may } @@ -1901,8 +1891,6 @@ function modifyhost($values,$values_old) { $attr['ntPassword'] = '0CB6948805F797BF2A82807973B89537'; $attr['lmPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; $attr['pwdLastSet'] = time(); // sambaAccount_may - $attr['userPassword'] = ''; - $attr['shadowLastChange'] = getdays(); } if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0]; if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may diff --git a/lam/lib/lamdaemon.pl b/lam/lib/lamdaemon.pl index e2491adc..03e4da1f 100755 --- a/lam/lib/lamdaemon.pl +++ b/lam/lib/lamdaemon.pl @@ -24,7 +24,6 @@ $debug=true; # Show debug messages -use Quota; # Needed to get and set quotas #use strict; # Use strict for security reasons @quota_grp; @@ -69,6 +68,9 @@ sub get_fs { # Load mountpoints from mtab if enabled quotas # ***************** Check values if ($( == 0 ) { + if ($ARGV[2] eq "*test") { print "sudo set up correctly.\n"; } + use Quota; # Needed to get and set quotas + if ($ARGV[2] eq "*test") { print "Perl quota module successfully installed.\n"; } # Drop root Previleges ($<, $>) = ($>, $<); switch: { @@ -175,12 +177,14 @@ if ($( == 0 ) { }; last switch; }; - print "$return\n"; + if ($ARGV[2] eq "*test") { print "If you have'nt seen any error lamdaemon.pl should set up successfully.\n"; } + else { print "$return\n"; } } else { $hostname = shift @ARGV; $remotepath = shift @ARGV; use Net::SSH::Perl; + if ($ARGV[2] eq "*test") { print "Net::SSH::Perl successfully installed.\n"; } @username = split (',', $ARGV[0]); $username[0] =~ s/uid=//; my $ssh = Net::SSH::Perl->new($hostname, options=>[ diff --git a/lam/templates/account/hostedit.php b/lam/templates/account/hostedit.php index 5921a0c7..06c90eca 100644 --- a/lam/templates/account/hostedit.php +++ b/lam/templates/account/hostedit.php @@ -423,7 +423,7 @@ switch ($select_local) { echo _("Save profile"); echo "\n\n\n\n\n
"; echo ''; - echo ''._('Help'); echo "
\n";