refactoring

This commit is contained in:
Roland Gruber 2020-03-13 20:59:30 +01:00
parent 96c4b49f06
commit b6425b9abd
7 changed files with 4 additions and 12 deletions

View File

@ -405,7 +405,6 @@ class lamList {
$table->setCSSClasses(array($scope . '-border accountlist')); $table->setCSSClasses(array($scope . '-border accountlist'));
$table->setOnClickEvents($onClickEvents); $table->setOnClickEvents($onClickEvents);
$table->setOnDoubleClickEvents($onDoubleClickEvents); $table->setOnDoubleClickEvents($onDoubleClickEvents);
$columnCount = sizeof($titles);
parseHtml(null, $table, array(), false, $this->tabindex, $scope); parseHtml(null, $table, array(), false, $this->tabindex, $scope);
} }

View File

@ -1658,7 +1658,6 @@ class inetOrgPerson extends baseModule implements passwordService {
$messages = array(); $messages = array();
if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) { if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) {
$name = $_FILES['photoFile']['name']; $name = $_FILES['photoFile']['name'];
$extension = strtolower(substr($name, strpos($name, '.') + 1));
$handle = fopen($_FILES['photoFile']['tmp_name'], "r"); $handle = fopen($_FILES['photoFile']['tmp_name'], "r");
$data = fread($handle, 100000000); $data = fread($handle, 100000000);
if (!empty($this->moduleSettings['inetOrgPerson_jpegPhoto_maxSize'][0]) && (strlen($data) > (1024 * $this->moduleSettings['inetOrgPerson_jpegPhoto_maxSize'][0]))) { if (!empty($this->moduleSettings['inetOrgPerson_jpegPhoto_maxSize'][0]) && (strlen($data) > (1024 * $this->moduleSettings['inetOrgPerson_jpegPhoto_maxSize'][0]))) {

View File

@ -5,7 +5,7 @@ use \LAM\PDF\PDFTableRow;
/* /*
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) 2005 - 2019 Roland Gruber Copyright (C) 2005 - 2020 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
@ -571,8 +571,6 @@ class ldapPublicKey extends baseModule {
* Handles an AJAX file upload and prints the JSON result. * Handles an AJAX file upload and prints the JSON result.
*/ */
private function ajaxUpload() { private function ajaxUpload() {
$x = $_GET;
$y = $_FILES;
$result = array('success' => true); $result = array('success' => true);
if (!isset($_FILES['qqfile']) || ($_FILES['qqfile']['size'] < 10)) { if (!isset($_FILES['qqfile']) || ($_FILES['qqfile']['size'] < 10)) {
$result = array('error' => _('No file received.')); $result = array('error' => _('No file received.'));

View File

@ -483,7 +483,6 @@ class posixAccount extends baseModule implements passwordService {
function init($base) { function init($base) {
// make optional if needed // make optional if needed
$modules = $_SESSION[$base]->get_type()->getModules(); $modules = $_SESSION[$base]->get_type()->getModules();
$typeId = $_SESSION[$base]->get_type()->getId();
$this->autoAddObjectClasses = !$this->isOptional($modules) && !$this->skipObjectClass(); $this->autoAddObjectClasses = !$this->isOptional($modules) && !$this->skipObjectClass();
// call parent init // call parent init
parent::init($base); parent::init($base);
@ -2029,7 +2028,6 @@ class posixAccount extends baseModule implements passwordService {
// profile mappings in meta data // profile mappings in meta data
parent::load_profile($profile); parent::load_profile($profile);
$modules = $this->getAccountContainer()->get_type()->getModules(); $modules = $this->getAccountContainer()->get_type()->getModules();
$typeId = $this->getAccountContainer()->get_type()->getId();
// cn // cn
if ($this->manageCn($modules) && !empty($profile['posixAccount_cn'][0])) { if ($this->manageCn($modules) && !empty($profile['posixAccount_cn'][0])) {
$this->attributes['cn'][0] = $profile['posixAccount_cn'][0]; $this->attributes['cn'][0] = $profile['posixAccount_cn'][0];
@ -2469,7 +2467,7 @@ class posixAccount extends baseModule implements passwordService {
if (self::areGroupOfNamesActive()) { if (self::areGroupOfNamesActive()) {
$gons = $this->findGroupOfNames(); $gons = $this->findGroupOfNames();
$gonList = array(); $gonList = array();
foreach ($gons as $dn => $attr) { foreach ($gons as $attr) {
$gonList[] = $attr['cn'][0]; $gonList[] = $attr['cn'][0];
} }
} }

View File

@ -1076,7 +1076,6 @@ class posixGroup extends baseModule implements passwordService {
return array(); return array();
} }
// auto sync group members // auto sync group members
$typeId = $this->getAccountContainer()->get_type()->getId();
if ($this->isBooleanConfigOptionSet('posixGroup_autoSyncGon')) { if ($this->isBooleanConfigOptionSet('posixGroup_autoSyncGon')) {
$this->syncGon(); $this->syncGon();
} }

View File

@ -592,7 +592,7 @@ class PublicKeyCredentialSourceRepositorySQLite implements PublicKeyCredentialSo
logNewMessage(LOG_NOTICE, 'Delete webauthn device ' . $credentialId . ' of ' . $dn); logNewMessage(LOG_NOTICE, 'Delete webauthn device ' . $credentialId . ' of ' . $dn);
$pdo = $this->getPDO(); $pdo = $this->getPDO();
$statement = $pdo->prepare('delete from ' . self::TABLE_NAME . ' where userId = :userId and credentialId = :credentialId'); $statement = $pdo->prepare('delete from ' . self::TABLE_NAME . ' where userId = :userId and credentialId = :credentialId');
$result = $statement->execute(array( $statement->execute(array(
':userId' => $dn, ':userId' => $dn,
':credentialId' => $credentialId ':credentialId' => $credentialId
)); ));

View File

@ -22,7 +22,7 @@ use \htmlGroup;
/* /*
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 - 2019 Roland Gruber Copyright (C) 2003 - 2020 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
@ -556,7 +556,6 @@ parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
*/ */
function checkInput() { function checkInput() {
$conf = &$_SESSION['conf_config']; $conf = &$_SESSION['conf_config'];
$types = $conf->get_ActiveTypes();
// check new preferences // check new preferences
$errors = array(); $errors = array();