refactoring

This commit is contained in:
Roland Gruber 2020-03-19 20:26:49 +01:00
parent 802b16797a
commit 726f1e13b4
9 changed files with 13 additions and 26 deletions

View File

@ -2031,8 +2031,7 @@ abstract class baseModule {
* @return array messages and attributes (array('messages' => array(), 'add' => array('mail' => array('test@test.com')), 'del' => array(), 'mod' => array(), 'info' => array()))
*/
public function checkSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) {
$return = array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array(), 'info' => array());
return $return;
return array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array(), 'info' => array());
}
/**

View File

@ -3,7 +3,7 @@
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2006 Tilo Lutz
2005 - 2019 Roland Gruber
2005 - 2020 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -177,10 +177,7 @@ class account extends baseModule {
if (!$this->getAccountContainer()->isNewAccount && !in_array('account', $this->getAccountContainer()->attributes_orig['objectClass'])) {
return array();
}
// Get easy attributes
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
// Return attributes
return $return;
return $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
}
/**

View File

@ -375,8 +375,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
$this->attributes['objectClass'] = array_delete(array("dhcpSubnet"), $this->attributes['objectClass']);
}
}
$return = parent::save_attributes();
return $return;
return parent::save_attributes();
}
/**

View File

@ -835,8 +835,7 @@ if (interface_exists('\LAM\JOB\Job', false)) {
protected function findUsers($jobID, $options) {
// read users
$attrs = array('radiusExpiration');
$userResults = searchLDAPByFilter('(radiusExpiration=*)', $attrs, array('user'));
return $userResults;
return searchLDAPByFilter('(radiusExpiration=*)', $attrs, array('user'));
}
/**
@ -902,8 +901,7 @@ if (interface_exists('\LAM\JOB\Job', false)) {
$sysattrs = array('radiusExpiration', 'mail');
$attrs = $this->getAttrWildcards($jobID, $options);
$attrs = array_values(array_unique(array_merge($attrs, $sysattrs)));
$userResults = searchLDAPByFilter('(&(radiusExpiration=*)(mail=*))', $attrs, array('user'));
return $userResults;
return searchLDAPByFilter('(&(radiusExpiration=*)(mail=*))', $attrs, array('user'));
}
/**

View File

@ -3718,8 +3718,7 @@ class inetOrgPerson extends baseModule implements passwordService {
$imageManipulator->thumbnail($maxWidth, $maxHeight);
}
$imageManipulator->convertToJpeg();
$data = $imageManipulator->getImageData();
return $data;
return $imageManipulator->getImageData();
}
/**

View File

@ -3715,8 +3715,7 @@ class posixAccount extends baseModule implements passwordService {
*/
private function cleanSuggestionPart($part) {
$result = str_replace(array_keys($this->umlautReplacements), array_values($this->umlautReplacements), strtolower($part));
$result = str_replace(array(' ', '_', '-'), array('', '', ''), $result);
return $result;
return str_replace(array(' ', '_', '-'), array('', '', ''), $result);
}
/**

View File

@ -316,9 +316,7 @@ class sambaMungedDial
$this->ctx[$value]= 0;
}
}
$result= base64_encode($this->encode_munged($this->ctx));
return $result;
return base64_encode($this->encode_munged($this->ctx));
}
/** Returns array of flags, which can be set on-demand with activated java-script */

View File

@ -3,7 +3,7 @@
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2006 Tilo Lutz
Copyright (C) 2007 - 2019 Roland Gruber
Copyright (C) 2007 - 2020 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -887,8 +887,7 @@ if (interface_exists('\LAM\JOB\Job', false)) {
$sysattrs = array('mail', 'shadowLastChange', 'shadowWarning', 'shadowMax', 'userPassword');
$attrs = $this->getAttrWildcards($jobID, $options);
$attrs = array_values(array_unique(array_merge($attrs, $sysattrs)));
$userResults = searchLDAPByFilter('(&(shadowLastChange=*)(shadowMax=*)(mail=*))', $attrs, array('user'));
return $userResults;
return searchLDAPByFilter('(&(shadowLastChange=*)(shadowMax=*)(mail=*))', $attrs, array('user'));
}
/**
@ -1091,8 +1090,7 @@ if (interface_exists('\LAM\JOB\Job', false)) {
protected function findUsers($jobID, $options) {
// read users
$attrs = array('shadowExpire');
$userResults = searchLDAPByFilter('(shadowExpire=*)', $attrs, array('user'));
return $userResults;
return searchLDAPByFilter('(shadowExpire=*)', $attrs, array('user'));
}
/**

View File

@ -312,7 +312,7 @@ class lamDHCPList extends lamList {
if (empty($pool['dhcprange'])) {
continue;
}
foreach($pool['dhcprange'] AS $id => $value) {
foreach($pool['dhcprange'] AS $value) {
if (!empty($value) && !is_numeric($value)) {
$ex = explode(" ", $value);
$row = new htmlTableRow(