fixed PHP notices

This commit is contained in:
Roland Gruber 2008-07-22 17:30:11 +00:00
parent a0ac8f504e
commit 2c6751b7bb
2 changed files with 3 additions and 3 deletions

View File

@ -112,11 +112,11 @@ function lamdaemonSSH($commands, $server) {
return $return; return $return;
} }
$entry = @ldap_get_entries($_SESSION['ldap']->server(), $sr); $entry = @ldap_get_entries($_SESSION['ldap']->server(), $sr);
$userName = $entry[0]['uid'][0]; if (!isset($entry[0]['uid'][0])) {
if (!$userName) {
$return = array("ERROR," . _("Your LAM admin user must be a valid Unix account to work with lamdaemon!") . ","); $return = array("ERROR," . _("Your LAM admin user must be a valid Unix account to work with lamdaemon!") . ",");
return $return; return $return;
} }
$userName = $entry[0]['uid'][0];
if (@ssh2_auth_password($handle, $userName, $credentials[1])) { if (@ssh2_auth_password($handle, $userName, $credentials[1])) {
$shell = ssh2_exec($handle, "sudo " . $_SESSION['config']->get_scriptPath()); $shell = ssh2_exec($handle, "sudo " . $_SESSION['config']->get_scriptPath());
fwrite($shell, $commands); fwrite($shell, $commands);

View File

@ -612,7 +612,7 @@ class posixAccount extends baseModule {
*/ */
function preDeleteActions() { function preDeleteActions() {
$return = true; $return = true;
if ($_POST['deletehomedir']) { if (isset($_POST['deletehomedir'])) {
// get list of lamdaemon servers // get list of lamdaemon servers
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
for ($i = 0; $i < sizeof($lamdaemonServers); $i++) { for ($i = 0; $i < sizeof($lamdaemonServers); $i++) {