new type API

This commit is contained in:
Roland Gruber 2016-12-26 18:41:22 +01:00
parent fad7a009f0
commit 0bf8702763
4 changed files with 94 additions and 81 deletions

View File

@ -1,9 +1,10 @@
<?php
namespace LAM\TOOLS\OU_EDIT;
/*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2009 - 2011 Roland Gruber
Copyright (C) 2009 - 2016 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
@ -33,7 +34,7 @@ $Id$
*
* @package tools
*/
class toolOUEditor implements LAMTool {
class toolOUEditor implements \LAMTool {
/**
* Returns the name of the tool.

View File

@ -1,9 +1,10 @@
<?php
namespace LAM\TOOLS\PDF_EDITOR;
/*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2009 - 2011 Roland Gruber
Copyright (C) 2009 - 2016 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
@ -33,7 +34,7 @@ $Id$
*
* @package tools
*/
class toolPDFEditor implements LAMTool {
class toolPDFEditor implements \LAMTool {
/**
* Returns the name of the tool.

View File

@ -1,9 +1,10 @@
<?php
namespace LAM\TOOLS\PROFILE_EDITOR;
/*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2009 - 2011 Roland Gruber
Copyright (C) 2009 - 2016 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
@ -33,7 +34,7 @@ $Id$
*
* @package tools
*/
class toolProfileEditor implements LAMTool {
class toolProfileEditor implements \LAMTool {
/**
* Returns the name of the tool.

View File

@ -1,4 +1,15 @@
<?php
namespace LAM\TOOLS\OU_EDIT;
use \htmlTable;
use \htmlSpacer;
use \htmlOutputText;
use \htmlButton;
use \htmlHiddenInput;
use \htmlSubTitle;
use \htmlStatusMessage;
use \htmlSelect;
use \htmlHelpLink;
use \htmlInputField;
/*
$Id$
@ -51,8 +62,6 @@ if (!empty($_POST)) {
validateSecurityToken();
}
$types = $_SESSION['config']->get_ActiveTypes();
// check if deletion was canceled
if (isset($_POST['abort'])) {
display_main(null, null);
@ -166,13 +175,14 @@ function display_main($message, $error) {
$container->addElement($msg, true);
}
$typeManager = new \LAM\TYPES\TypeManager();
$typeList = $typeManager->getConfiguredTypes();
$types = array();
$typeList = $_SESSION['config']->get_ActiveTypes();
for ($i = 0; $i < sizeof($typeList); $i++) {
if (isAccountTypeHidden($typeList[$i]) || !checkIfWriteAccessIsAllowed($typeList[$i])) {
foreach ($typeList as $type) {
if ($type->isHidden() || !checkIfWriteAccessIsAllowed($type->getId())) {
continue;
}
$types[$typeList[$i]] = LAM\TYPES\getTypeAlias($typeList[$i]);
$types[$type->getId()] = $type->getAlias();
}
natcasesort($types);
$options = array();