allow spaces in suffixes and ou's
This commit is contained in:
parent
5a735e1c5a
commit
ac919a161e
|
@ -314,7 +314,7 @@ class Config {
|
||||||
// returns true if $value has correct format
|
// returns true if $value has correct format
|
||||||
function set_Adminstring($value) {
|
function set_Adminstring($value) {
|
||||||
if (is_string($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;
|
$this->Admins = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -344,7 +344,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-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;
|
$this->usersuffix = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -360,7 +360,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-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;
|
$this->groupsuffix = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -376,7 +376,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-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;
|
$this->hostsuffix = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -393,7 +393,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-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;
|
$this->domainsuffix = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|
|
@ -39,7 +39,7 @@ if ($_POST['submit']) {
|
||||||
// new user ou
|
// new user ou
|
||||||
if ($_POST['type'] == "new_usr") {
|
if ($_POST['type'] == "new_usr") {
|
||||||
// create ou if valid
|
// 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
|
// check if ou already exists
|
||||||
$new_dn = "ou=" . $_POST['newsuff_u'] . "," . $_POST['usersuff_n'];
|
$new_dn = "ou=" . $_POST['newsuff_u'] . "," . $_POST['usersuff_n'];
|
||||||
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_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
|
// new group ou
|
||||||
if ($_POST['type'] == "new_grp") {
|
if ($_POST['type'] == "new_grp") {
|
||||||
// create ou if valid
|
// 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
|
// check if ou already exists
|
||||||
$new_dn = "ou=" . $_POST['newsuff_g'] . "," . $_POST['groupsuff_n'];
|
$new_dn = "ou=" . $_POST['newsuff_g'] . "," . $_POST['groupsuff_n'];
|
||||||
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_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
|
// new host ou
|
||||||
if ($_POST['type'] == "new_hst") {
|
if ($_POST['type'] == "new_hst") {
|
||||||
// create ou if valid
|
// 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
|
// check if ou already exists
|
||||||
$new_dn = "ou=" . $_POST['newsuff_h'] . "," . $_POST['hostsuff_n'];
|
$new_dn = "ou=" . $_POST['newsuff_h'] . "," . $_POST['hostsuff_n'];
|
||||||
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_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
|
// new domain ou
|
||||||
if ($_POST['type'] == "new_dom") {
|
if ($_POST['type'] == "new_dom") {
|
||||||
// create ou if valid
|
// 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
|
// check if ou already exists
|
||||||
$new_dn = "ou=" . $_POST['newsuff_d'] . "," . $_POST['domsuff_n'];
|
$new_dn = "ou=" . $_POST['newsuff_d'] . "," . $_POST['domsuff_n'];
|
||||||
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['domsuff_n']))) {
|
if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['domsuff_n']))) {
|
||||||
|
|
Loading…
Reference in New Issue