removed syntax check for LDAP suffixes

This commit is contained in:
Roland Gruber 2004-08-14 12:39:36 +00:00
parent 03bd121d1c
commit a9bb380ccf
4 changed files with 24 additions and 8 deletions

View File

@ -354,7 +354,7 @@ class Config {
// $value: new user suffix // $value: new user suffix
// returns true if $value has correct format // returns true if $value has correct format
function set_UserSuffix($value) { 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; $this->usersuffix = $value;
} }
else return false; else return false;
@ -370,7 +370,7 @@ class Config {
// $value: new group suffix // $value: new group suffix
// returns true if $value has correct format // returns true if $value has correct format
function set_GroupSuffix($value) { 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; $this->groupsuffix = $value;
} }
else return false; else return false;
@ -386,7 +386,7 @@ class Config {
// $value: new host suffix // $value: new host suffix
// returns true if $value has correct format // returns true if $value has correct format
function set_HostSuffix($value) { 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; $this->hostsuffix = $value;
} }
else return false; else return false;
@ -403,7 +403,7 @@ class Config {
// returns true if $value has correct format // returns true if $value has correct format
function set_DomainSuffix($value) { function set_DomainSuffix($value) {
if (!$value && ($this->get_Samba3() == "no")) $this->domainsuffix = ""; 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; $this->domainsuffix = $value;
} }
else return false; else return false;

View File

@ -78,6 +78,14 @@ echo "</head><body>\n";
echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">". echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">".
"<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>"); "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>");
// 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 // check new preferences
if (!$conf->set_samba3($samba3)) { if (!$conf->set_samba3($samba3)) {
echo ("<font color=\"red\"><b>" . _("Samba version is not defined!") . "</b></font>"); echo ("<font color=\"red\"><b>" . _("Samba version is not defined!") . "</b></font>");

View File

@ -440,7 +440,7 @@ class Config {
* @return true if $value has correct format * @return true if $value has correct format
*/ */
function set_UserSuffix($value) { 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; $this->usersuffix = $value;
} }
else return false; else return false;
@ -463,7 +463,7 @@ class Config {
* @return true if $value has correct format * @return true if $value has correct format
*/ */
function set_GroupSuffix($value) { 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; $this->groupsuffix = $value;
} }
else return false; else return false;
@ -487,7 +487,7 @@ class Config {
*/ */
function set_HostSuffix($value) { function set_HostSuffix($value) {
if (! $value) $this->hostsuffix = ""; 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; $this->hostsuffix = $value;
} }
else return false; else return false;
@ -511,7 +511,7 @@ class Config {
*/ */
function set_DomainSuffix($value) { function set_DomainSuffix($value) {
if (!$value) $this->domainsuffix = ""; 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; $this->domainsuffix = $value;
} }
else return false; else return false;

View File

@ -78,6 +78,14 @@ echo "</head><body>\n";
echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">". echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">".
"<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>"); "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>");
// 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 // check new preferences
if (!$conf->set_ServerURL($serverurl)) { if (!$conf->set_ServerURL($serverurl)) {
echo ("<font color=\"red\"><b>" . _("Server Address is empty!") . "</b></font>"); echo ("<font color=\"red\"><b>" . _("Server Address is empty!") . "</b></font>");