diff --git a/lam/help/help.inc b/lam/help/help.inc index 30818e66..762936b2 100644 --- a/lam/help/help.inc +++ b/lam/help/help.inc @@ -33,11 +33,11 @@ $Id$ */ // generate help entry for translated list attributes -$types = getTypes(); +$types = LAM\TYPES\getTypes(); $entry206Example = ""; for ($i = 0; $i < sizeof($types); $i++) { - $entry206Example .= "" . getTypeAlias($types[$i]) . ":
\n"; - $descriptions = getListAttributeDescriptions($types[$i]); + $entry206Example .= "" . LAM\TYPES\getTypeAlias($types[$i]) . ":
\n"; + $descriptions = LAM\TYPES\getListAttributeDescriptions($types[$i]); $attributes = array_keys($descriptions); for ($a = 0; $a < sizeof($attributes); $a++) { $entry206Example .= "#" . $attributes[$a] . ": " . $descriptions[$attributes[$a]]; diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 88fc2fee..1979a731 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -657,7 +657,7 @@ class LAMConfig { fclose($file); } // check types - $allTypes = getTypes(); + $allTypes = LAM\TYPES\getTypes(); $activeTypes = $this->get_ActiveTypes(); for ($i = 0; $i < sizeof($activeTypes); $i++) { if (!in_array($activeTypes[$i], $allTypes)) { diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 9eb15957..32efcc4e 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -3,7 +3,7 @@ $Id$ 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 it under the terms of the GNU General Public License as published by @@ -865,7 +865,7 @@ class lamList { $ret = array(); $attr_string = $_SESSION["config"]->get_listAttributes($this->type); $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); // generate column attributes and descriptions for ($i = 0; $i < sizeof($temp_array); $i++) { diff --git a/lam/lib/modules/generalInformation.inc b/lam/lib/modules/generalInformation.inc index 968d1edf..53a0c946 100644 --- a/lam/lib/modules/generalInformation.inc +++ b/lam/lib/modules/generalInformation.inc @@ -40,7 +40,7 @@ class generalInformation extends baseModule { * @return boolean true if module fits */ public function can_manage() { - return in_array($this->get_scope(), getTypes()); + return in_array($this->get_scope(), LAM\TYPES\getTypes()); } /** diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 6c93537e..c8bc841c 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ class sambaGroupMapping extends baseModule { private $cachedDomainList = null; /** cache for existing Samba entries (array(dn => cn)) */ private $sidCache = null; - + /** * 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. - * + * * @return boolean true if module fits */ public function can_manage() { @@ -90,7 +90,7 @@ class sambaGroupMapping extends baseModule { * Returns meta data that is interpreted by parent class * * @return array array with meta data - * + * * @see baseModule::get_metaData() */ function get_metaData() { @@ -192,7 +192,7 @@ class sambaGroupMapping extends baseModule { } return null; } - + /** * Gets the cn from the Unix group module. * @@ -210,7 +210,7 @@ class sambaGroupMapping extends baseModule { } return null; } - + /** * 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 * @return array column list - * + * * @see baseModule::get_metaData() */ public function get_uploadColumns($selectedModules) { @@ -327,7 +327,7 @@ class sambaGroupMapping extends baseModule { /** * Returns the HTML meta data for the main account page. - * + * * @return htmlElement HTML meta data */ function display_html_attributes() { @@ -372,7 +372,7 @@ class sambaGroupMapping extends baseModule { $options[] = $names[$i]; } $return->addElement(new htmlTableExtendedSelect('sambaSID', $options, $selected, _('Windows group'), 'sambaSID'), true); - // group type + // group type $names = array_keys($this->sambaGroupTypes); $selected = array( _('Domain group') ); for ($i=0; $ialignment = htmlElement::ALIGN_TOP; $return->addElement($memberHelp, true); - + $return->addElement(new htmlSpacer(null, '10px'), true); - + $remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension')); $remButton->colspan = 3; $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. - * + * * @return htmlElement HTML meta data */ function display_html_members() { @@ -495,7 +495,7 @@ class sambaGroupMapping extends baseModule { $options = array(); $optionsSelected = array(); 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') { $optionsSelected[] = $types[$i]; } @@ -511,7 +511,7 @@ class sambaGroupMapping extends baseModule { $return->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'membersBack', _('Back'))); return $return; } - + /** * Processes user input of the members page. * 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. - * + * * @see baseModule::module_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); } - + /** * Returns a list of existing Samba 3 domains. * @@ -780,7 +780,7 @@ class sambaGroupMapping extends baseModule { $this->sidCache[$result['sambasid'][0]] = $label; } } - + } ?> diff --git a/lam/lib/modules/windowsGroup.inc b/lam/lib/modules/windowsGroup.inc index 64539b70..0552dc41 100644 --- a/lam/lib/modules/windowsGroup.inc +++ b/lam/lib/modules/windowsGroup.inc @@ -720,7 +720,7 @@ class windowsGroup extends baseModule { $options = array(); $optionsSelected = array(); 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') { $optionsSelected[] = $types[$i]; } diff --git a/lam/lib/pdfstruct.inc b/lam/lib/pdfstruct.inc index bf81592c..9c07d619 100644 --- a/lam/lib/pdfstruct.inc +++ b/lam/lib/pdfstruct.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ $Id$ /** * Functions to manage the PDF structures. - * + * * @author Michael Duergner * @package PDF */ @@ -98,7 +98,7 @@ function loadPDFStructureDefinitions($scope='user',$pdf_structure='default') { /** * Saves PDF structure definitions to XML file in format: ..xml - * + * * @param string $scope account type * @param string $definition Name of definition * @return string "no perms" if access denied or "ok". @@ -132,7 +132,7 @@ function savePDFStructureDefinitions($scope,$definition) { } } if($entry['type'] == 'open') { - $file .= $ident . '<' . strtolower($entry['tag']) . $attributes . ">\n"; + $file .= $ident . '<' . strtolower($entry['tag']) . $attributes . ">\n"; } elseif($entry['type'] == 'close') { $file .= $ident . '\n"; @@ -184,7 +184,7 @@ function getAvailableLogos() { $dirPath = dirname(__FILE__) . '/../config/pdf/' . $_SESSION['config']->getName() . '/logos/'; $dirHandle = opendir($dirPath); 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); if($infos[0] <= 2000 && $infos[1] <= 300) { 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. - * + * * @param String $file full path of temporary file * @param String $name file name * @return StatusMessage status message to display */ 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".')); } $infos = getimagesize($file); @@ -264,7 +264,7 @@ function uploadPDFLogo($file, $name) { /** * Deletes a PDF logo file. - * + * * @param String $name file name * @return StatusMessage status message to display */ @@ -289,7 +289,7 @@ function deletePDFLogo($name) { $data = loadPDFStructureDefinitions($type, $structure); if ($data['page_definitions']['filename'] == $name) { 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))); } } } diff --git a/lam/lib/selfService.inc b/lam/lib/selfService.inc index e3a79371..2967b174 100644 --- a/lam/lib/selfService.inc +++ b/lam/lib/selfService.inc @@ -3,7 +3,7 @@ $Id$ 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 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( => array(, , ...))) */ function getSelfServiceProfiles() { - $types = getTypes(); + $types = LAM\TYPES\getTypes(); $dir = dir(substr(__FILE__, 0, strlen(__FILE__) - 20) . "/config/selfService"); $ret = array(); while ($entry = $dir->read()){ diff --git a/lam/lib/types.inc b/lam/lib/types.inc index 86d45600..e6463857 100644 --- a/lam/lib/types.inc +++ b/lam/lib/types.inc @@ -1,9 +1,10 @@ \n"; echo ""; echo ""; echo "\n"; - + // tabs echo '
'; @@ -200,7 +200,7 @@ jQuery(document).ready(function() { var maxWidth = 0; jQuery("select").each(function(){ if (jQuery(this).width() > maxWidth) - maxWidth = jQuery(this).width(); + maxWidth = jQuery(this).width(); }); jQuery("select").width(maxWidth); }); @@ -212,7 +212,7 @@ jQuery(document).ready(function() { $account_list = array(); 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(); @@ -300,7 +300,7 @@ function config_showAccountModules($scope, $title, &$container) { } } } - + // add account module selection $container->addElement(new htmlSubTitle($title, '../../graphics/' . $scope . '.png'), true); $container->addElement(new htmlOutputText(_("Selected modules"))); @@ -412,7 +412,7 @@ function checkInput() { $depends = check_module_depends($selected, getModulesDependencies($scope)); if ($depends != false) { 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] . ")"); } } @@ -420,7 +420,7 @@ function checkInput() { $conflicts = check_module_conflicts($selected, getModulesDependencies($scope)); if ($conflicts != false) { 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] . ")"); } } @@ -432,8 +432,8 @@ function checkInput() { } } 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); diff --git a/lam/templates/config/conftypes.php b/lam/templates/config/conftypes.php index cf35888c..05c25c3d 100644 --- a/lam/templates/config/conftypes.php +++ b/lam/templates/config/conftypes.php @@ -105,12 +105,12 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules']) } $typeSettings = $conf->get_typeSettings(); -$allTypes = getTypes(); +$allTypes = LAM\TYPES\getTypes(); $activeTypes = $conf->get_ActiveTypes(); $availableTypes = array(); for ($i = 0; $i < sizeof($allTypes); $i++) { if (!in_array($allTypes[$i], $activeTypes)) { - $availableTypes[$allTypes[$i]] = getTypeAlias($allTypes[$i]); + $availableTypes[$allTypes[$i]] = LAM\TYPES\getTypeAlias($allTypes[$i]); } } natcasesort($availableTypes); @@ -230,7 +230,7 @@ if (sizeof($availableTypes) > 0) { $availableContainer->addElement(new htmlImage('../../graphics/' . $key . '.png')); $availableContainer->addElement(new htmlOutputText($value)); $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->setTitle(_("Add")); $availableContainer->addElement($button, true); @@ -249,11 +249,11 @@ if (sizeof($activeTypes) > 0) { $titleGroup = new htmlGroup(); $titleGroup->colspan = 6; $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); $titleGroup->addElement($titleText); $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); // delete button $delButton = new htmlButton('rem_'. $activeTypes[$i], 'del.png', true); @@ -271,7 +271,7 @@ if (sizeof($activeTypes) > 0) { $attributes = $typeSettings['attr_' . $activeTypes[$i]]; } else { - $attributes = getDefaultListAttributes($activeTypes[$i]); + $attributes = LAM\TYPES\getDefaultListAttributes($activeTypes[$i]); } $attrsInput = new htmlTableExtendedInputField(_("List attributes"), 'attr_' . $activeTypes[$i], $attributes, '206'); $attrsInput->setFieldSize(40); @@ -414,7 +414,7 @@ function checkInput() { $typeSettings[$key] = trim($_POST[$key]); $type = substr($postKeys[$i], 7); 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 @@ -422,7 +422,7 @@ function checkInput() { $typeSettings[$key] = $_POST[$key]; $type = substr($postKeys[$i], 5); 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 diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index eea1f350..60813a1d 100644 --- a/lam/templates/config/moduleSettings.php +++ b/lam/templates/config/moduleSettings.php @@ -3,7 +3,7 @@ $Id$ 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 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']; @@ -159,7 +159,7 @@ echo "
\n"; echo ""; echo ""; echo "
\n"; - + // tabs echo '
'; @@ -282,7 +282,7 @@ function checkInput() { } $conf = &$_SESSION['conf_config']; $types = $conf->get_ActiveTypes(); - + // check module options // create option array to check and save $options = extractConfigOptionsFromPOST($_SESSION['conf_types']); diff --git a/lam/templates/lists/list.php b/lam/templates/lists/list.php index 3644778c..3f36791a 100644 --- a/lam/templates/lists/list.php +++ b/lam/templates/lists/list.php @@ -3,7 +3,7 @@ $Id$ 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 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 -$listClass = getListClassName($type); +$listClass = LAM\TYPES\getListClassName($type); if (!isset($_SESSION['list_' . $type])) { $list = new $listClass($type); $_SESSION['list_' . $type] = $list; diff --git a/lam/templates/main_header.php b/lam/templates/main_header.php index c8a66a0e..7b7fd2f7 100644 --- a/lam/templates/main_header.php +++ b/lam/templates/main_header.php @@ -3,18 +3,18 @@ $Id$ 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 it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -208,7 +208,7 @@ jQuery(document).ready(function() { $link = '' . '' . $types[$i] . ' ' . - getTypeAlias($types[$i]) . ''; + LAM\TYPES\getTypeAlias($types[$i]) . ''; echo '
  • '; echo $link; echo "
  • \n"; diff --git a/lam/templates/multiEdit.php b/lam/templates/multiEdit.php index 959404f5..22547ba6 100644 --- a/lam/templates/multiEdit.php +++ b/lam/templates/multiEdit.php @@ -3,7 +3,7 @@ $Id$ 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 it under the terms of the GNU General Public License as published by @@ -88,7 +88,7 @@ function displayStartPage() { $types = $_SESSION['config']->get_ActiveTypes(); $suffixes = array(); 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'); } $treeSuffix = $_SESSION['config']->get_Suffix('tree'); @@ -172,14 +172,14 @@ function displayStartPage() { $buttonGroup->addElement($applyButton); $container->addElement($buttonGroup, true); $container->addVerticalSpace('10px'); - + // run actions if ((sizeof($errors) == 0) && (isset($_POST['dryRun']) || isset($_POST['applyChanges']))) { runActions($container); } - + addSecurityTokenToMetaHTML($container); - + parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ("\n"); echo '
    '; @@ -188,7 +188,7 @@ function displayStartPage() { /** * Runs the dry run and change actions. - * + * * @param htmlTable $container container */ function runActions(&$container) { @@ -243,7 +243,7 @@ function runActions(&$container) { // JS block for AJAX status update $ajaxBlock = ' jQuery.get(\'multiEdit.php?ajaxStatus\', null, function(data) {handleReply(data);}, \'json\'); - + function handleReply(data) { jQuery(\'#progressBar\').progressbar({value: data.progress, max: 120}); jQuery(\'#progressArea\').html(data.content); @@ -292,7 +292,7 @@ function runAjaxActions() { /** * Reads the LDAP entries from the directory. - * + * * @return array status */ function readLDAPData() { @@ -338,7 +338,7 @@ function readLDAPData() { /** * Generates the required actions based on the read LDAP data. - * + * * @return array status */ function generateActions() { @@ -388,7 +388,7 @@ function generateActions() { /** * Prints the dryRun output. - * + * * @return array status */ function dryRun() { @@ -423,7 +423,7 @@ function dryRun() { case DEL: $ldif .= 'delete: ' . $attr . "\n"; if (empty($val)) { - $log .= '-' . $attr . "\r\n"; + $log .= '-' . $attr . "\r\n"; } else { $log .= '-' . $attr . '=' . $val . "\r\n"; @@ -468,7 +468,7 @@ function dryRun() { /** * Runs the actual modifications. - * + * * @return array status */ function doModify() { @@ -533,7 +533,7 @@ function doModify() { /** * Returns the HTML code for a htmlStatusMessage - * + * * @param htmlStatusMessage $msg message * @return String HTML code */ diff --git a/lam/templates/ou_edit.php b/lam/templates/ou_edit.php index 8260764b..76207a73 100644 --- a/lam/templates/ou_edit.php +++ b/lam/templates/ou_edit.php @@ -3,7 +3,7 @@ $Id$ 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 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; $container->addElement($dnLabel, 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 htmlHiddenInput('deleteOU', 'submit')); + $container->addElement(new htmlHiddenInput('deleteOU', 'submit')); $container->addElement(new htmlHiddenInput('deletename', $_POST['deleteableOU'])); - addSecurityTokenToMetaHTML($container); + addSecurityTokenToMetaHTML($container); parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ""; echo '
    '; @@ -142,7 +142,7 @@ display_main($message, $error); /** * Displays the main page of the OU editor - * + * * @param String $message info message * @param String $error error message */ @@ -165,14 +165,14 @@ function display_main($message, $error) { $msg->colspan = 5; $container->addElement($msg, true); } - + $types = array(); $typeList = $_SESSION['config']->get_ActiveTypes(); for ($i = 0; $i < sizeof($typeList); $i++) { if (isAccountTypeHidden($typeList[$i]) || !checkIfWriteAccessIsAllowed($typeList[$i])) { continue; } - $types[$typeList[$i]] = getTypeAlias($typeList[$i]); + $types[$typeList[$i]] = LAM\TYPES\getTypeAlias($typeList[$i]); } natcasesort($types); $options = array(); @@ -184,7 +184,7 @@ function display_main($message, $error) { } $options[$title] = $elements; } - + if (!empty($options)) { // new OU $container->addElement(new htmlOutputText(_("New organisational unit"))); @@ -197,9 +197,9 @@ function display_main($message, $error) { $container->addElement(new htmlInputField('newOU')); $container->addElement(new htmlButton('createOU', _("Ok"))); $container->addElement(new htmlHelpLink('601'), true); - + $container->addElement(new htmlSpacer(null, '10px'), true); - + // delete OU $container->addElement(new htmlOutputText(_("Delete organisational unit"))); $deleteableOUSelect = new htmlSelect('deleteableOU', $options, array()); @@ -212,7 +212,7 @@ function display_main($message, $error) { $container->addElement(new htmlButton('deleteOU', _("Ok"))); $container->addElement(new htmlHelpLink('602'), true); } - + addSecurityTokenToMetaHTML($container); parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ("\n"); diff --git a/lam/templates/pdfedit/pdfmain.php b/lam/templates/pdfedit/pdfmain.php index 3b64b9fc..8df23dae 100644 --- a/lam/templates/pdfedit/pdfmain.php +++ b/lam/templates/pdfedit/pdfmain.php @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 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])) { continue; } - $sortedScopes[$scopes[$i]] = getTypeAlias($scopes[$i]); + $sortedScopes[$scopes[$i]] = LAM\TYPES\getTypeAlias($scopes[$i]); } natcasesort($sortedScopes); @@ -90,12 +90,12 @@ $container->addElement(new htmlTitle(_('PDF editor')), true); if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) { // delete structure 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; $container->addElement($message, true); } 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; $container->addElement($message, true); } @@ -300,7 +300,7 @@ include '../main_header.php'; $container->addElement(new htmlHiddenInput('importexport', '1')); $container->addElement(new htmlHiddenInput('scope', $scope), true); addSecurityTokenToMetaHTML($container); - + parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ''; @@ -312,21 +312,21 @@ include '../main_header.php'; echo "
    \n"; $container = new htmlTable(); - + $container->addElement(new htmlOutputText(_('PDF structure')), true); $expStructGroup = new htmlTable(); $expStructGroup->addElement(new htmlSpacer('10px', null)); $expStructGroup->addElement(new htmlDiv('exportName', '')); $container->addElement($expStructGroup, true); $container->addElement(new htmlSpacer(null, '10px'), true); - + $container->addElement(new htmlOutputText(_("Target server profile")), true); foreach ($configProfiles as $key => $value) { $tmpProfiles[$value] = $value; } natcasesort($tmpProfiles); $tmpProfiles['*' . _('Global templates')] = 'templates*'; - + $findProfile = array_search($_SESSION['config']->getName(), $tmpProfiles); if ($findProfile !== false) { unset($tmpProfiles[$findProfile]); @@ -339,7 +339,7 @@ include '../main_header.php'; $container->addElement($select); $container->addElement(new htmlHelpLink('409'), true); $container->addElement(new htmlSpacer(null, '10px'), true); - + $container->addElement(new htmlOutputText(_("Master password")), true); $exportPasswd = new htmlInputField('passwd'); $exportPasswd->setIsPassword(true); @@ -347,7 +347,7 @@ include '../main_header.php'; $container->addElement(new htmlHelpLink('236')); $container->addElement(new htmlHiddenInput('importexport', '1'), true); addSecurityTokenToMetaHTML($container); - + parseHtml(null, $container, array(), false, $tabindex, 'user'); echo '
    '; diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php index 1a1668e9..182f99d8 100644 --- a/lam/templates/profedit/profilemain.php +++ b/lam/templates/profedit/profilemain.php @@ -3,7 +3,7 @@ $Id$ 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 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])) { continue; } - $profileClassesTemp[getTypeAlias($types[$i])] = array( + $profileClassesTemp[LAM\TYPES\getTypeAlias($types[$i])] = array( 'scope' => $types[$i], - 'title' => getTypeAlias($types[$i]), + 'title' => LAM\TYPES\getTypeAlias($types[$i]), 'profiles' => ""); } $profileClassesKeys = array_keys($profileClassesTemp); @@ -105,12 +105,12 @@ if (isset($_POST['deleteProfile']) && ($_POST['deleteProfile'] == 'true')) { } // delete profile 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; $container->addElement($message, true); } 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; $container->addElement($message, true); } @@ -124,7 +124,7 @@ if (isset($_POST['importexport']) && ($_POST['importexport'] === '1')) { // check master password if (!$cfg->checkPassword($_POST['passwd_' . $_POST['scope']])) { $impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!')); - } + } elseif (copyAccountProfiles($_POST['importProfiles_' . $_POST['scope']], $_POST['scope'])) { $impExpMessage = new htmlStatusMessage('INFO', _('Import successful')); } @@ -132,7 +132,7 @@ if (isset($_POST['importexport']) && ($_POST['importexport'] === '1')) { // check master password if (!$cfg->checkPassword($_POST['passwd'])) { $impExpMessage = new htmlStatusMessage('ERROR', _('Master password is wrong!')); - } + } elseif (copyAccountProfiles($_POST['exportProfiles'], $_POST['scope'], $_POST['destServerProfiles'])) { $impExpMessage = new htmlStatusMessage('INFO', _('Export successful')); } @@ -247,7 +247,7 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) { $container = new htmlTable(); $container->addElement(new htmlOutputText(_('Profiles')), true); - + $select = new htmlSelect('importProfiles_' . $scope, $tmpArr, array(), count($tmpArr, 1) < 15 ? count($tmpArr, 1) : 15); $select->setMultiSelect(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('scope', $scope), true); addSecurityTokenToMetaHTML($container); - + parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ''; @@ -286,7 +286,7 @@ $expStructGroup->addElement(new htmlSpacer('10px', null)); $expStructGroup->addElement(new htmlDiv('exportName', '')); $container->addElement($expStructGroup, true); $container->addElement(new htmlSpacer(null, '10px'), true); - + $container->addElement(new htmlOutputText(_("Target server profile")), true); foreach ($configProfiles as $key => $value) { $tmpProfiles[$value] = $value; diff --git a/lam/templates/tests/schemaTest.php b/lam/templates/tests/schemaTest.php index 6dfbf726..d1b30836 100644 --- a/lam/templates/tests/schemaTest.php +++ b/lam/templates/tests/schemaTest.php @@ -3,18 +3,18 @@ $Id$ 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 it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -58,13 +58,13 @@ get_schema_objectclasses(); $classes = get_cached_schema('objectclasses'); 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 { // loop for active account types for ($t = 0; $t < sizeof($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++) { $error = checkSchemaForModule($modules[$m], $types[$t]); $message = _("No problems found."); diff --git a/lam/templates/upload/masscreate.php b/lam/templates/upload/masscreate.php index 69de336b..35ac8816 100644 --- a/lam/templates/upload/masscreate.php +++ b/lam/templates/upload/masscreate.php @@ -142,7 +142,7 @@ $table = new htmlTable(); // account type $typeList = array(); for ($i = 0; $i < sizeof($types); $i++) { - $typeList[getTypeAlias($types[$i])] = $types[$i]; + $typeList[LAM\TYPES\getTypeAlias($types[$i])] = $types[$i]; } $selectedType = array(); if (isset($_REQUEST['type'])) {