mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 17:59:21 +02:00
refactoring
This commit is contained in:
parent
da91a73104
commit
f802edbe4a
3 changed files with 38 additions and 38 deletions
|
@ -56,7 +56,7 @@ class kolabGroup extends baseModule {
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
return in_array($this->get_scope(), ['group']);
|
return $this->get_scope() === 'group';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -302,7 +302,7 @@ class kolabGroup extends baseModule {
|
||||||
*/
|
*/
|
||||||
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
||||||
$messages = [];
|
$messages = [];
|
||||||
for ($i = 0; $i < sizeof($rawAccounts); $i++) {
|
for ($i = 0; $i < count($rawAccounts); $i++) {
|
||||||
// check if extension should be added
|
// check if extension should be added
|
||||||
if (isset($rawAccounts[$i][$ids['kolabGroup_addExtension']]) && ($rawAccounts[$i][$ids['kolabGroup_addExtension']] != 'true')) {
|
if (isset($rawAccounts[$i][$ids['kolabGroup_addExtension']]) && ($rawAccounts[$i][$ids['kolabGroup_addExtension']] != 'true')) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -320,13 +320,13 @@ class kolabGroup extends baseModule {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$errMsg = $this->messages['mail'][3];
|
$errMsg = $this->messages['mail'][3];
|
||||||
array_push($errMsg, [$i]);
|
$errMsg[] = [$i];
|
||||||
$messages[] = $errMsg;
|
$messages[] = $errMsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$errMsg = $this->messages['mail'][1];
|
$errMsg = $this->messages['mail'][1];
|
||||||
array_push($errMsg, [$i]);
|
$errMsg[] = [$i];
|
||||||
$messages[] = $errMsg;
|
$messages[] = $errMsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class kolabSharedFolder extends baseModule {
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
return in_array($this->get_scope(), ['kolabSharedFolderType']);
|
return $this->get_scope() === 'kolabSharedFolderType';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -261,14 +261,14 @@ class kolabSharedFolder extends baseModule {
|
||||||
// delegates
|
// delegates
|
||||||
$delegatesData = searchLDAPByAttribute('mail', '*', 'inetOrgPerson', ['dn'], ['user']);
|
$delegatesData = searchLDAPByAttribute('mail', '*', 'inetOrgPerson', ['dn'], ['user']);
|
||||||
$delegates = [];
|
$delegates = [];
|
||||||
for ($i = 0; $i < sizeof($delegatesData); $i++) {
|
for ($i = 0; $i < count($delegatesData); $i++) {
|
||||||
$delegates[getAbstractDN($delegatesData[$i]['dn'])] = $delegatesData[$i]['dn'];
|
$delegates[getAbstractDN($delegatesData[$i]['dn'])] = $delegatesData[$i]['dn'];
|
||||||
}
|
}
|
||||||
uksort($delegates, 'compareDN');
|
uksort($delegates, 'compareDN');
|
||||||
$container->add(new htmlSubTitle(_('Delegates')));
|
$container->add(new htmlSubTitle(_('Delegates')));
|
||||||
$delegatesContainer = new htmlTable();
|
$delegatesContainer = new htmlTable();
|
||||||
if (isset($this->attributes['kolabDelegate'])) {
|
if (isset($this->attributes['kolabDelegate'])) {
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabDelegate']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabDelegate']); $i++) {
|
||||||
$delegateSelect = new htmlSelect('delegate' . $i, $delegates, [$this->attributes['kolabDelegate'][$i]]);
|
$delegateSelect = new htmlSelect('delegate' . $i, $delegates, [$this->attributes['kolabDelegate'][$i]]);
|
||||||
$delegateSelect->setHasDescriptiveElements(true);
|
$delegateSelect->setHasDescriptiveElements(true);
|
||||||
$delegateSelect->setSortElements(false);
|
$delegateSelect->setSortElements(false);
|
||||||
|
@ -347,12 +347,12 @@ class kolabSharedFolder extends baseModule {
|
||||||
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
||||||
$messages = [];
|
$messages = [];
|
||||||
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', ['dn'], ['user']);
|
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', ['dn'], ['user']);
|
||||||
for ($d = 0; $d < sizeof($delegates); $d++) {
|
for ($d = 0; $d < count($delegates); $d++) {
|
||||||
if (isset($delegates[$d]['dn'])) {
|
if (isset($delegates[$d]['dn'])) {
|
||||||
$delegates[$d] = $delegates[$d]['dn'];
|
$delegates[$d] = $delegates[$d]['dn'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < sizeof($rawAccounts); $i++) {
|
for ($i = 0; $i < count($rawAccounts); $i++) {
|
||||||
// add object classes
|
// add object classes
|
||||||
if (!in_array('kolabSharedFolder', $partialAccounts[$i]['objectClass'])) {
|
if (!in_array('kolabSharedFolder', $partialAccounts[$i]['objectClass'])) {
|
||||||
$partialAccounts[$i]['objectClass'][] = 'kolabSharedFolder';
|
$partialAccounts[$i]['objectClass'][] = 'kolabSharedFolder';
|
||||||
|
@ -379,14 +379,14 @@ class kolabSharedFolder extends baseModule {
|
||||||
if ($rawAccounts[$i][$ids['kolabSharedFolder_delegates']] != "") {
|
if ($rawAccounts[$i][$ids['kolabSharedFolder_delegates']] != "") {
|
||||||
$newDelegates = explode(';', $rawAccounts[$i][$ids['kolabSharedFolder_delegates']]);
|
$newDelegates = explode(';', $rawAccounts[$i][$ids['kolabSharedFolder_delegates']]);
|
||||||
// check format
|
// check format
|
||||||
for ($d = 0; $d < sizeof($newDelegates); $d++) {
|
for ($d = 0; $d < count($newDelegates); $d++) {
|
||||||
if (in_array($newDelegates[$d], $delegates)) {
|
if (in_array($newDelegates[$d], $delegates)) {
|
||||||
$partialAccounts[$i]['kolabDelegate'][] = $newDelegates[$d];
|
$partialAccounts[$i]['kolabDelegate'][] = $newDelegates[$d];
|
||||||
}
|
}
|
||||||
// invalid format
|
// invalid format
|
||||||
else {
|
else {
|
||||||
$errMsg = $this->messages['delegate'][0];
|
$errMsg = $this->messages['delegate'][0];
|
||||||
array_push($errMsg, [$i, $newDelegates[$d]]);
|
$errMsg[] = [$i, $newDelegates[$d]];
|
||||||
$messages[] = $errMsg;
|
$messages[] = $errMsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,7 @@ class kolabSharedFolder extends baseModule {
|
||||||
return function(array $entry, string $attribute): ?htmlElement {
|
return function(array $entry, string $attribute): ?htmlElement {
|
||||||
$group = new htmlGroup();
|
$group = new htmlGroup();
|
||||||
if (isset($entry[$attribute][0]) && ($entry[$attribute][0] != '')) {
|
if (isset($entry[$attribute][0]) && ($entry[$attribute][0] != '')) {
|
||||||
for ($i = 0; $i < sizeof($entry[$attribute]); $i++) {
|
for ($i = 0; $i < count($entry[$attribute]); $i++) {
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$group->addElement(new htmlOutputText(", "));
|
$group->addElement(new htmlOutputText(", "));
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,9 +264,9 @@ class kolabUser extends baseModule {
|
||||||
// default invitation policy
|
// default invitation policy
|
||||||
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
||||||
if (isset($this->attributes['kolabInvitationPolicy'])) {
|
if (isset($this->attributes['kolabInvitationPolicy'])) {
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||||
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||||
if (sizeof($parts) == 1) {
|
if (count($parts) == 1) {
|
||||||
$defaultInvPol = $this->invitationPolicies[$this->attributes['kolabInvitationPolicy'][$i]];
|
$defaultInvPol = $this->invitationPolicies[$this->attributes['kolabInvitationPolicy'][$i]];
|
||||||
unset($this->attributes['kolabInvitationPolicy'][$i]);
|
unset($this->attributes['kolabInvitationPolicy'][$i]);
|
||||||
$this->attributes['kolabInvitationPolicy'] = array_values($this->attributes['kolabInvitationPolicy']);
|
$this->attributes['kolabInvitationPolicy'] = array_values($this->attributes['kolabInvitationPolicy']);
|
||||||
|
@ -279,9 +279,9 @@ class kolabUser extends baseModule {
|
||||||
$invitationContainer->addElement(new htmlHelpLink('invPol'), true);
|
$invitationContainer->addElement(new htmlHelpLink('invPol'), true);
|
||||||
// other invitation policies
|
// other invitation policies
|
||||||
if (isset($this->attributes['kolabInvitationPolicy'])) {
|
if (isset($this->attributes['kolabInvitationPolicy'])) {
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||||
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||||
if (sizeof($parts) == 2) {
|
if (count($parts) == 2) {
|
||||||
$invitationContainer->addElement(new htmlInputField('invPol1' . $i, $parts[0]));
|
$invitationContainer->addElement(new htmlInputField('invPol1' . $i, $parts[0]));
|
||||||
$invitationContainer->addElement(new htmlSelect('invPol2' . $i, array_values($this->invitationPolicies), [$this->invitationPolicies[$parts[1]]]));
|
$invitationContainer->addElement(new htmlSelect('invPol2' . $i, array_values($this->invitationPolicies), [$this->invitationPolicies[$parts[1]]]));
|
||||||
$invitationContainer->addElement(new htmlButton('delInvPol' . $i, 'del.svg', true));
|
$invitationContainer->addElement(new htmlButton('delInvPol' . $i, 'del.svg', true));
|
||||||
|
@ -301,14 +301,14 @@ class kolabUser extends baseModule {
|
||||||
// delegates
|
// delegates
|
||||||
$delegatesData = searchLDAPByAttribute('mail', '*', 'inetOrgPerson', ['dn'], ['user']);
|
$delegatesData = searchLDAPByAttribute('mail', '*', 'inetOrgPerson', ['dn'], ['user']);
|
||||||
$delegates = [];
|
$delegates = [];
|
||||||
for ($i = 0; $i < sizeof($delegatesData); $i++) {
|
for ($i = 0; $i < count($delegatesData); $i++) {
|
||||||
$delegates[getAbstractDN($delegatesData[$i]['dn'])] = $delegatesData[$i]['dn'];
|
$delegates[getAbstractDN($delegatesData[$i]['dn'])] = $delegatesData[$i]['dn'];
|
||||||
}
|
}
|
||||||
uksort($delegates, 'compareDN');
|
uksort($delegates, 'compareDN');
|
||||||
$return->add(new htmlSubTitle(_('Delegates')));
|
$return->add(new htmlSubTitle(_('Delegates')));
|
||||||
$delegatesContainer = new htmlTable();
|
$delegatesContainer = new htmlTable();
|
||||||
if (isset($this->attributes['kolabDelegate'])) {
|
if (isset($this->attributes['kolabDelegate'])) {
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabDelegate']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabDelegate']); $i++) {
|
||||||
$delegateSelect = new htmlSelect('delegate' . $i, $delegates, [$this->attributes['kolabDelegate'][$i]]);
|
$delegateSelect = new htmlSelect('delegate' . $i, $delegates, [$this->attributes['kolabDelegate'][$i]]);
|
||||||
$delegateSelect->setSortElements(false);
|
$delegateSelect->setSortElements(false);
|
||||||
$delegateSelect->setHasDescriptiveElements(true);
|
$delegateSelect->setHasDescriptiveElements(true);
|
||||||
|
@ -499,12 +499,12 @@ class kolabUser extends baseModule {
|
||||||
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
|
||||||
$messages = [];
|
$messages = [];
|
||||||
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', ['mail'], ['user']);
|
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', ['mail'], ['user']);
|
||||||
for ($d = 0; $d < sizeof($delegates); $d++) {
|
for ($d = 0; $d < count($delegates); $d++) {
|
||||||
if (isset($delegates[$d]['dn'])) {
|
if (isset($delegates[$d]['dn'])) {
|
||||||
$delegates[$d] = $delegates[$d]['dn'];
|
$delegates[$d] = $delegates[$d]['dn'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < sizeof($rawAccounts); $i++) {
|
for ($i = 0; $i < count($rawAccounts); $i++) {
|
||||||
// add object class
|
// add object class
|
||||||
if (!in_array("kolabInetOrgPerson", $partialAccounts[$i]['objectClass'])) {
|
if (!in_array("kolabInetOrgPerson", $partialAccounts[$i]['objectClass'])) {
|
||||||
$partialAccounts[$i]['objectClass'][] = "kolabInetOrgPerson";
|
$partialAccounts[$i]['objectClass'][] = "kolabInetOrgPerson";
|
||||||
|
@ -529,10 +529,10 @@ class kolabUser extends baseModule {
|
||||||
// check format
|
// check format
|
||||||
$policies = array_keys($this->invitationPolicies);
|
$policies = array_keys($this->invitationPolicies);
|
||||||
$defaultFound = false;
|
$defaultFound = false;
|
||||||
for ($p = 0; $p < sizeof($pols); $p++) {
|
for ($p = 0; $p < count($pols); $p++) {
|
||||||
$parts = explode(":", $pols[$p]);
|
$parts = explode(":", $pols[$p]);
|
||||||
// default policy
|
// default policy
|
||||||
if (sizeof($parts) == 1) {
|
if (count($parts) == 1) {
|
||||||
if (!$defaultFound && get_preg($parts[0], 'email')) {
|
if (!$defaultFound && get_preg($parts[0], 'email')) {
|
||||||
$partialAccounts[$i]['kolabInvitationPolicy'][] = $parts[0];
|
$partialAccounts[$i]['kolabInvitationPolicy'][] = $parts[0];
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ class kolabUser extends baseModule {
|
||||||
$defaultFound = true;
|
$defaultFound = true;
|
||||||
}
|
}
|
||||||
// additional policies
|
// additional policies
|
||||||
elseif (sizeof($parts) == 2) {
|
elseif (count($parts) == 2) {
|
||||||
if (get_preg($parts[0], 'email') && in_array($parts[1], $policies)) {
|
if (get_preg($parts[0], 'email') && in_array($parts[1], $policies)) {
|
||||||
$partialAccounts[$i]['kolabInvitationPolicy'][] = $pols[$p];
|
$partialAccounts[$i]['kolabInvitationPolicy'][] = $pols[$p];
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,7 @@ class kolabUser extends baseModule {
|
||||||
if ($rawAccounts[$i][$ids['kolabUser_delegates']] != "") {
|
if ($rawAccounts[$i][$ids['kolabUser_delegates']] != "") {
|
||||||
$newDelegates = explode(';', $rawAccounts[$i][$ids['kolabUser_delegates']]);
|
$newDelegates = explode(';', $rawAccounts[$i][$ids['kolabUser_delegates']]);
|
||||||
// check format
|
// check format
|
||||||
for ($d = 0; $d < sizeof($newDelegates); $d++) {
|
for ($d = 0; $d < count($newDelegates); $d++) {
|
||||||
if (in_array($newDelegates[$d], $delegates)) {
|
if (in_array($newDelegates[$d], $delegates)) {
|
||||||
$partialAccounts[$i]['kolabDelegate'][] = $newDelegates[$d];
|
$partialAccounts[$i]['kolabDelegate'][] = $newDelegates[$d];
|
||||||
}
|
}
|
||||||
|
@ -598,7 +598,7 @@ class kolabUser extends baseModule {
|
||||||
if (isset($this->attributes['kolabInvitationPolicy'][0])) {
|
if (isset($this->attributes['kolabInvitationPolicy'][0])) {
|
||||||
// find default policy
|
// find default policy
|
||||||
$default = "";
|
$default = "";
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||||
if (!strpos($this->attributes['kolabInvitationPolicy'][$i], ":")) {
|
if (!strpos($this->attributes['kolabInvitationPolicy'][$i], ":")) {
|
||||||
$default = $this->attributes['kolabInvitationPolicy'][$i];
|
$default = $this->attributes['kolabInvitationPolicy'][$i];
|
||||||
break;
|
break;
|
||||||
|
@ -608,9 +608,9 @@ class kolabUser extends baseModule {
|
||||||
$pdfRow = new PDFTableRow();
|
$pdfRow = new PDFTableRow();
|
||||||
$pdfRow->cells[] = new PDFTableCell(_('Anyone') . ": " . $this->invitationPolicies[$default]);
|
$pdfRow->cells[] = new PDFTableCell(_('Anyone') . ": " . $this->invitationPolicies[$default]);
|
||||||
$pdfTable->rows[] = $pdfRow;
|
$pdfTable->rows[] = $pdfRow;
|
||||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||||
$parts = explode(':', $this->attributes['kolabInvitationPolicy'][$i]);
|
$parts = explode(':', $this->attributes['kolabInvitationPolicy'][$i]);
|
||||||
if (sizeof($parts) == 2) {
|
if (count($parts) == 2) {
|
||||||
$pdfRow = new PDFTableRow();
|
$pdfRow = new PDFTableRow();
|
||||||
$pdfRow->cells[] = new PDFTableCell($parts[0] . ": " . $this->invitationPolicies[$parts[1]]);
|
$pdfRow->cells[] = new PDFTableCell($parts[0] . ": " . $this->invitationPolicies[$parts[1]]);
|
||||||
$pdfTable->rows[] = $pdfRow;
|
$pdfTable->rows[] = $pdfRow;
|
||||||
|
@ -656,7 +656,7 @@ class kolabUser extends baseModule {
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
$result = ldap_get_entries($_SESSION['ldapHandle']->getServer(), $sr);
|
$result = ldap_get_entries($_SESSION['ldapHandle']->getServer(), $sr);
|
||||||
cleanLDAPResult($result);
|
cleanLDAPResult($result);
|
||||||
for ($i = 0; $i < sizeof($result); $i++) {
|
for ($i = 0; $i < count($result); $i++) {
|
||||||
$delegates[getAbstractDN($result[$i]['dn'])] = $result[$i]['dn'];
|
$delegates[getAbstractDN($result[$i]['dn'])] = $result[$i]['dn'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,7 @@ class kolabUser extends baseModule {
|
||||||
if (isset($attributes['kolabDelegate'])) {
|
if (isset($attributes['kolabDelegate'])) {
|
||||||
$kolabDelegate = $attributes['kolabDelegate'];
|
$kolabDelegate = $attributes['kolabDelegate'];
|
||||||
// do not show existing delegation candidates in selection list
|
// do not show existing delegation candidates in selection list
|
||||||
for ($i = 0; $i < sizeof($kolabDelegate); $i++) {
|
for ($i = 0; $i < count($kolabDelegate); $i++) {
|
||||||
$key = array_search($kolabDelegate[$i], $delegates);
|
$key = array_search($kolabDelegate[$i], $delegates);
|
||||||
if ($key !== false) {
|
if ($key !== false) {
|
||||||
unset($delegates[$key]);
|
unset($delegates[$key]);
|
||||||
|
@ -674,7 +674,7 @@ class kolabUser extends baseModule {
|
||||||
uksort($delegates, 'compareDN');
|
uksort($delegates, 'compareDN');
|
||||||
$_SESSION['kolabUser_kolabDelegate'] = $kolabDelegate;
|
$_SESSION['kolabUser_kolabDelegate'] = $kolabDelegate;
|
||||||
$delegateContainer = new htmlTable();
|
$delegateContainer = new htmlTable();
|
||||||
for ($i = 0; $i < sizeof($kolabDelegate); $i++) {
|
for ($i = 0; $i < count($kolabDelegate); $i++) {
|
||||||
$delegateContainer->addElement(new htmlOutputText($kolabDelegate[$i]));
|
$delegateContainer->addElement(new htmlOutputText($kolabDelegate[$i]));
|
||||||
if (!in_array('kolabDelegate', $readOnlyFields)) {
|
if (!in_array('kolabDelegate', $readOnlyFields)) {
|
||||||
$delegateGroup = new htmlGroup();
|
$delegateGroup = new htmlGroup();
|
||||||
|
@ -710,9 +710,9 @@ class kolabUser extends baseModule {
|
||||||
// default invitation policy
|
// default invitation policy
|
||||||
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
||||||
if (!empty($attributes['kolabInvitationPolicy'])) {
|
if (!empty($attributes['kolabInvitationPolicy'])) {
|
||||||
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($attributes['kolabInvitationPolicy']); $i++) {
|
||||||
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||||
if (sizeof($parts) == 1) {
|
if (count($parts) == 1) {
|
||||||
$defaultInvPol = $this->invitationPolicies[$attributes['kolabInvitationPolicy'][$i]];
|
$defaultInvPol = $this->invitationPolicies[$attributes['kolabInvitationPolicy'][$i]];
|
||||||
unset($attributes['kolabInvitationPolicy'][$i]);
|
unset($attributes['kolabInvitationPolicy'][$i]);
|
||||||
$attributes['kolabInvitationPolicy'] = array_values($attributes['kolabInvitationPolicy']);
|
$attributes['kolabInvitationPolicy'] = array_values($attributes['kolabInvitationPolicy']);
|
||||||
|
@ -729,9 +729,9 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
// other invitation policies
|
// other invitation policies
|
||||||
if (!empty($attributes['kolabInvitationPolicy'])) {
|
if (!empty($attributes['kolabInvitationPolicy'])) {
|
||||||
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
|
for ($i = 0; $i < count($attributes['kolabInvitationPolicy']); $i++) {
|
||||||
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||||
if (sizeof($parts) == 2) {
|
if (count($parts) == 2) {
|
||||||
if (!in_array('kolabDelegate', $readOnlyFields)) {
|
if (!in_array('kolabDelegate', $readOnlyFields)) {
|
||||||
$newPolicyInput = new htmlInputField('invPol1' . $i, $parts[0]);
|
$newPolicyInput = new htmlInputField('invPol1' . $i, $parts[0]);
|
||||||
$newPolicyInput->setAccessibilityLabel(_('Invitation policy'));
|
$newPolicyInput->setAccessibilityLabel(_('Invitation policy'));
|
||||||
|
@ -809,7 +809,7 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
// check for deleted delegations
|
// check for deleted delegations
|
||||||
$postKeys = array_keys($_POST);
|
$postKeys = array_keys($_POST);
|
||||||
for ($i = 0; $i < sizeof($postKeys); $i++) {
|
for ($i = 0; $i < count($postKeys); $i++) {
|
||||||
if (str_contains($postKeys[$i], 'delDelegate_')) {
|
if (str_contains($postKeys[$i], 'delDelegate_')) {
|
||||||
$sKey = substr($postKeys[$i], strlen('delDelegate_'));
|
$sKey = substr($postKeys[$i], strlen('delDelegate_'));
|
||||||
$key = array_search($_SESSION['kolabUser_kolabDelegate'][$sKey], $attributesNew['kolabDelegate']);
|
$key = array_search($_SESSION['kolabUser_kolabDelegate'][$sKey], $attributesNew['kolabDelegate']);
|
||||||
|
@ -865,7 +865,7 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// find differences
|
// find differences
|
||||||
for ($i = 0; $i < sizeof($attributeNames); $i++) {
|
for ($i = 0; $i < count($attributeNames); $i++) {
|
||||||
$attrName = $attributeNames[$i];
|
$attrName = $attributeNames[$i];
|
||||||
if (isset($attributes[$attrName]) && !isset($attributesNew[$attrName])) {
|
if (isset($attributes[$attrName]) && !isset($attributesNew[$attrName])) {
|
||||||
$return['del'][$attrName] = $attributes[$attrName];
|
$return['del'][$attrName] = $attributes[$attrName];
|
||||||
|
@ -875,7 +875,7 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isset($attributes[$attrName])) {
|
if (isset($attributes[$attrName])) {
|
||||||
for ($a = 0; $a < sizeof($attributes[$attrName]); $a++) {
|
for ($a = 0; $a < count($attributes[$attrName]); $a++) {
|
||||||
if (!in_array($attributes[$attrName][$a], $attributesNew[$attrName])) {
|
if (!in_array($attributes[$attrName][$a], $attributesNew[$attrName])) {
|
||||||
$return['mod'][$attrName] = $attributesNew[$attrName];
|
$return['mod'][$attrName] = $attributesNew[$attrName];
|
||||||
break;
|
break;
|
||||||
|
@ -883,7 +883,7 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($attributesNew[$attrName])) {
|
if (isset($attributesNew[$attrName])) {
|
||||||
for ($a = 0; $a < sizeof($attributesNew[$attrName]); $a++) {
|
for ($a = 0; $a < count($attributesNew[$attrName]); $a++) {
|
||||||
if (!in_array($attributesNew[$attrName][$a], $attributes[$attrName])) {
|
if (!in_array($attributesNew[$attrName][$a], $attributes[$attrName])) {
|
||||||
$return['mod'][$attrName] = $attributesNew[$attrName];
|
$return['mod'][$attrName] = $attributesNew[$attrName];
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue