applied Pavel's patch

This commit is contained in:
Roland Gruber 2012-01-21 18:40:34 +00:00
parent c340daef87
commit 10a264048d
1 changed files with 6 additions and 14 deletions

View File

@ -4,7 +4,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2009 - 2011 Pavel Pozdnyak Copyright (C) 2009 - 2012 Pavel Pozdnyak
2009 - 2011 Roland Gruber 2009 - 2011 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
@ -124,13 +124,6 @@ class asteriskExtensionNewUI extends baseModule {
), ),
); );
// configuration settings
$configContainer = new htmlTable();
$configContainer->addElement(new htmlTableExtendedInputCheckbox('asteriskExtension_UseCreatorAsOwner', false, _('Use a creator as an owner'), 'UseCreatorAsOwner', false));
$return['config_options']['all'] = $configContainer;
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlTable();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'AsteriskExtension_AstContext', null, 'AstContext'), true); $profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'AsteriskExtension_AstContext', null, 'AstContext'), true);
@ -170,8 +163,8 @@ class asteriskExtensionNewUI extends baseModule {
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
//Set default owner as logged in user if flag is set and no other owner is set //Set default owner as logged in user if no other owner is set
if ( $this->isBooleanConfigOptionSet('asteriskExtension_UseCreatorAsOwner') && ! $this->isExtensionOwnerSet()){ if ( ! $this->isExtensionOwnerSet()){
$this->setDefaultExtensionOwner(); $this->setDefaultExtensionOwner();
} }
@ -826,14 +819,13 @@ class asteriskExtensionNewUI extends baseModule {
$searchClass = "AsteriskExtension"; $searchClass = "AsteriskExtension";
$searchScope = 'asteriskExtNewUI'; $searchScope = 'asteriskExtNewUI';
$entries = searchLDAPByAttribute("AstExtension", $extension, $searchClass, array('cn', 'AstContext', 'AstPriority', $entries = searchLDAPByAttribute("AstExtension", $extension, $searchClass, array('cn', 'AstContext', 'AstPriority',
'AstApplication', 'AstApplicationData', 'AstExtension', 'member', 'ObjectClass'), array($searchScope)); 'AstApplication', 'AstApplicationData', 'AstExtension', 'member', 'ObjectClass', 'dn'), array($searchScope));
$entries = $this->array_sort($entries, 'astpriority'); $entries = $this->array_sort($entries, 'astpriority');
for ($rowCounter = 0; $rowCounter < count($entries); $rowCounter++) { for ($rowCounter = 0; $rowCounter < count($entries); $rowCounter++) {
$rowOrig = $entries[$rowCounter]; $rowOrig = $entries[$rowCounter];
if ($rowOrig["astpriority"][0] > 1) { if ($rowOrig["astpriority"][0] > 1) {
ldap_delete($_SESSION['ldap']->server(), $rowOrig['dn']);
ldap_delete($_SESSION['ldap']->server(), "cn=" . $rowOrig["cn"][0] . "," . $_SESSION['config']->get_Suffix('asteriskExtNewUI'));
} }
} }
$message = array(0 => array("ERROR")); $message = array(0 => array("ERROR"));