diff --git a/lam/lib/blowfish.inc b/lam/lib/blowfish.inc index 0e2a87d1..32c6370e 100644 --- a/lam/lib/blowfish.inc +++ b/lam/lib/blowfish.inc @@ -322,7 +322,7 @@ class Cipher_blowfish { var $_rounds = 16; /** Constructor */ - function Cipher_blowfish($params = null) + function Cipher_blowfish() { } diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index 4a24b4e5..d2776236 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -224,6 +224,7 @@ class Ldap{ ldap_free_result($sr); return $ret; } + else return ""; } /** @@ -301,7 +302,7 @@ class Ldap{ if ($info) { $this->objectClasses = $info[0]['objectclasses']; array_shift($this->objectClasses); - return true; + return; } } // if search failed save empty result @@ -357,7 +358,7 @@ class Ldap{ } } } - @closedir($h); + @closedir($dir); } } @@ -488,6 +489,7 @@ class Ldap{ elseif ($part_a == max($part_a, $part_b)) return 1; else return -1; } + return -1; } /** diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 571a39e1..effb35f5 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -59,12 +59,12 @@ function listSort($sort, $attr_array, $info) { if ($sort != "dn") { // sort by first attribute with name $sort if ($a[$sort][0] == $b[$sort][0]) return 0; - else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1; + elseif ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1; else return -1; } else { if ($a[$sort] == $b[$sort]) return 0; - else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1; + elseif ($a[$sort] == max($a[$sort], $b[$sort])) return 1; else return -1; } } diff --git a/lam/lib/profiles.inc b/lam/lib/profiles.inc index 06ac2469..4dc85441 100644 --- a/lam/lib/profiles.inc +++ b/lam/lib/profiles.inc @@ -326,6 +326,7 @@ function saveHostProfile($attributes, $profile) { * Deletes a user profile * * @param string $file name of profile (Without .pru) +* @return boolean true if profile was deleted */ function delUserProfile($file) { if (!$_SESSION['loggedIn'] == true) return false; @@ -334,12 +335,14 @@ function delUserProfile($file) { if (is_file($prof)) { return @unlink($prof); } + else return false; } /** * Deletes a group profile * * @param string $file name of profile (Without .prg) +* @return boolean true if profile was deleted */ function delGroupProfile($file) { if (!$_SESSION['loggedIn'] == true) return false; @@ -348,12 +351,14 @@ function delGroupProfile($file) { if (is_file($prof)) { return @unlink($prof); } + else return false; } /** * Deletes a host profile * * @param string $file name of profile (Without .prh) +* @return boolean true if profile was deleted */ function delHostProfile($file) { if (!$_SESSION['loggedIn'] == true) return false; @@ -362,6 +367,7 @@ function delHostProfile($file) { if (is_file($prof)) { return @unlink($prof); } + else return false; } ?> diff --git a/lam/templates/config/conflogin.php b/lam/templates/config/conflogin.php index 62ed2cf6..edc8803d 100644 --- a/lam/templates/config/conflogin.php +++ b/lam/templates/config/conflogin.php @@ -89,7 +89,7 @@ echo $_SESSION['header'];   " . "" . $message . "" . ""); diff --git a/lam/templates/domain.php b/lam/templates/domain.php index cfbdc8b0..c23056dc 100644 --- a/lam/templates/domain.php +++ b/lam/templates/domain.php @@ -264,7 +264,7 @@ elseif ($_POST['sub_save']) { if ($_POST['dom_DN'] != $newDN) { $success = ldap_rename($_SESSION['ldap']->server(), $_POST['dom_DN'], $RDN, $_POST['dom_suffix'], true); } - if ($success) StatusMessage("INFO", _("Domain has been modified."), $DN); + if ($success) StatusMessage("INFO", _("Domain has been modified."), $_POST['dom_DN']); else StatusMessage("ERROR", "", _("Failed to modify domain!")); } // add entry diff --git a/lam/templates/lists/listdomains.php b/lam/templates/lists/listdomains.php index a3573f01..38328937 100644 --- a/lam/templates/lists/listdomains.php +++ b/lam/templates/lists/listdomains.php @@ -135,7 +135,7 @@ echo ("
\n"); // draw navigation bar if domain accounts were found if (sizeof($dom_info) > 0) { -listDrawNavigationBar(sizeof($dom_info), $max_page_entries, $page, $sort, $searchFilter, "domain", _("%s Samba domain(s) found")); +listDrawNavigationBar(sizeof($dom_info), $max_page_entries, $page, $sort, '', "domain", _("%s Samba domain(s) found")); echo ("
\n"); } @@ -185,7 +185,7 @@ echo ("
"); // draw navigation bar if domain accounts were found if (sizeof($dom_info) > 0) { -listDrawNavigationBar(sizeof($dom_info), $max_page_entries, $page, $sort, $searchFilter, "domain", _("%s Samba domain(s) found")); +listDrawNavigationBar(sizeof($dom_info), $max_page_entries, $page, $sort, '', "domain", _("%s Samba domain(s) found")); echo ("
\n"); } diff --git a/lam/templates/profedit/profilecreate.php b/lam/templates/profedit/profilecreate.php index 85ba8edd..c6e3e1e6 100644 --- a/lam/templates/profedit/profilecreate.php +++ b/lam/templates/profedit/profilecreate.php @@ -110,21 +110,21 @@ else { // input data is valid, save profile // save profile if ($_POST['accounttype'] == "user") { if (saveUserProfile($options, $_POST['profname'])) { - echo StatusMessage("INFO", _("Profile was saved."), $profname); + echo StatusMessage("INFO", _("Profile was saved."), $_POST['profname']); } - else StatusMessage("ERROR", _("Unable to save profile!"), $profname); + else StatusMessage("ERROR", _("Unable to save profile!"), $_POST['profname']); } elseif ($_POST['accounttype'] == "group") { if (saveGroupProfile($options, $_POST['profname'])) { - echo StatusMessage("INFO", _("Profile was saved."), $profname); + echo StatusMessage("INFO", _("Profile was saved."), $_POST['profname']); } - else StatusMessage("ERROR", _("Unable to save profile!"), $profname); + else StatusMessage("ERROR", _("Unable to save profile!"), $_POST['profname']); } elseif ($_POST['accounttype'] == "host") { if (saveHostProfile($options, $_POST['profname'])) { - echo StatusMessage("INFO", _("Profile was saved."), $profname); + echo StatusMessage("INFO", _("Profile was saved."), $_POST['profname']); } - else StatusMessage("ERROR", _("Unable to save profile!"), $profname); + else StatusMessage("ERROR", _("Unable to save profile!"), $_POST['profname']); } echo ("

" . _("Back to Profile Editor") . "

"); } diff --git a/lam/templates/profedit/profilepage.php b/lam/templates/profedit/profilepage.php index 28a8c72a..69bc6df2 100644 --- a/lam/templates/profedit/profilepage.php +++ b/lam/templates/profedit/profilepage.php @@ -68,8 +68,8 @@ $options = getProfileOptions($type); $old_options = array(); if ($_GET['edit']) { if ($type == "user") $old_options = loadUserProfile($_GET['edit']); - else if ($type == "group") $old_options = loadGroupProfile($_GET['edit']); - else if ($type == "host") $old_options = loadHostProfile($_GET['edit']); + elseif ($type == "group") $old_options = loadGroupProfile($_GET['edit']); + elseif ($type == "host") $old_options = loadHostProfile($_GET['edit']); } // display formular