namespace for types

This commit is contained in:
Roland Gruber 2016-12-19 21:32:08 +01:00
parent f16a0286f7
commit 97be076bba
20 changed files with 115 additions and 114 deletions

View File

@ -33,11 +33,11 @@ $Id$
*/ */
// generate help entry for translated list attributes // generate help entry for translated list attributes
$types = getTypes(); $types = LAM\TYPES\getTypes();
$entry206Example = ""; $entry206Example = "";
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
$entry206Example .= "<b>" . getTypeAlias($types[$i]) . ":</b><br>\n"; $entry206Example .= "<b>" . LAM\TYPES\getTypeAlias($types[$i]) . ":</b><br>\n";
$descriptions = getListAttributeDescriptions($types[$i]); $descriptions = LAM\TYPES\getListAttributeDescriptions($types[$i]);
$attributes = array_keys($descriptions); $attributes = array_keys($descriptions);
for ($a = 0; $a < sizeof($attributes); $a++) { for ($a = 0; $a < sizeof($attributes); $a++) {
$entry206Example .= "#" . $attributes[$a] . ": " . $descriptions[$attributes[$a]]; $entry206Example .= "#" . $attributes[$a] . ": " . $descriptions[$attributes[$a]];

View File

@ -657,7 +657,7 @@ class LAMConfig {
fclose($file); fclose($file);
} }
// check types // check types
$allTypes = getTypes(); $allTypes = LAM\TYPES\getTypes();
$activeTypes = $this->get_ActiveTypes(); $activeTypes = $this->get_ActiveTypes();
for ($i = 0; $i < sizeof($activeTypes); $i++) { for ($i = 0; $i < sizeof($activeTypes); $i++) {
if (!in_array($activeTypes[$i], $allTypes)) { if (!in_array($activeTypes[$i], $allTypes)) {

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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 - 2015 Roland Gruber Copyright (C) 2003 - 2016 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
@ -865,7 +865,7 @@ class lamList {
$ret = array(); $ret = array();
$attr_string = $_SESSION["config"]->get_listAttributes($this->type); $attr_string = $_SESSION["config"]->get_listAttributes($this->type);
$temp_array = explode(";", $attr_string); $temp_array = explode(";", $attr_string);
$hash_table = getListAttributeDescriptions($this->type); $hash_table = LAM\TYPES\getListAttributeDescriptions($this->type);
$hash_table = array_change_key_case($hash_table, CASE_LOWER); $hash_table = array_change_key_case($hash_table, CASE_LOWER);
// generate column attributes and descriptions // generate column attributes and descriptions
for ($i = 0; $i < sizeof($temp_array); $i++) { for ($i = 0; $i < sizeof($temp_array); $i++) {

View File

@ -40,7 +40,7 @@ class generalInformation extends baseModule {
* @return boolean true if module fits * @return boolean true if module fits
*/ */
public function can_manage() { public function can_manage() {
return in_array($this->get_scope(), getTypes()); return in_array($this->get_scope(), LAM\TYPES\getTypes());
} }
/** /**

View File

@ -4,7 +4,7 @@ $Id$
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 - 2006 Tilo Lutz Copyright (C) 2003 - 2006 Tilo Lutz
2007 - 2015 Roland Gruber 2007 - 2016 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
@ -48,7 +48,7 @@ class sambaGroupMapping extends baseModule {
private $cachedDomainList = null; private $cachedDomainList = null;
/** cache for existing Samba entries (array(dn => cn)) */ /** cache for existing Samba entries (array(dn => cn)) */
private $sidCache = null; private $sidCache = null;
/** /**
* Creates a new module for Samba 3 groups. * Creates a new module for Samba 3 groups.
* *
@ -79,7 +79,7 @@ class sambaGroupMapping extends baseModule {
/** /**
* Returns true if this module can manage accounts of the current type, otherwise false. * Returns true if this module can manage accounts of the current type, otherwise false.
* *
* @return boolean true if module fits * @return boolean true if module fits
*/ */
public function can_manage() { public function can_manage() {
@ -90,7 +90,7 @@ class sambaGroupMapping extends baseModule {
* Returns meta data that is interpreted by parent class * Returns meta data that is interpreted by parent class
* *
* @return array array with meta data * @return array array with meta data
* *
* @see baseModule::get_metaData() * @see baseModule::get_metaData()
*/ */
function get_metaData() { function get_metaData() {
@ -192,7 +192,7 @@ class sambaGroupMapping extends baseModule {
} }
return null; return null;
} }
/** /**
* Gets the cn from the Unix group module. * Gets the cn from the Unix group module.
* *
@ -210,7 +210,7 @@ class sambaGroupMapping extends baseModule {
} }
return null; return null;
} }
/** /**
* Returns an array containing all input columns for the file upload. * Returns an array containing all input columns for the file upload.
* *
@ -232,7 +232,7 @@ class sambaGroupMapping extends baseModule {
* *
* @param array $selectedModules list of selected account modules * @param array $selectedModules list of selected account modules
* @return array column list * @return array column list
* *
* @see baseModule::get_metaData() * @see baseModule::get_metaData()
*/ */
public function get_uploadColumns($selectedModules) { public function get_uploadColumns($selectedModules) {
@ -327,7 +327,7 @@ class sambaGroupMapping extends baseModule {
/** /**
* Returns the HTML meta data for the main account page. * Returns the HTML meta data for the main account page.
* *
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
@ -372,7 +372,7 @@ class sambaGroupMapping extends baseModule {
$options[] = $names[$i]; $options[] = $names[$i];
} }
$return->addElement(new htmlTableExtendedSelect('sambaSID', $options, $selected, _('Windows group'), 'sambaSID'), true); $return->addElement(new htmlTableExtendedSelect('sambaSID', $options, $selected, _('Windows group'), 'sambaSID'), true);
// group type // group type
$names = array_keys($this->sambaGroupTypes); $names = array_keys($this->sambaGroupTypes);
$selected = array( _('Domain group') ); $selected = array( _('Domain group') );
for ($i=0; $i<count($names); $i++) { for ($i=0; $i<count($names); $i++) {
@ -417,9 +417,9 @@ class sambaGroupMapping extends baseModule {
$memberHelp = new htmlHelpLink('sambaSIDList'); $memberHelp = new htmlHelpLink('sambaSIDList');
$memberHelp->alignment = htmlElement::ALIGN_TOP; $memberHelp->alignment = htmlElement::ALIGN_TOP;
$return->addElement($memberHelp, true); $return->addElement($memberHelp, true);
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addElement(new htmlSpacer(null, '10px'), true);
$remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension')); $remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension'));
$remButton->colspan = 3; $remButton->colspan = 3;
$return->addElement($remButton); $return->addElement($remButton);
@ -432,7 +432,7 @@ class sambaGroupMapping extends baseModule {
/** /**
* This function will create the meta HTML code to show a page to add members. * This function will create the meta HTML code to show a page to add members.
* *
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_members() { function display_html_members() {
@ -495,7 +495,7 @@ class sambaGroupMapping extends baseModule {
$options = array(); $options = array();
$optionsSelected = array(); $optionsSelected = array();
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
$options[getTypeAlias($types[$i])] = $types[$i]; $options[LAM\TYPES\getTypeAlias($types[$i])] = $types[$i];
if ($types[$i] == 'group') { if ($types[$i] == 'group') {
$optionsSelected[] = $types[$i]; $optionsSelected[] = $types[$i];
} }
@ -511,7 +511,7 @@ class sambaGroupMapping extends baseModule {
$return->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'membersBack', _('Back'))); $return->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'membersBack', _('Back')));
return $return; return $return;
} }
/** /**
* Processes user input of the members page. * Processes user input of the members page.
* It checks if all input values are correct and updates the associated LDAP attributes. * It checks if all input values are correct and updates the associated LDAP attributes.
@ -622,7 +622,7 @@ class sambaGroupMapping extends baseModule {
/** /**
* This function is used to check if all settings for this module have been made. * This function is used to check if all settings for this module have been made.
* *
* @see baseModule::module_complete * @see baseModule::module_complete
* *
* @return boolean true, if settings are complete * @return boolean true, if settings are complete
@ -739,7 +739,7 @@ class sambaGroupMapping extends baseModule {
} }
return $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig); return $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
} }
/** /**
* Returns a list of existing Samba 3 domains. * Returns a list of existing Samba 3 domains.
* *
@ -780,7 +780,7 @@ class sambaGroupMapping extends baseModule {
$this->sidCache[$result['sambasid'][0]] = $label; $this->sidCache[$result['sambasid'][0]] = $label;
} }
} }
} }
?> ?>

View File

@ -720,7 +720,7 @@ class windowsGroup extends baseModule {
$options = array(); $options = array();
$optionsSelected = array(); $optionsSelected = array();
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
$options[getTypeAlias($types[$i])] = $types[$i]; $options[LAM\TYPES\getTypeAlias($types[$i])] = $types[$i];
if ($types[$i] == 'user') { if ($types[$i] == 'user') {
$optionsSelected[] = $types[$i]; $optionsSelected[] = $types[$i];
} }

View File

@ -4,7 +4,7 @@ $Id$
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 - 2006 Michael Duergner Copyright (C) 2003 - 2006 Michael Duergner
2011 - 2013 Roland Gruber 2011 - 2016 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
@ -23,7 +23,7 @@ $Id$
/** /**
* Functions to manage the PDF structures. * Functions to manage the PDF structures.
* *
* @author Michael Duergner * @author Michael Duergner
* @package PDF * @package PDF
*/ */
@ -98,7 +98,7 @@ function loadPDFStructureDefinitions($scope='user',$pdf_structure='default') {
/** /**
* Saves PDF structure definitions to XML file in format: <name>.<scope>.xml * Saves PDF structure definitions to XML file in format: <name>.<scope>.xml
* *
* @param string $scope account type * @param string $scope account type
* @param string $definition Name of definition * @param string $definition Name of definition
* @return string "no perms" if access denied or "ok". * @return string "no perms" if access denied or "ok".
@ -132,7 +132,7 @@ function savePDFStructureDefinitions($scope,$definition) {
} }
} }
if($entry['type'] == 'open') { if($entry['type'] == 'open') {
$file .= $ident . '<' . strtolower($entry['tag']) . $attributes . ">\n"; $file .= $ident . '<' . strtolower($entry['tag']) . $attributes . ">\n";
} }
elseif($entry['type'] == 'close') { elseif($entry['type'] == 'close') {
$file .= $ident . '</' . strtolower($entry['tag']) . ">\n"; $file .= $ident . '</' . strtolower($entry['tag']) . ">\n";
@ -184,7 +184,7 @@ function getAvailableLogos() {
$dirPath = dirname(__FILE__) . '/../config/pdf/' . $_SESSION['config']->getName() . '/logos/'; $dirPath = dirname(__FILE__) . '/../config/pdf/' . $_SESSION['config']->getName() . '/logos/';
$dirHandle = opendir($dirPath); $dirHandle = opendir($dirPath);
while($file = readdir($dirHandle)) { while($file = readdir($dirHandle)) {
if(!is_dir($file) && $file != '.' && $file != '..' && preg_match('/\\.(jpg|png)$/',$file)) { if(!is_dir($file) && $file != '.' && $file != '..' && preg_match('/\\.(jpg|png)$/i',$file)) {
$infos = getimagesize($dirPath . $file); $infos = getimagesize($dirPath . $file);
if($infos[0] <= 2000 && $infos[1] <= 300) { if($infos[0] <= 2000 && $infos[1] <= 300) {
array_push($return, array('filename' => $file, 'infos' => $infos)); array_push($return, array('filename' => $file, 'infos' => $infos));
@ -239,13 +239,13 @@ function copyPdfProfiles($pdfProfiles, $scope, $dests = array()) {
/** /**
* Uploads a PDF logo file for the current server profile. * Uploads a PDF logo file for the current server profile.
* *
* @param String $file full path of temporary file * @param String $file full path of temporary file
* @param String $name file name * @param String $name file name
* @return StatusMessage status message to display * @return StatusMessage status message to display
*/ */
function uploadPDFLogo($file, $name) { function uploadPDFLogo($file, $name) {
if (!preg_match('/[a-zA-Z0-9_-]+\\.(png)|(jpg)/', $name)) { if (!preg_match('/[a-zA-Z0-9_-]+\\.(png)|(jpg)/i', $name)) {
return new htmlStatusMessage('ERROR', _('Unable to upload logo file.'), _('The file name must end with ".png" or ".jpg".')); return new htmlStatusMessage('ERROR', _('Unable to upload logo file.'), _('The file name must end with ".png" or ".jpg".'));
} }
$infos = getimagesize($file); $infos = getimagesize($file);
@ -264,7 +264,7 @@ function uploadPDFLogo($file, $name) {
/** /**
* Deletes a PDF logo file. * Deletes a PDF logo file.
* *
* @param String $name file name * @param String $name file name
* @return StatusMessage status message to display * @return StatusMessage status message to display
*/ */
@ -289,7 +289,7 @@ function deletePDFLogo($name) {
$data = loadPDFStructureDefinitions($type, $structure); $data = loadPDFStructureDefinitions($type, $structure);
if ($data['page_definitions']['filename'] == $name) { if ($data['page_definitions']['filename'] == $name) {
return new htmlStatusMessage('ERROR', _('Unable to delete logo file.'), return new htmlStatusMessage('ERROR', _('Unable to delete logo file.'),
sprintf(_('Logo is still in use by PDF structure "%s" in account type "%s".'), $structure, getTypeAlias($type))); sprintf(_('Logo is still in use by PDF structure "%s" in account type "%s".'), $structure, LAM\TYPES\getTypeAlias($type)));
} }
} }
} }

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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) 2006 - 2015 Roland Gruber Copyright (C) 2006 - 2016 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
@ -154,7 +154,7 @@ function checkSelfServiceOptions($scope, $fields, $attributes, $passwordChangeOn
* @return array profile names (array(<account type> => array(<profile1>, <profile2>, ...))) * @return array profile names (array(<account type> => array(<profile1>, <profile2>, ...)))
*/ */
function getSelfServiceProfiles() { function getSelfServiceProfiles() {
$types = getTypes(); $types = LAM\TYPES\getTypes();
$dir = dir(substr(__FILE__, 0, strlen(__FILE__) - 20) . "/config/selfService"); $dir = dir(substr(__FILE__, 0, strlen(__FILE__) - 20) . "/config/selfService");
$ret = array(); $ret = array();
while ($entry = $dir->read()){ while ($entry = $dir->read()){

View File

@ -1,9 +1,10 @@
<?php <?php
namespace LAM\TYPES;
/* /*
$Id$ $Id$
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 - 2013 Roland Gruber Copyright (C) 2005 - 2016 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

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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) 2004 - 2014 Roland Gruber Copyright (C) 2004 - 2016 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
@ -160,7 +160,7 @@ echo "<div style=\"display: none;\">\n";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">"; echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">"; echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n"; echo "</div>\n";
// tabs // tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">'; echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
@ -200,7 +200,7 @@ jQuery(document).ready(function() {
var maxWidth = 0; var maxWidth = 0;
jQuery("select").each(function(){ jQuery("select").each(function(){
if (jQuery(this).width() > maxWidth) if (jQuery(this).width() > maxWidth)
maxWidth = jQuery(this).width(); maxWidth = jQuery(this).width();
}); });
jQuery("select").width(maxWidth); jQuery("select").width(maxWidth);
}); });
@ -212,7 +212,7 @@ jQuery(document).ready(function() {
$account_list = array(); $account_list = array();
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
$account_list[] = array($types[$i], getTypeAlias($types[$i])); $account_list[] = array($types[$i], LAM\TYPES\getTypeAlias($types[$i]));
} }
$container = new htmlTable(); $container = new htmlTable();
@ -300,7 +300,7 @@ function config_showAccountModules($scope, $title, &$container) {
} }
} }
} }
// add account module selection // add account module selection
$container->addElement(new htmlSubTitle($title, '../../graphics/' . $scope . '.png'), true); $container->addElement(new htmlSubTitle($title, '../../graphics/' . $scope . '.png'), true);
$container->addElement(new htmlOutputText(_("Selected modules"))); $container->addElement(new htmlOutputText(_("Selected modules")));
@ -412,7 +412,7 @@ function checkInput() {
$depends = check_module_depends($selected, getModulesDependencies($scope)); $depends = check_module_depends($selected, getModulesDependencies($scope));
if ($depends != false) { if ($depends != false) {
for ($i = 0; $i < sizeof($depends); $i++) { for ($i = 0; $i < sizeof($depends); $i++) {
$errors[] = array('ERROR', getTypeAlias($scope), _("Unsolved dependency:") . ' ' . $errors[] = array('ERROR', LAM\TYPES\getTypeAlias($scope), _("Unsolved dependency:") . ' ' .
$depends[$i][0] . " (" . $depends[$i][1] . ")"); $depends[$i][0] . " (" . $depends[$i][1] . ")");
} }
} }
@ -420,7 +420,7 @@ function checkInput() {
$conflicts = check_module_conflicts($selected, getModulesDependencies($scope)); $conflicts = check_module_conflicts($selected, getModulesDependencies($scope));
if ($conflicts != false) { if ($conflicts != false) {
for ($i = 0; $i < sizeof($conflicts); $i++) { for ($i = 0; $i < sizeof($conflicts); $i++) {
$errors[] = array('ERROR', getTypeAlias($scope), _("Conflicting module:") . ' ' . $errors[] = array('ERROR', LAM\TYPES\getTypeAlias($scope), _("Conflicting module:") . ' ' .
$conflicts[$i][0] . " (" . $conflicts[$i][1] . ")"); $conflicts[$i][0] . " (" . $conflicts[$i][1] . ")");
} }
} }
@ -432,8 +432,8 @@ function checkInput() {
} }
} }
if ($baseCount != 1) { if ($baseCount != 1) {
$errors[] = array('ERROR', getTypeAlias($scope), _("No or more than one base module selected!")); $errors[] = array('ERROR', LAM\TYPES\getTypeAlias($scope), _("No or more than one base module selected!"));
} }
} }
$conf->set_typeSettings($typeSettings); $conf->set_typeSettings($typeSettings);

View File

@ -105,12 +105,12 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules'])
} }
$typeSettings = $conf->get_typeSettings(); $typeSettings = $conf->get_typeSettings();
$allTypes = getTypes(); $allTypes = LAM\TYPES\getTypes();
$activeTypes = $conf->get_ActiveTypes(); $activeTypes = $conf->get_ActiveTypes();
$availableTypes = array(); $availableTypes = array();
for ($i = 0; $i < sizeof($allTypes); $i++) { for ($i = 0; $i < sizeof($allTypes); $i++) {
if (!in_array($allTypes[$i], $activeTypes)) { if (!in_array($allTypes[$i], $activeTypes)) {
$availableTypes[$allTypes[$i]] = getTypeAlias($allTypes[$i]); $availableTypes[$allTypes[$i]] = LAM\TYPES\getTypeAlias($allTypes[$i]);
} }
} }
natcasesort($availableTypes); natcasesort($availableTypes);
@ -230,7 +230,7 @@ if (sizeof($availableTypes) > 0) {
$availableContainer->addElement(new htmlImage('../../graphics/' . $key . '.png')); $availableContainer->addElement(new htmlImage('../../graphics/' . $key . '.png'));
$availableContainer->addElement(new htmlOutputText($value)); $availableContainer->addElement(new htmlOutputText($value));
$availableContainer->addElement(new htmlSpacer('10px', null)); $availableContainer->addElement(new htmlSpacer('10px', null));
$availableContainer->addElement(new htmlOutputText(getTypeDescription($key))); $availableContainer->addElement(new htmlOutputText(LAM\TYPES\getTypeDescription($key)));
$button = new htmlButton('add_' . $key, 'add.png', true); $button = new htmlButton('add_' . $key, 'add.png', true);
$button->setTitle(_("Add")); $button->setTitle(_("Add"));
$availableContainer->addElement($button, true); $availableContainer->addElement($button, true);
@ -249,11 +249,11 @@ if (sizeof($activeTypes) > 0) {
$titleGroup = new htmlGroup(); $titleGroup = new htmlGroup();
$titleGroup->colspan = 6; $titleGroup->colspan = 6;
$titleGroup->addElement(new htmlImage('../../graphics/' . $activeTypes[$i] . '.png')); $titleGroup->addElement(new htmlImage('../../graphics/' . $activeTypes[$i] . '.png'));
$titleText = new htmlOutputText(getTypeAlias($activeTypes[$i])); $titleText = new htmlOutputText(LAM\TYPES\getTypeAlias($activeTypes[$i]));
$titleText->setIsBold(true); $titleText->setIsBold(true);
$titleGroup->addElement($titleText); $titleGroup->addElement($titleText);
$titleGroup->addElement(new htmlSpacer('10px', null)); $titleGroup->addElement(new htmlSpacer('10px', null));
$titleGroup->addElement(new htmlOutputText(getTypeDescription($activeTypes[$i]))); $titleGroup->addElement(new htmlOutputText(LAM\TYPES\getTypeDescription($activeTypes[$i])));
$activeContainer->addElement($titleGroup); $activeContainer->addElement($titleGroup);
// delete button // delete button
$delButton = new htmlButton('rem_'. $activeTypes[$i], 'del.png', true); $delButton = new htmlButton('rem_'. $activeTypes[$i], 'del.png', true);
@ -271,7 +271,7 @@ if (sizeof($activeTypes) > 0) {
$attributes = $typeSettings['attr_' . $activeTypes[$i]]; $attributes = $typeSettings['attr_' . $activeTypes[$i]];
} }
else { else {
$attributes = getDefaultListAttributes($activeTypes[$i]); $attributes = LAM\TYPES\getDefaultListAttributes($activeTypes[$i]);
} }
$attrsInput = new htmlTableExtendedInputField(_("List attributes"), 'attr_' . $activeTypes[$i], $attributes, '206'); $attrsInput = new htmlTableExtendedInputField(_("List attributes"), 'attr_' . $activeTypes[$i], $attributes, '206');
$attrsInput->setFieldSize(40); $attrsInput->setFieldSize(40);
@ -414,7 +414,7 @@ function checkInput() {
$typeSettings[$key] = trim($_POST[$key]); $typeSettings[$key] = trim($_POST[$key]);
$type = substr($postKeys[$i], 7); $type = substr($postKeys[$i], 7);
if (strlen($_POST[$key]) < 1) { if (strlen($_POST[$key]) < 1) {
$errors[] = array("ERROR", _("LDAP Suffix is invalid!"), getTypeAlias($type)); $errors[] = array("ERROR", _("LDAP Suffix is invalid!"), LAM\TYPES\getTypeAlias($type));
} }
} }
// set attributes // set attributes
@ -422,7 +422,7 @@ function checkInput() {
$typeSettings[$key] = $_POST[$key]; $typeSettings[$key] = $_POST[$key];
$type = substr($postKeys[$i], 5); $type = substr($postKeys[$i], 5);
if (!is_string($_POST[$key]) || !preg_match("/^((#[^:;]+)|([^:;]*:[^:;]+))(;((#[^:;]+)|([^:;]*:[^:;]+)))*$/", $_POST[$key])) { if (!is_string($_POST[$key]) || !preg_match("/^((#[^:;]+)|([^:;]*:[^:;]+))(;((#[^:;]+)|([^:;]*:[^:;]+)))*$/", $_POST[$key])) {
$errors[] = array("ERROR", _("List attributes are invalid!"), getTypeAlias($type)); $errors[] = array("ERROR", _("List attributes are invalid!"), LAM\TYPES\getTypeAlias($type));
} }
} }
// set filter // set filter

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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) 2009 - 2013 Roland Gruber Copyright (C) 2009 - 2016 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
@ -94,7 +94,7 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules'])
} }
} }
$allTypes = getTypes(); $allTypes = LAM\TYPES\getTypes();
echo $_SESSION['header']; echo $_SESSION['header'];
@ -159,7 +159,7 @@ echo "<div style=\"display: none;\">\n";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">"; echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">"; echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n"; echo "</div>\n";
// tabs // tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">'; echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
@ -282,7 +282,7 @@ function checkInput() {
} }
$conf = &$_SESSION['conf_config']; $conf = &$_SESSION['conf_config'];
$types = $conf->get_ActiveTypes(); $types = $conf->get_ActiveTypes();
// check module options // check module options
// create option array to check and save // create option array to check and save
$options = extractConfigOptionsFromPOST($_SESSION['conf_types']); $options = extractConfigOptionsFromPOST($_SESSION['conf_types']);

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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 - 2012 Roland Gruber Copyright (C) 2003 - 2016 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
@ -50,7 +50,7 @@ if (isAccountTypeHidden($type)) {
} }
// create list object if needed // create list object if needed
$listClass = getListClassName($type); $listClass = LAM\TYPES\getListClassName($type);
if (!isset($_SESSION['list_' . $type])) { if (!isset($_SESSION['list_' . $type])) {
$list = new $listClass($type); $list = new $listClass($type);
$_SESSION['list_' . $type] = $list; $_SESSION['list_' . $type] = $list;

View File

@ -3,18 +3,18 @@
$Id$ $Id$
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 - 2014 Roland Gruber Copyright (C) 2003 - 2016 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
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@ -208,7 +208,7 @@ jQuery(document).ready(function() {
$link = '<a href="' . $headerPrefix . 'lists/list.php?type=' . $types[$i] . $link = '<a href="' . $headerPrefix . 'lists/list.php?type=' . $types[$i] .
'" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">' . '" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">' .
'<img height="16" width="16" alt="' . $types[$i] . '" src="' . $headerPrefix . '../graphics/' . $types[$i] . '.png">&nbsp;' . '<img height="16" width="16" alt="' . $types[$i] . '" src="' . $headerPrefix . '../graphics/' . $types[$i] . '.png">&nbsp;' .
getTypeAlias($types[$i]) . '</a>'; LAM\TYPES\getTypeAlias($types[$i]) . '</a>';
echo '<li id="tab_' . $types[$i] . '" class="ui-state-default ui-corner-top">'; echo '<li id="tab_' . $types[$i] . '" class="ui-state-default ui-corner-top">';
echo $link; echo $link;
echo "</li>\n"; echo "</li>\n";

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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 - 2015 Roland Gruber Copyright (C) 2013 - 2016 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
@ -88,7 +88,7 @@ function displayStartPage() {
$types = $_SESSION['config']->get_ActiveTypes(); $types = $_SESSION['config']->get_ActiveTypes();
$suffixes = array(); $suffixes = array();
foreach ($types as $type) { foreach ($types as $type) {
$suffixes[getTypeAlias($type)] = $_SESSION['config']->get_Suffix($type); $suffixes[LAM\TYPES\getTypeAlias($type)] = $_SESSION['config']->get_Suffix($type);
$hideRules[$_SESSION['config']->get_Suffix($type)] = array('otherSuffix'); $hideRules[$_SESSION['config']->get_Suffix($type)] = array('otherSuffix');
} }
$treeSuffix = $_SESSION['config']->get_Suffix('tree'); $treeSuffix = $_SESSION['config']->get_Suffix('tree');
@ -172,14 +172,14 @@ function displayStartPage() {
$buttonGroup->addElement($applyButton); $buttonGroup->addElement($applyButton);
$container->addElement($buttonGroup, true); $container->addElement($buttonGroup, true);
$container->addVerticalSpace('10px'); $container->addVerticalSpace('10px');
// run actions // run actions
if ((sizeof($errors) == 0) && (isset($_POST['dryRun']) || isset($_POST['applyChanges']))) { if ((sizeof($errors) == 0) && (isset($_POST['dryRun']) || isset($_POST['applyChanges']))) {
runActions($container); runActions($container);
} }
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo ("</form>\n"); echo ("</form>\n");
echo '</div>'; echo '</div>';
@ -188,7 +188,7 @@ function displayStartPage() {
/** /**
* Runs the dry run and change actions. * Runs the dry run and change actions.
* *
* @param htmlTable $container container * @param htmlTable $container container
*/ */
function runActions(&$container) { function runActions(&$container) {
@ -243,7 +243,7 @@ function runActions(&$container) {
// JS block for AJAX status update // JS block for AJAX status update
$ajaxBlock = ' $ajaxBlock = '
jQuery.get(\'multiEdit.php?ajaxStatus\', null, function(data) {handleReply(data);}, \'json\'); jQuery.get(\'multiEdit.php?ajaxStatus\', null, function(data) {handleReply(data);}, \'json\');
function handleReply(data) { function handleReply(data) {
jQuery(\'#progressBar\').progressbar({value: data.progress, max: 120}); jQuery(\'#progressBar\').progressbar({value: data.progress, max: 120});
jQuery(\'#progressArea\').html(data.content); jQuery(\'#progressArea\').html(data.content);
@ -292,7 +292,7 @@ function runAjaxActions() {
/** /**
* Reads the LDAP entries from the directory. * Reads the LDAP entries from the directory.
* *
* @return array status * @return array status
*/ */
function readLDAPData() { function readLDAPData() {
@ -338,7 +338,7 @@ function readLDAPData() {
/** /**
* Generates the required actions based on the read LDAP data. * Generates the required actions based on the read LDAP data.
* *
* @return array status * @return array status
*/ */
function generateActions() { function generateActions() {
@ -388,7 +388,7 @@ function generateActions() {
/** /**
* Prints the dryRun output. * Prints the dryRun output.
* *
* @return array status * @return array status
*/ */
function dryRun() { function dryRun() {
@ -423,7 +423,7 @@ function dryRun() {
case DEL: case DEL:
$ldif .= 'delete: ' . $attr . "\n"; $ldif .= 'delete: ' . $attr . "\n";
if (empty($val)) { if (empty($val)) {
$log .= '-' . $attr . "\r\n"; $log .= '-' . $attr . "\r\n";
} }
else { else {
$log .= '-' . $attr . '=' . $val . "\r\n"; $log .= '-' . $attr . '=' . $val . "\r\n";
@ -468,7 +468,7 @@ function dryRun() {
/** /**
* Runs the actual modifications. * Runs the actual modifications.
* *
* @return array status * @return array status
*/ */
function doModify() { function doModify() {
@ -533,7 +533,7 @@ function doModify() {
/** /**
* Returns the HTML code for a htmlStatusMessage * Returns the HTML code for a htmlStatusMessage
* *
* @param htmlStatusMessage $msg message * @param htmlStatusMessage $msg message
* @return String HTML code * @return String HTML code
*/ */

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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 - 2015 Roland Gruber Copyright (C) 2003 - 2016 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
@ -121,11 +121,11 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) {
$dnLabel->colspan = 5; $dnLabel->colspan = 5;
$container->addElement($dnLabel, true); $container->addElement($dnLabel, true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
$container->addElement(new htmlButton('sure', _("Delete"))); $container->addElement(new htmlButton('sure', _("Delete")));
$container->addElement(new htmlButton('abort', _("Cancel"))); $container->addElement(new htmlButton('abort', _("Cancel")));
$container->addElement(new htmlHiddenInput('deleteOU', 'submit')); $container->addElement(new htmlHiddenInput('deleteOU', 'submit'));
$container->addElement(new htmlHiddenInput('deletename', $_POST['deleteableOU'])); $container->addElement(new htmlHiddenInput('deletename', $_POST['deleteableOU']));
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo "</form>"; echo "</form>";
echo '</div>'; echo '</div>';
@ -142,7 +142,7 @@ display_main($message, $error);
/** /**
* Displays the main page of the OU editor * Displays the main page of the OU editor
* *
* @param String $message info message * @param String $message info message
* @param String $error error message * @param String $error error message
*/ */
@ -165,14 +165,14 @@ function display_main($message, $error) {
$msg->colspan = 5; $msg->colspan = 5;
$container->addElement($msg, true); $container->addElement($msg, true);
} }
$types = array(); $types = array();
$typeList = $_SESSION['config']->get_ActiveTypes(); $typeList = $_SESSION['config']->get_ActiveTypes();
for ($i = 0; $i < sizeof($typeList); $i++) { for ($i = 0; $i < sizeof($typeList); $i++) {
if (isAccountTypeHidden($typeList[$i]) || !checkIfWriteAccessIsAllowed($typeList[$i])) { if (isAccountTypeHidden($typeList[$i]) || !checkIfWriteAccessIsAllowed($typeList[$i])) {
continue; continue;
} }
$types[$typeList[$i]] = getTypeAlias($typeList[$i]); $types[$typeList[$i]] = LAM\TYPES\getTypeAlias($typeList[$i]);
} }
natcasesort($types); natcasesort($types);
$options = array(); $options = array();
@ -184,7 +184,7 @@ function display_main($message, $error) {
} }
$options[$title] = $elements; $options[$title] = $elements;
} }
if (!empty($options)) { if (!empty($options)) {
// new OU // new OU
$container->addElement(new htmlOutputText(_("New organisational unit"))); $container->addElement(new htmlOutputText(_("New organisational unit")));
@ -197,9 +197,9 @@ function display_main($message, $error) {
$container->addElement(new htmlInputField('newOU')); $container->addElement(new htmlInputField('newOU'));
$container->addElement(new htmlButton('createOU', _("Ok"))); $container->addElement(new htmlButton('createOU', _("Ok")));
$container->addElement(new htmlHelpLink('601'), true); $container->addElement(new htmlHelpLink('601'), true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
// delete OU // delete OU
$container->addElement(new htmlOutputText(_("Delete organisational unit"))); $container->addElement(new htmlOutputText(_("Delete organisational unit")));
$deleteableOUSelect = new htmlSelect('deleteableOU', $options, array()); $deleteableOUSelect = new htmlSelect('deleteableOU', $options, array());
@ -212,7 +212,7 @@ function display_main($message, $error) {
$container->addElement(new htmlButton('deleteOU', _("Ok"))); $container->addElement(new htmlButton('deleteOU', _("Ok")));
$container->addElement(new htmlHelpLink('602'), true); $container->addElement(new htmlHelpLink('602'), true);
} }
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo ("</form>\n"); echo ("</form>\n");

View File

@ -4,7 +4,7 @@ $Id$
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 - 2006 Michael Duergner Copyright (C) 2003 - 2006 Michael Duergner
2005 - 2015 Roland Gruber 2005 - 2016 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
@ -80,7 +80,7 @@ for ($i = 0; $i < sizeof($scopes); $i++) {
if (isAccountTypeHidden($scopes[$i]) || !checkIfWriteAccessIsAllowed($scopes[$i])) { if (isAccountTypeHidden($scopes[$i]) || !checkIfWriteAccessIsAllowed($scopes[$i])) {
continue; continue;
} }
$sortedScopes[$scopes[$i]] = getTypeAlias($scopes[$i]); $sortedScopes[$scopes[$i]] = LAM\TYPES\getTypeAlias($scopes[$i]);
} }
natcasesort($sortedScopes); natcasesort($sortedScopes);
@ -90,12 +90,12 @@ $container->addElement(new htmlTitle(_('PDF editor')), true);
if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) { if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) {
// delete structure // delete structure
if (deletePDFStructureDefinition($_POST['profileDeleteType'], $_POST['profileDeleteName'])) { if (deletePDFStructureDefinition($_POST['profileDeleteType'], $_POST['profileDeleteName'])) {
$message = new htmlStatusMessage('INFO', _('Deleted PDF structure.'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message = new htmlStatusMessage('INFO', _('Deleted PDF structure.'), LAM\TYPES\getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName']));
$message->colspan = 10; $message->colspan = 10;
$container->addElement($message, true); $container->addElement($message, true);
} }
else { else {
$message = new htmlStatusMessage('ERROR', _('Unable to delete PDF structure!'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message = new htmlStatusMessage('ERROR', _('Unable to delete PDF structure!'), LAM\TYPES\getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName']));
$message->colspan = 10; $message->colspan = 10;
$container->addElement($message, true); $container->addElement($message, true);
} }
@ -300,7 +300,7 @@ include '../main_header.php';
$container->addElement(new htmlHiddenInput('importexport', '1')); $container->addElement(new htmlHiddenInput('importexport', '1'));
$container->addElement(new htmlHiddenInput('scope', $scope), true); $container->addElement(new htmlHiddenInput('scope', $scope), true);
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo '</form>'; echo '</form>';
@ -312,21 +312,21 @@ include '../main_header.php';
echo "<form id=\"exportDialogForm\" method=\"post\" action=\"pdfmain.php\">\n"; echo "<form id=\"exportDialogForm\" method=\"post\" action=\"pdfmain.php\">\n";
$container = new htmlTable(); $container = new htmlTable();
$container->addElement(new htmlOutputText(_('PDF structure')), true); $container->addElement(new htmlOutputText(_('PDF structure')), true);
$expStructGroup = new htmlTable(); $expStructGroup = new htmlTable();
$expStructGroup->addElement(new htmlSpacer('10px', null)); $expStructGroup->addElement(new htmlSpacer('10px', null));
$expStructGroup->addElement(new htmlDiv('exportName', '')); $expStructGroup->addElement(new htmlDiv('exportName', ''));
$container->addElement($expStructGroup, true); $container->addElement($expStructGroup, true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
$container->addElement(new htmlOutputText(_("Target server profile")), true); $container->addElement(new htmlOutputText(_("Target server profile")), true);
foreach ($configProfiles as $key => $value) { foreach ($configProfiles as $key => $value) {
$tmpProfiles[$value] = $value; $tmpProfiles[$value] = $value;
} }
natcasesort($tmpProfiles); natcasesort($tmpProfiles);
$tmpProfiles['*' . _('Global templates')] = 'templates*'; $tmpProfiles['*' . _('Global templates')] = 'templates*';
$findProfile = array_search($_SESSION['config']->getName(), $tmpProfiles); $findProfile = array_search($_SESSION['config']->getName(), $tmpProfiles);
if ($findProfile !== false) { if ($findProfile !== false) {
unset($tmpProfiles[$findProfile]); unset($tmpProfiles[$findProfile]);
@ -339,7 +339,7 @@ include '../main_header.php';
$container->addElement($select); $container->addElement($select);
$container->addElement(new htmlHelpLink('409'), true); $container->addElement(new htmlHelpLink('409'), true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
$container->addElement(new htmlOutputText(_("Master password")), true); $container->addElement(new htmlOutputText(_("Master password")), true);
$exportPasswd = new htmlInputField('passwd'); $exportPasswd = new htmlInputField('passwd');
$exportPasswd->setIsPassword(true); $exportPasswd->setIsPassword(true);
@ -347,7 +347,7 @@ include '../main_header.php';
$container->addElement(new htmlHelpLink('236')); $container->addElement(new htmlHelpLink('236'));
$container->addElement(new htmlHiddenInput('importexport', '1'), true); $container->addElement(new htmlHiddenInput('importexport', '1'), true);
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo '</form>'; echo '</form>';

View File

@ -3,7 +3,7 @@
$Id$ $Id$
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 - 2015 Roland Gruber Copyright (C) 2003 - 2016 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,9 +58,9 @@ for ($i = 0; $i < sizeof($types); $i++) {
if (isAccountTypeHidden($types[$i]) || !checkIfWriteAccessIsAllowed($types[$i])) { if (isAccountTypeHidden($types[$i]) || !checkIfWriteAccessIsAllowed($types[$i])) {
continue; continue;
} }
$profileClassesTemp[getTypeAlias($types[$i])] = array( $profileClassesTemp[LAM\TYPES\getTypeAlias($types[$i])] = array(
'scope' => $types[$i], 'scope' => $types[$i],
'title' => getTypeAlias($types[$i]), 'title' => LAM\TYPES\getTypeAlias($types[$i]),
'profiles' => ""); 'profiles' => "");
} }
$profileClassesKeys = array_keys($profileClassesTemp); $profileClassesKeys = array_keys($profileClassesTemp);
@ -105,12 +105,12 @@ if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) {
} }
// delete profile // delete profile
if (delAccountProfile($_POST['profileDeleteName'], $_POST['profileDeleteType'])) { if (delAccountProfile($_POST['profileDeleteName'], $_POST['profileDeleteType'])) {
$message = new htmlStatusMessage('INFO', _('Deleted profile.'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message = new htmlStatusMessage('INFO', _('Deleted profile.'), LAM\TYPES\getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName']));
$message->colspan = 10; $message->colspan = 10;
$container->addElement($message, true); $container->addElement($message, true);
} }
else { else {
$message = new htmlStatusMessage('ERROR', _('Unable to delete profile!'), getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName'])); $message = new htmlStatusMessage('ERROR', _('Unable to delete profile!'), LAM\TYPES\getTypeAlias($_POST['profileDeleteType']) . ': ' . htmlspecialchars($_POST['profileDeleteName']));
$message->colspan = 10; $message->colspan = 10;
$container->addElement($message, true); $container->addElement($message, true);
} }
@ -124,7 +124,7 @@ if (isset($_POST['importexport']) && ($_POST['importexport'] === '1')) {
// check master password // check master password
if (!$cfg->checkPassword($_POST['passwd_' . $_POST['scope']])) { if (!$cfg->checkPassword($_POST['passwd_' . $_POST['scope']])) {
$impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!')); $impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!'));
} }
elseif (copyAccountProfiles($_POST['importProfiles_' . $_POST['scope']], $_POST['scope'])) { elseif (copyAccountProfiles($_POST['importProfiles_' . $_POST['scope']], $_POST['scope'])) {
$impExpMessage = new htmlStatusMessage('INFO', _('Import successful')); $impExpMessage = new htmlStatusMessage('INFO', _('Import successful'));
} }
@ -132,7 +132,7 @@ if (isset($_POST['importexport']) && ($_POST['importexport'] === '1')) {
// check master password // check master password
if (!$cfg->checkPassword($_POST['passwd'])) { if (!$cfg->checkPassword($_POST['passwd'])) {
$impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!')); $impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!'));
} }
elseif (copyAccountProfiles($_POST['exportProfiles'], $_POST['scope'], $_POST['destServerProfiles'])) { elseif (copyAccountProfiles($_POST['exportProfiles'], $_POST['scope'], $_POST['destServerProfiles'])) {
$impExpMessage = new htmlStatusMessage('INFO', _('Export successful')); $impExpMessage = new htmlStatusMessage('INFO', _('Export successful'));
} }
@ -247,7 +247,7 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
$container = new htmlTable(); $container = new htmlTable();
$container->addElement(new htmlOutputText(_('Profiles')), true); $container->addElement(new htmlOutputText(_('Profiles')), true);
$select = new htmlSelect('importProfiles_' . $scope, $tmpArr, array(), count($tmpArr, 1) < 15 ? count($tmpArr, 1) : 15); $select = new htmlSelect('importProfiles_' . $scope, $tmpArr, array(), count($tmpArr, 1) < 15 ? count($tmpArr, 1) : 15);
$select->setMultiSelect(true); $select->setMultiSelect(true);
$select->setHasDescriptiveElements(true); $select->setHasDescriptiveElements(true);
@ -267,7 +267,7 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
$container->addElement(new htmlHiddenInput('importexport', '1')); $container->addElement(new htmlHiddenInput('importexport', '1'));
$container->addElement(new htmlHiddenInput('scope', $scope), true); $container->addElement(new htmlHiddenInput('scope', $scope), true);
addSecurityTokenToMetaHTML($container); addSecurityTokenToMetaHTML($container);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
echo '</form>'; echo '</form>';
@ -286,7 +286,7 @@ $expStructGroup->addElement(new htmlSpacer('10px', null));
$expStructGroup->addElement(new htmlDiv('exportName', '')); $expStructGroup->addElement(new htmlDiv('exportName', ''));
$container->addElement($expStructGroup, true); $container->addElement($expStructGroup, true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
$container->addElement(new htmlOutputText(_("Target server profile")), true); $container->addElement(new htmlOutputText(_("Target server profile")), true);
foreach ($configProfiles as $key => $value) { foreach ($configProfiles as $key => $value) {
$tmpProfiles[$value] = $value; $tmpProfiles[$value] = $value;

View File

@ -3,18 +3,18 @@
$Id$ $Id$
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) 2007 - 2013 Roland Gruber Copyright (C) 2007 - 2016 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
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@ -58,13 +58,13 @@ get_schema_objectclasses();
$classes = get_cached_schema('objectclasses'); $classes = get_cached_schema('objectclasses');
if (!is_array($classes)) { if (!is_array($classes)) {
$container->addElement(new htmlStatusMessage('ERROR', _('Unable to retrieve schema!'), _('You do not have the required access rights or the LDAP schema is not published by your server.'))); $container->addElement(new htmlStatusMessage('ERROR', _('Unable to retrieve schema!'), _('You do not have the required access rights or the LDAP schema is not published by your server.')));
} }
else { else {
// loop for active account types // loop for active account types
for ($t = 0; $t < sizeof($types); $t++) { for ($t = 0; $t < sizeof($types); $t++) {
$modules = $_SESSION['config']->get_AccountModules($types[$t]); $modules = $_SESSION['config']->get_AccountModules($types[$t]);
$container->addElement(new htmlSubTitle(getTypeAlias($types[$t])), true); $container->addElement(new htmlSubTitle(LAM\TYPES\getTypeAlias($types[$t])), true);
for ($m = 0; $m < sizeof($modules); $m++) { for ($m = 0; $m < sizeof($modules); $m++) {
$error = checkSchemaForModule($modules[$m], $types[$t]); $error = checkSchemaForModule($modules[$m], $types[$t]);
$message = _("No problems found."); $message = _("No problems found.");

View File

@ -142,7 +142,7 @@ $table = new htmlTable();
// account type // account type
$typeList = array(); $typeList = array();
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
$typeList[getTypeAlias($types[$i])] = $types[$i]; $typeList[LAM\TYPES\getTypeAlias($types[$i])] = $types[$i];
} }
$selectedType = array(); $selectedType = array();
if (isset($_REQUEST['type'])) { if (isset($_REQUEST['type'])) {