fixed PHP notices for hosts

This commit is contained in:
Roland Gruber 2016-01-09 19:20:28 +00:00
parent ed0673332f
commit 06f47376e5
1 changed files with 14 additions and 2 deletions

View File

@ -1460,8 +1460,13 @@ class posixAccount extends baseModule implements passwordService {
}
if ($this->manageCn() && (!isset($this->attributes['cn'][0]) || ($this->attributes['cn'][0] == ''))) {
// set a default value for common name
if (($this->get_scope() == 'host') && isset($_POST['uid']) && (substr($_POST['uid'], -1, 1) == '$')) {
$this->attributes['cn'][0] = substr($_POST['uid'], 0, strlen($_POST['uid']) - 1);
if (($this->get_scope() == 'host') && isset($_POST['uid'])) {
if (substr($_POST['uid'], -1, 1) == '$') {
$this->attributes['cn'][0] = substr($_POST['uid'], 0, strlen($_POST['uid']) - 1);
}
else {
$this->attributes['cn'][0] = $_POST['uid'];
}
}
elseif ($this->getAccountContainer()->getAccountModule('inetOrgPerson') != null) {
$attrs = $this->getAccountContainer()->getAccountModule('inetOrgPerson')->getAttributes();
@ -2340,6 +2345,13 @@ class posixAccount extends baseModule implements passwordService {
if (!checkIfWriteAccessIsAllowed($this->get_scope())) {
die();
}
if ($this->get_scope() != 'user') {
return array(
'status' => 'finished',
'progress' => 100,
'errors' => array()
);
}
// on first call generate list of ldap operations
if (!isset($temp['counter'])) {
$temp['groups'] = array();