diff --git a/lam/lib/lamdaemon.inc b/lam/lib/lamdaemon.inc index 3bf9db9b..320ea441 100644 --- a/lam/lib/lamdaemon.inc +++ b/lam/lib/lamdaemon.inc @@ -112,11 +112,11 @@ function lamdaemonSSH($commands, $server) { return $return; } $entry = @ldap_get_entries($_SESSION['ldap']->server(), $sr); - $userName = $entry[0]['uid'][0]; - if (!$userName) { + if (!isset($entry[0]['uid'][0])) { $return = array("ERROR," . _("Your LAM admin user must be a valid Unix account to work with lamdaemon!") . ","); return $return; } + $userName = $entry[0]['uid'][0]; if (@ssh2_auth_password($handle, $userName, $credentials[1])) { $shell = ssh2_exec($handle, "sudo " . $_SESSION['config']->get_scriptPath()); fwrite($shell, $commands); diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index b2113ae4..1521a198 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -612,7 +612,7 @@ class posixAccount extends baseModule { */ function preDeleteActions() { $return = true; - if ($_POST['deletehomedir']) { + if (isset($_POST['deletehomedir'])) { // get list of lamdaemon servers $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); for ($i = 0; $i < sizeof($lamdaemonServers); $i++) {