diff --git a/lam-0.4/lib/config.inc b/lam-0.4/lib/config.inc index 687d92c7..4e58c9a4 100644 --- a/lam-0.4/lib/config.inc +++ b/lam-0.4/lib/config.inc @@ -354,7 +354,7 @@ class Config { // $value: new user suffix // returns true if $value has correct format function set_UserSuffix($value) { - if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + if (is_string($value)) { $this->usersuffix = $value; } else return false; @@ -370,7 +370,7 @@ class Config { // $value: new group suffix // returns true if $value has correct format function set_GroupSuffix($value) { - if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + if (is_string($value)) { $this->groupsuffix = $value; } else return false; @@ -386,7 +386,7 @@ class Config { // $value: new host suffix // returns true if $value has correct format function set_HostSuffix($value) { - if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + if (is_string($value)) { $this->hostsuffix = $value; } else return false; @@ -403,7 +403,7 @@ class Config { // returns true if $value has correct format function set_DomainSuffix($value) { if (!$value && ($this->get_Samba3() == "no")) $this->domainsuffix = ""; - elseif (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + elseif (is_string($value)) { $this->domainsuffix = $value; } else return false; diff --git a/lam-0.4/templates/config/confsave.php b/lam-0.4/templates/config/confsave.php index 2b1213be..087199ee 100644 --- a/lam-0.4/templates/config/confsave.php +++ b/lam-0.4/templates/config/confsave.php @@ -78,6 +78,14 @@ echo "\n"; echo ("

". "\"LDAP




"); +// remove double slashes if magic quotes are on +if (get_magic_quotes_gpc() == 1) { + $suffusers = stripslashes($suffusers); + $suffgroups = stripslashes($suffgroups); + $suffhosts = stripslashes($suffhosts); + $suffdomains = stripslashes($suffdomains); +} + // check new preferences if (!$conf->set_samba3($samba3)) { echo ("" . _("Samba version is not defined!") . ""); diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 473b3aa4..c6530fc4 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -440,7 +440,7 @@ class Config { * @return true if $value has correct format */ function set_UserSuffix($value) { - if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + if (is_string($value)) { $this->usersuffix = $value; } else return false; @@ -463,7 +463,7 @@ class Config { * @return true if $value has correct format */ function set_GroupSuffix($value) { - if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + if (is_string($value)) { $this->groupsuffix = $value; } else return false; @@ -487,7 +487,7 @@ class Config { */ function set_HostSuffix($value) { if (! $value) $this->hostsuffix = ""; - elseif (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + elseif (is_string($value)) { $this->hostsuffix = $value; } else return false; @@ -511,7 +511,7 @@ class Config { */ function set_DomainSuffix($value) { if (!$value) $this->domainsuffix = ""; - elseif (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + elseif (is_string($value)) { $this->domainsuffix = $value; } else return false; diff --git a/lam/templates/config/confsave.php b/lam/templates/config/confsave.php index 81352c02..0daf74c2 100644 --- a/lam/templates/config/confsave.php +++ b/lam/templates/config/confsave.php @@ -78,6 +78,14 @@ echo "\n"; echo ("

". "\"LDAP




"); +// remove double slashes if magic quotes are on +if (get_magic_quotes_gpc() == 1) { + $suffusers = stripslashes($suffusers); + $suffgroups = stripslashes($suffgroups); + $suffhosts = stripslashes($suffhosts); + $suffdomains = stripslashes($suffdomains); +} + // check new preferences if (!$conf->set_ServerURL($serverurl)) { echo ("" . _("Server Address is empty!") . "");