allow spaces in suffixes and ou's

This commit is contained in:
Roland Gruber 2003-11-06 22:02:58 +00:00
parent 5a735e1c5a
commit ac919a161e
2 changed files with 9 additions and 9 deletions

View File

@ -314,7 +314,7 @@ class Config {
// returns true if $value has correct format
function set_Adminstring($value) {
if (is_string($value) &&
eregi("^([a-z0-9]|-)+=([a-z0-9]|-)+(,([a-z0-9]|-)+=([a-z0-9]|-)+)+(;([a-z0-9]|-)+=([a-z0-9]|-)+(,([a-z0-9]|-)+=([a-z0-9]|-)+)+)*$", $value)) {
eregi("^[a-z0-9\\-]+=[a-z0-9\\-]+(,[a-z0-9\\-]+=[a-z0-9 \\-]+)+(;[a-z0-9\\-]+=[a-z0-9\\-]+(,[a-z0-9\\-]+=[a-z0-9 \\-]+)+)*$", $value)) {
$this->Admins = $value;
}
else return false;
@ -344,7 +344,7 @@ class Config {
// $value: new user suffix
// returns true if $value has correct format
function set_UserSuffix($value) {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) {
$this->usersuffix = $value;
}
else return false;
@ -360,7 +360,7 @@ class Config {
// $value: new group suffix
// returns true if $value has correct format
function set_GroupSuffix($value) {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) {
$this->groupsuffix = $value;
}
else return false;
@ -376,7 +376,7 @@ class Config {
// $value: new host suffix
// returns true if $value has correct format
function set_HostSuffix($value) {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) {
$this->hostsuffix = $value;
}
else return false;
@ -393,7 +393,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-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
elseif (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) {
$this->domainsuffix = $value;
}
else return false;

View File

@ -39,7 +39,7 @@ if ($_POST['submit']) {
// new user ou
if ($_POST['type'] == "new_usr") {
// create ou if valid
if (eregi("^[a-z0-9_\\-]+$", $_POST['newsuff_u'])) {
if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_u'])) {
// check if ou already exists
$new_dn = "ou=" . $_POST['newsuff_u'] . "," . $_POST['usersuff_n'];
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['usersuff_n']))) {
@ -104,7 +104,7 @@ if ($_POST['submit']) {
// new group ou
if ($_POST['type'] == "new_grp") {
// create ou if valid
if (eregi("^[a-z0-9_\\-]+$", $_POST['newsuff_g'])) {
if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_g'])) {
// check if ou already exists
$new_dn = "ou=" . $_POST['newsuff_g'] . "," . $_POST['groupsuff_n'];
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['groupsuff_n']))) {
@ -169,7 +169,7 @@ if ($_POST['submit']) {
// new host ou
if ($_POST['type'] == "new_hst") {
// create ou if valid
if (eregi("^[a-z0-9_\\-]+$", $_POST['newsuff_h'])) {
if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_h'])) {
// check if ou already exists
$new_dn = "ou=" . $_POST['newsuff_h'] . "," . $_POST['hostsuff_n'];
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['hostsuff_n']))) {
@ -234,7 +234,7 @@ if ($_POST['submit']) {
// new domain ou
if ($_POST['type'] == "new_dom") {
// create ou if valid
if (eregi("^[a-z0-9_\\-]+$", $_POST['newsuff_d'])) {
if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_d'])) {
// check if ou already exists
$new_dn = "ou=" . $_POST['newsuff_d'] . "," . $_POST['domsuff_n'];
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['domsuff_n']))) {