fixed Sonar issues

This commit is contained in:
Roland Gruber 2019-10-05 12:21:19 +02:00
parent 6052047b52
commit d5b779c5e1
9 changed files with 18 additions and 29 deletions

View File

@ -789,7 +789,8 @@ class asteriskAccount extends baseModule implements passwordService {
$errors[] = $this->messages['AstAccountCallerID'][1]; $errors[] = $this->messages['AstAccountCallerID'][1];
} }
// check for duplicate caller ID // check for duplicate caller ID
else if (!isset($this->orig['AstAccountCallerID'][0]) || (($this->orig['AstAccountCallerID'][0] != $this->attributes['AstAccountCallerID'][0]))) { else if (!isset($this->orig['AstAccountCallerID'][0])
|| ($this->orig['AstAccountCallerID'][0] != $this->attributes['AstAccountCallerID'][0])) {
$entries = searchLDAPByAttribute('AstAccountCallerID', $this->attributes['AstAccountCallerID'][0], 'AsteriskSIPUser', array('dn'), array('user')); $entries = searchLDAPByAttribute('AstAccountCallerID', $this->attributes['AstAccountCallerID'][0], 'AsteriskSIPUser', array('dn'), array('user'));
if (sizeof($entries) > 0) { if (sizeof($entries) > 0) {
$errors[] = $this->messages['AstAccountCallerID'][2]; $errors[] = $this->messages['AstAccountCallerID'][2];

View File

@ -3918,7 +3918,6 @@ class inetOrgPerson extends baseModule implements passwordService {
_('Photo') => 'inetOrgPerson_readOnly_jpegPhoto', _('Password') => 'inetOrgPerson_readOnly_userPassword' _('Photo') => 'inetOrgPerson_readOnly_jpegPhoto', _('Password') => 'inetOrgPerson_readOnly_userPassword'
); );
if (isset($_SESSION['conf_config'])) { if (isset($_SESSION['conf_config'])) {
$confActiveUnixUserModules = $_SESSION['conf_config']->get_AccountModules('user');
$readOnlyOptions[_('User name')] = 'inetOrgPerson_readOnly_uid'; $readOnlyOptions[_('User name')] = 'inetOrgPerson_readOnly_uid';
$readOnlyOptions[_('Common name')] = 'inetOrgPerson_readOnly_cn'; $readOnlyOptions[_('Common name')] = 'inetOrgPerson_readOnly_cn';
} }

View File

@ -3507,20 +3507,6 @@ class posixAccount extends baseModule implements passwordService {
return null; return null;
} }
/**
* Returns the group DN of the given group.
*
* @param String $groupname group name
* @return String DN
*/
private function getGroupDN($groupname) {
$results = searchLDAPByAttribute('cn', $groupname, 'posixGroup', array('dn'), array('group'));
if ((sizeof($results) > 0) && isset($results[0]['dn'][0])) {
return $results[0]['dn'];
}
return null;
}
/** /**
* Finds all existing LDAP groups. * Finds all existing LDAP groups.
* *

View File

@ -5,7 +5,7 @@ use LAM\ImageUtils\ImageManipulationFactory;
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2004 Michael Duergner Copyright (C) 2003 - 2004 Michael Duergner
2003 - 2018 Roland Gruber 2003 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -58,7 +58,7 @@ include_once('pdfstruct.inc');
* @param $returnAsString returns the PDF output as String value instead of writing it to a file * @param $returnAsString returns the PDF output as String value instead of writing it to a file
* @return String PDF file name * @return String PDF file name
*/ */
function createModulePDF($accounts, $pdf_structure="default", $font, $returnAsString = false) { function createModulePDF($accounts, $pdf_structure, $font, $returnAsString = false) {
$account_type = $accounts[0]->get_type(); $account_type = $accounts[0]->get_type();
// Get PDF structure from xml file // Get PDF structure from xml file
$reader = new PDFStructureReader(); $reader = new PDFStructureReader();

View File

@ -1,7 +1,7 @@
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2018 Roland Gruber Copyright (C) 2018 - 2019 Roland Gruber
Based on Foundation Grid: https://foundation.zurb.com/sites/docs/v/5.5.3/components/grid.html Based on Foundation Grid: https://foundation.zurb.com/sites/docs/v/5.5.3/components/grid.html
License: MIT License License: MIT License
@ -20,7 +20,10 @@ html, body {
box-sizing: border-box; box-sizing: border-box;
} }
html, html {
font-size: 100%;
}
body { body {
font-size: 100%; font-size: 100%;
} }

View File

@ -276,7 +276,7 @@ function passwordHandleInput(random, ajaxURL, tokenName, tokenValue) {
var data = {jsonInput: pwdJSON}; var data = {jsonInput: pwdJSON};
data[tokenName] = tokenValue; data[tokenName] = tokenValue;
// make AJAX call // make AJAX call
jQuery.post(ajaxURL, data, function(data) {passwordHandleReply(data);}, 'json'); jQuery.post(ajaxURL, data, function(dataReturned) {passwordHandleReply(dataReturned);}, 'json');
} }
/** /**
@ -554,7 +554,7 @@ function checkPasswordStrength(fieldID, ajaxURL, tokenName, tokenValue) {
var data = {jsonInput: pwdJSON}; var data = {jsonInput: pwdJSON};
data[tokenName] = tokenValue; data[tokenName] = tokenValue;
// make AJAX call // make AJAX call
jQuery.post(ajaxURL + "&function=passwordStrengthCheck", data, function(data) {checkPasswordStrengthHandleReply(data, fieldID);}, 'json'); jQuery.post(ajaxURL + "&function=passwordStrengthCheck", data, function(dataReturned) {checkPasswordStrengthHandleReply(dataReturned, fieldID);}, 'json');
}; };
jQuery(field).keyup(check); jQuery(field).keyup(check);
} }

View File

@ -19,7 +19,7 @@ use \LAM\TYPES\TypeManager;
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2018 Roland Gruber Copyright (C) 2003 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -277,7 +277,7 @@ foreach ($profileClasses as $profileClass) {
echo "<div id=\"importDialog_$typeId\" class=\"hidden\">\n"; echo "<div id=\"importDialog_$typeId\" class=\"hidden\">\n";
echo "<form id=\"importDialogForm_$typeId\" method=\"post\" action=\"profilemain.php\">\n"; echo "<form id=\"importDialogForm_$typeId\" method=\"post\" action=\"profilemain.php\">\n";
$containerProfiles = new htmlResponsiveRow();; $containerProfiles = new htmlResponsiveRow();
$containerProfiles->add(new htmlOutputText(_('Profiles')), 12); $containerProfiles->add(new htmlOutputText(_('Profiles')), 12);
$select = new htmlSelect('importProfiles', $importOptions, array(), count($importOptions, 1) < 15 ? count($importOptions, 1) : 15); $select = new htmlSelect('importProfiles', $importOptions, array(), count($importOptions, 1) < 15 ? count($importOptions, 1) : 15);

View File

@ -22,7 +22,7 @@ use \htmlResponsiveTable;
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2013 - 2018 Roland Gruber Copyright (C) 2013 - 2019 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -61,7 +61,9 @@ startSecureSession();
enforceUserIsLoggedIn(); enforceUserIsLoggedIn();
// die if no write access // die if no write access
if (!checkIfWriteAccessIsAllowed()) die(); if (!checkIfWriteAccessIsAllowed()) {
die();
}
checkIfToolIsActive('toolMultiEdit'); checkIfToolIsActive('toolMultiEdit');
@ -499,12 +501,10 @@ function multiEditLdapErrorHandler($errno, $errstr, $errfile, $errline) {
case E_USER_ERROR: case E_USER_ERROR:
logNewMessage(LOG_ERR, 'Error occured: ' . $errstr . " ($errfile: $errline)"); logNewMessage(LOG_ERR, 'Error occured: ' . $errstr . " ($errfile: $errline)");
$_REQUEST['multiEdit_error'] = true; $_REQUEST['multiEdit_error'] = true;
;
break; break;
case E_USER_WARNING: case E_USER_WARNING:
logNewMessage(LOG_WARNING, 'Error occured: ' . $errstr . " ($errfile: $errline)"); logNewMessage(LOG_WARNING, 'Error occured: ' . $errstr . " ($errfile: $errline)");
$_REQUEST['multiEdit_error'] = true; $_REQUEST['multiEdit_error'] = true;
;
break; break;
} }
} }

View File

@ -18,4 +18,4 @@ sonar.tests=lam/tests
sonar.php.tests.reportPath=code-coverage/junit.xml sonar.php.tests.reportPath=code-coverage/junit.xml
sonar.php.coverage.reportPaths=code-coverage/clover.xml sonar.php.coverage.reportPaths=code-coverage/clover.xml
sonar.exclusions=**/3rdParty/**,**/lib/extra/**,**/lib/*jquery*.js,**/tests/**,**/style/*jquery*.css,,**/style/*cropper*.css,**/style/*magnific*.css,**/schema.inc sonar.exclusions=**/3rdParty/**,**/lib/extra/**,**/lib/*jquery*.js,**/tests/**,**/style/*jquery*.css,,**/style/*cropper*.css,**/style/*magnific*.css,**/style/responsive/*normalize*.css,**/schema.inc