Commit 8201c62b authored by Per von Zweigbergk's avatar Per von Zweigbergk

Style cleanup (ran make stylefix)

parent 3a44d732
...@@ -603,5 +603,4 @@ class SystemhealthController extends ApiControllerBase ...@@ -603,5 +603,4 @@ class SystemhealthController extends ApiControllerBase
} }
return $intfmap; return $intfmap;
} }
} }
...@@ -65,7 +65,7 @@ class AuthenticationFactory ...@@ -65,7 +65,7 @@ class AuthenticationFactory
{ {
$connectors = array(); $connectors = array();
foreach (glob(__DIR__."/*.php") as $filename) { foreach (glob(__DIR__."/*.php") as $filename) {
$pathParts = explode('/',$filename); $pathParts = explode('/', $filename);
$vendor = $pathParts[count($pathParts)-3]; $vendor = $pathParts[count($pathParts)-3];
$module = $pathParts[count($pathParts)-2]; $module = $pathParts[count($pathParts)-2];
$classname = explode('.php', $pathParts[count($pathParts)-1])[0]; $classname = explode('.php', $pathParts[count($pathParts)-1])[0];
...@@ -144,22 +144,22 @@ class AuthenticationFactory ...@@ -144,22 +144,22 @@ class AuthenticationFactory
* list configuration options for pluggable auth modules * list configuration options for pluggable auth modules
* @return array * @return array
*/ */
public function listConfigOptions() public function listConfigOptions()
{ {
$result = array(); $result = array();
foreach ($this->listConnectors() as $connector) { foreach ($this->listConnectors() as $connector) {
if ($connector['classHandle']->hasMethod('getDescription')) { if ($connector['classHandle']->hasMethod('getDescription')) {
$obj = $connector['classHandle']->newInstance(); $obj = $connector['classHandle']->newInstance();
$authItem = $connector; $authItem = $connector;
$authItem['description'] = $obj->getDescription(); $authItem['description'] = $obj->getDescription();
if ($connector['classHandle']->hasMethod('getConfigurationOptions')) { if ($connector['classHandle']->hasMethod('getConfigurationOptions')) {
$authItem['additionalFields'] = $obj->getConfigurationOptions(); $authItem['additionalFields'] = $obj->getConfigurationOptions();
} else { } else {
$authItem['additionalFields'] = array(); $authItem['additionalFields'] = array();
} }
$result[$obj->getType()] = $authItem; $result[$obj->getType()] = $authItem;
} }
} }
return $result; return $result;
} }
} }
...@@ -206,7 +206,7 @@ class LocalTOTP extends Local ...@@ -206,7 +206,7 @@ class LocalTOTP extends Local
$fields["otpLength"]["options"]["6"] = "6"; $fields["otpLength"]["options"]["6"] = "6";
$fields["otpLength"]["options"]["8"] = "8"; $fields["otpLength"]["options"]["8"] = "8";
$fields["otpLength"]["help"] = gettext("Token length to use"); $fields["otpLength"]["help"] = gettext("Token length to use");
$fields["otpLength"]["validate"] = function($value) { $fields["otpLength"]["validate"] = function ($value) {
if (!in_array($value, array(6,8))) { if (!in_array($value, array(6,8))) {
return array(gettext("Only token lengths of 6 or 8 characters are supported")); return array(gettext("Only token lengths of 6 or 8 characters are supported"));
} else { } else {
...@@ -219,7 +219,7 @@ class LocalTOTP extends Local ...@@ -219,7 +219,7 @@ class LocalTOTP extends Local
$fields["timeWindow"]["default"] = null; $fields["timeWindow"]["default"] = null;
$fields["timeWindow"]["help"] = gettext("The time period in which the token will be valid,". $fields["timeWindow"]["help"] = gettext("The time period in which the token will be valid,".
" default is 30 seconds (google authenticator)") ; " default is 30 seconds (google authenticator)") ;
$fields["timeWindow"]["validate"] = function($value) { $fields["timeWindow"]["validate"] = function ($value) {
if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) { if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) {
return array(gettext("Please enter a valid time window in seconds")); return array(gettext("Please enter a valid time window in seconds"));
} else { } else {
...@@ -232,7 +232,7 @@ class LocalTOTP extends Local ...@@ -232,7 +232,7 @@ class LocalTOTP extends Local
$fields["graceperiod"]["default"] = null; $fields["graceperiod"]["default"] = null;
$fields["graceperiod"]["help"] = gettext("Time in seconds in which this server and the token may differ,". $fields["graceperiod"]["help"] = gettext("Time in seconds in which this server and the token may differ,".
" default is 10 seconds. Set higher for a less secure easier match."); " default is 10 seconds. Set higher for a less secure easier match.");
$fields["graceperiod"]["validate"] = function($value) { $fields["graceperiod"]["validate"] = function ($value) {
if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) { if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) {
return array(gettext("Please enter a valid grace period in seconds")); return array(gettext("Please enter a valid grace period in seconds"));
} else { } else {
......
...@@ -401,7 +401,7 @@ class Voucher implements IAuthConnector ...@@ -401,7 +401,7 @@ class Voucher implements IAuthConnector
$fields["simplePasswords"]["name"] = gettext("Use simple passwords (less secure)"); $fields["simplePasswords"]["name"] = gettext("Use simple passwords (less secure)");
$fields["simplePasswords"]["type"] = "checkbox"; $fields["simplePasswords"]["type"] = "checkbox";
$fields["simplePasswords"]["help"] = gettext("Use simple (less secure) passwords, which are easier to read") ; $fields["simplePasswords"]["help"] = gettext("Use simple (less secure) passwords, which are easier to read") ;
$fields["simplePasswords"]["validate"] = function($value) { $fields["simplePasswords"]["validate"] = function ($value) {
return array(); return array();
}; };
$fields["usernameLength"] = array(); $fields["usernameLength"] = array();
...@@ -409,7 +409,7 @@ class Voucher implements IAuthConnector ...@@ -409,7 +409,7 @@ class Voucher implements IAuthConnector
$fields["usernameLength"]["type"] = "text"; $fields["usernameLength"]["type"] = "text";
$fields["usernameLength"]["default"] = null; $fields["usernameLength"]["default"] = null;
$fields["usernameLength"]["help"] = gettext("Specify alternative username length for generating vouchers"); $fields["usernameLength"]["help"] = gettext("Specify alternative username length for generating vouchers");
$fields["usernameLength"]["validate"] = function($value) { $fields["usernameLength"]["validate"] = function ($value) {
if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) { if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) {
return array(gettext("Username length must be a number or empty for default.")); return array(gettext("Username length must be a number or empty for default."));
} else { } else {
...@@ -421,7 +421,7 @@ class Voucher implements IAuthConnector ...@@ -421,7 +421,7 @@ class Voucher implements IAuthConnector
$fields["passwordLength"]["type"] = "text"; $fields["passwordLength"]["type"] = "text";
$fields["passwordLength"]["default"] = null; $fields["passwordLength"]["default"] = null;
$fields["passwordLength"]["help"] = gettext("Specify alternative password length for generating vouchers"); $fields["passwordLength"]["help"] = gettext("Specify alternative password length for generating vouchers");
$fields["passwordLength"]["validate"] = function($value) { $fields["passwordLength"]["validate"] = function ($value) {
if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) { if (!empty($value) && filter_var($value, FILTER_SANITIZE_NUMBER_INT) != $value) {
return array(gettext("Password length must be a number or empty for default.")); return array(gettext("Password length must be a number or empty for default."));
} else { } else {
......
...@@ -101,9 +101,9 @@ class CertificateField extends BaseField ...@@ -101,9 +101,9 @@ class CertificateField extends BaseField
if (!array_key_exists($this->certificateType, self::$internalOptionList)) { if (!array_key_exists($this->certificateType, self::$internalOptionList)) {
self::$internalOptionList[$this->certificateType] = array(); self::$internalOptionList[$this->certificateType] = array();
$configObj = Config::getInstance()->object(); $configObj = Config::getInstance()->object();
foreach ($configObj->{$this->certificateType} as $cert) { foreach ($configObj->{$this->certificateType} as $cert) {
self::$internalOptionList[$this->certificateType][(string)$cert->refid] = (string)$cert->descr ; self::$internalOptionList[$this->certificateType][(string)$cert->refid] = (string)$cert->descr ;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment