formatting
This commit is contained in:
parent
28fcd7c8e7
commit
63cab618fc
|
@ -54,7 +54,7 @@ class Ldap{
|
||||||
|
|
||||||
/** Server handle */
|
/** Server handle */
|
||||||
private $server;
|
private $server;
|
||||||
|
|
||||||
/** LDAP connection established */
|
/** LDAP connection established */
|
||||||
private $is_connected = false;
|
private $is_connected = false;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class Ldap{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new LDAP object.
|
* Creates a new LDAP object.
|
||||||
*
|
*
|
||||||
* @param object $config an object of class Config
|
* @param object $config an object of class Config
|
||||||
*/
|
*/
|
||||||
function __construct($config) {
|
function __construct($config) {
|
||||||
|
|
|
@ -516,7 +516,7 @@ function buildUploadAccounts($scope, $data, $ids, $selectedModules) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs any actions that need to be done before an LDAP entry is created.
|
* Runs any actions that need to be done before an LDAP entry is created.
|
||||||
*
|
*
|
||||||
* @param String $scope account type
|
* @param String $scope account type
|
||||||
* @param array $selectedModules list of selected account modules
|
* @param array $selectedModules list of selected account modules
|
||||||
* @param array $attributes LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care)
|
* @param array $attributes LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care)
|
||||||
|
@ -603,7 +603,7 @@ function getRequiredExtensions() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a list of meta-HTML elements and prints the equivalent HTML output.
|
* Takes a list of meta-HTML elements and prints the equivalent HTML output.
|
||||||
*
|
*
|
||||||
* The modules are not allowed to display HTML code directly but return
|
* The modules are not allowed to display HTML code directly but return
|
||||||
* meta HTML code. This allows to have a common design for all module pages.
|
* meta HTML code. This allows to have a common design for all module pages.
|
||||||
*
|
*
|
||||||
|
@ -677,7 +677,7 @@ function printHelpLink($entry, $number, $module='', $scope='') {
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
class accountContainer {
|
class accountContainer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
@ -726,7 +726,7 @@ class accountContainer {
|
||||||
|
|
||||||
/** RDN attribute of this account */
|
/** RDN attribute of this account */
|
||||||
public $rdn;
|
public $rdn;
|
||||||
|
|
||||||
/** DN of saved account */
|
/** DN of saved account */
|
||||||
public $finalDN;
|
public $finalDN;
|
||||||
|
|
||||||
|
@ -747,13 +747,13 @@ class accountContainer {
|
||||||
|
|
||||||
/** True if this is a newly created account */
|
/** True if this is a newly created account */
|
||||||
public $isNewAccount;
|
public $isNewAccount;
|
||||||
|
|
||||||
/** name of last loaded account profile */
|
/** name of last loaded account profile */
|
||||||
private $lastLoadedProfile = '';
|
private $lastLoadedProfile = '';
|
||||||
|
|
||||||
/** cache for existing OUs */
|
/** cache for existing OUs */
|
||||||
private $cachedOUs = null;
|
private $cachedOUs = null;
|
||||||
|
|
||||||
/** main title in title bar */
|
/** main title in title bar */
|
||||||
private $titleBarTitle = null;
|
private $titleBarTitle = null;
|
||||||
/** subtitle in title bar */
|
/** subtitle in title bar */
|
||||||
|
@ -762,7 +762,7 @@ class accountContainer {
|
||||||
private $sendPasswordViaMail = null;
|
private $sendPasswordViaMail = null;
|
||||||
/** send password via mail to this alternate address */
|
/** send password via mail to this alternate address */
|
||||||
private $sendPasswordViaMailAlternateAddress = null;
|
private $sendPasswordViaMailAlternateAddress = null;
|
||||||
|
|
||||||
/** random ID number to avoid parallel editing of accounts in multiple browser tabs */
|
/** random ID number to avoid parallel editing of accounts in multiple browser tabs */
|
||||||
private $randomID = null;
|
private $randomID = null;
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ class accountContainer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the included account modules.
|
* Returns the included account modules.
|
||||||
*
|
*
|
||||||
|
@ -789,7 +789,7 @@ class accountContainer {
|
||||||
function getAccountModules() {
|
function getAccountModules() {
|
||||||
return $this->module;
|
return $this->module;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the accout type of this object (e.g. user, group, host).
|
* Returns the accout type of this object (e.g. user, group, host).
|
||||||
*
|
*
|
||||||
|
@ -959,10 +959,10 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
$this->printPageFooter();
|
$this->printPageFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the content part provided by the current module.
|
* Prints the content part provided by the current module.
|
||||||
*
|
*
|
||||||
* @param array $result list of messages
|
* @param array $result list of messages
|
||||||
* @param boolean $stopProcessing true if page should end after displaying the messages
|
* @param boolean $stopProcessing true if page should end after displaying the messages
|
||||||
*/
|
*/
|
||||||
|
@ -1116,10 +1116,10 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the new password in all selected account modules.
|
* Sets the new password in all selected account modules.
|
||||||
*
|
*
|
||||||
* @param array $input input parameters
|
* @param array $input input parameters
|
||||||
*/
|
*/
|
||||||
public function setNewPassword($input) {
|
public function setNewPassword($input) {
|
||||||
|
@ -1195,12 +1195,12 @@ class accountContainer {
|
||||||
if ($return['errorsOccured'] == 'false') {
|
if ($return['errorsOccured'] == 'false') {
|
||||||
$return['messages'] .= StatusMessage('INFO', _('The new password will be stored in the directory after you save this account.'), '', array(), true);
|
$return['messages'] .= StatusMessage('INFO', _('The new password will be stored in the directory after you save this account.'), '', array(), true);
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if any module manages the mail attribute.
|
* Returns if any module manages the mail attribute.
|
||||||
*
|
*
|
||||||
* @return boolean mail is managed
|
* @return boolean mail is managed
|
||||||
*/
|
*/
|
||||||
private function anyModuleManagesMail() {
|
private function anyModuleManagesMail() {
|
||||||
|
@ -1211,10 +1211,10 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints common controls like the save button and the ou selection.
|
* Prints common controls like the save button and the ou selection.
|
||||||
*
|
*
|
||||||
* @param int $tabindex tabindex for GUI elements
|
* @param int $tabindex tabindex for GUI elements
|
||||||
*/
|
*/
|
||||||
private function printCommonControls(&$tabindex) {
|
private function printCommonControls(&$tabindex) {
|
||||||
|
@ -1243,7 +1243,7 @@ class accountContainer {
|
||||||
$leftButtonGroup->addElement($passwordButton);
|
$leftButtonGroup->addElement($passwordButton);
|
||||||
}
|
}
|
||||||
$table->addElement($leftButtonGroup);
|
$table->addElement($leftButtonGroup);
|
||||||
|
|
||||||
$rightGroup = new htmlGroup();
|
$rightGroup = new htmlGroup();
|
||||||
$rightGroup->alignment = htmlElement::ALIGN_RIGHT;
|
$rightGroup->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
// profile selection
|
// profile selection
|
||||||
|
@ -1261,7 +1261,7 @@ class accountContainer {
|
||||||
$rightGroup->addElement(new htmlHelpLink('401'));
|
$rightGroup->addElement(new htmlHelpLink('401'));
|
||||||
}
|
}
|
||||||
$table->addElement($rightGroup);
|
$table->addElement($rightGroup);
|
||||||
|
|
||||||
parseHtml(null, $table, array(), false, $tabindex, $this->type);
|
parseHtml(null, $table, array(), false, $tabindex, $this->type);
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -1279,7 +1279,7 @@ class accountContainer {
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the page should show a button to set the password.
|
* Returns if the page should show a button to set the password.
|
||||||
*
|
*
|
||||||
|
@ -1293,7 +1293,7 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the header of the account pages.
|
* Prints the header of the account pages.
|
||||||
*/
|
*/
|
||||||
|
@ -1308,10 +1308,10 @@ class accountContainer {
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
echo "<form id=\"inputForm\" enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\" onSubmit=\"saveScrollPosition('inputForm')\" autocomplete=\"off\">\n";
|
echo "<form id=\"inputForm\" enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\" onSubmit=\"saveScrollPosition('inputForm')\" autocomplete=\"off\">\n";
|
||||||
echo '<input type="hidden" name="account_randomID" value="' . $this->randomID . '">';
|
echo '<input type="hidden" name="account_randomID" value="' . $this->randomID . '">';
|
||||||
echo '<input type="hidden" name="' . getSecurityTokenName() . '" value="' . getSecurityTokenValue() . '">';
|
echo '<input type="hidden" name="' . getSecurityTokenName() . '" value="' . getSecurityTokenValue() . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the footer of the account pages.
|
* Prints the footer of the account pages.
|
||||||
*/
|
*/
|
||||||
|
@ -1319,7 +1319,7 @@ class accountContainer {
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
include '../main_footer.php';
|
include '../main_footer.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the HTML code to notify the user about the successful saving.
|
* Prints the HTML code to notify the user about the successful saving.
|
||||||
*
|
*
|
||||||
|
@ -1335,7 +1335,7 @@ class accountContainer {
|
||||||
$text = _("Account was modified successfully.");
|
$text = _("Account was modified successfully.");
|
||||||
}
|
}
|
||||||
echo "<div class=\"".$this->type."-bright smallPaddingContent\">";
|
echo "<div class=\"".$this->type."-bright smallPaddingContent\">";
|
||||||
|
|
||||||
$container = new htmlTable();
|
$container = new htmlTable();
|
||||||
// show messages
|
// show messages
|
||||||
for ($i = 0; $i < sizeof($messages); $i++) {
|
for ($i = 0; $i < sizeof($messages); $i++) {
|
||||||
|
@ -1354,7 +1354,7 @@ class accountContainer {
|
||||||
$message->colspan = 10;
|
$message->colspan = 10;
|
||||||
$container->addElement($message, true);
|
$container->addElement($message, true);
|
||||||
$container->addElement(new htmlSpacer(null, '20px'), true);
|
$container->addElement(new htmlSpacer(null, '20px'), true);
|
||||||
|
|
||||||
$type = new $this->type();
|
$type = new $this->type();
|
||||||
$buttonGroup = new htmlGroup();
|
$buttonGroup = new htmlGroup();
|
||||||
if (checkIfNewEntriesAreAllowed($this->type)) {
|
if (checkIfNewEntriesAreAllowed($this->type)) {
|
||||||
|
@ -1375,17 +1375,17 @@ class accountContainer {
|
||||||
$backToEditButton->setIconClass('editButton');
|
$backToEditButton->setIconClass('editButton');
|
||||||
$buttonGroup->addElement($backToEditButton);
|
$buttonGroup->addElement($backToEditButton);
|
||||||
$container->addElement($buttonGroup, true);
|
$container->addElement($buttonGroup, true);
|
||||||
|
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
parseHtml(null, $container, array(), false, $tabindex, $this->type);
|
parseHtml(null, $container, array(), false, $tabindex, $this->type);
|
||||||
|
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
$this->printPageFooter();
|
$this->printPageFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the user requested to load a profile.
|
* Checks if the user requested to load a profile.
|
||||||
*
|
*
|
||||||
* @return boolean true, if profile was loaded
|
* @return boolean true, if profile was loaded
|
||||||
*/
|
*/
|
||||||
private function loadProfileIfRequested() {
|
private function loadProfileIfRequested() {
|
||||||
|
@ -1407,13 +1407,13 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the HTML code of the module tabs.
|
* Prints the HTML code of the module tabs.
|
||||||
*/
|
*/
|
||||||
private function printModuleTabs() {
|
private function printModuleTabs() {
|
||||||
// $x is used to count up tabindex
|
// $x is used to count up tabindex
|
||||||
$x=1;
|
$x=1;
|
||||||
echo '<ul class="lamEqualHeightTabContent ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
|
echo '<ul class="lamEqualHeightTabContent ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
|
||||||
// Loop for each module
|
// Loop for each module
|
||||||
for ($i=0; $i<count($this->order); $i++ ) {
|
for ($i=0; $i<count($this->order); $i++ ) {
|
||||||
|
@ -1445,7 +1445,7 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks which LDAP attributes have changed while the account was edited.
|
* This function checks which LDAP attributes have changed while the account was edited.
|
||||||
*
|
*
|
||||||
|
@ -1531,7 +1531,7 @@ class accountContainer {
|
||||||
*
|
*
|
||||||
* @param string $dn the DN of the account
|
* @param string $dn the DN of the account
|
||||||
* @param array $infoAttributes list of additional informational attributes that are added to the LDAP attributes
|
* @param array $infoAttributes list of additional informational attributes that are added to the LDAP attributes
|
||||||
* E.g. this is used to inject the clear text password in the file upload. Informational attribute names must start with "INFO.".
|
* E.g. this is used to inject the clear text password in the file upload. Informational attribute names must start with "INFO.".
|
||||||
* @return array error messages
|
* @return array error messages
|
||||||
*/
|
*/
|
||||||
function load_account($dn, $infoAttributes = array()) {
|
function load_account($dn, $infoAttributes = array()) {
|
||||||
|
@ -2073,7 +2073,7 @@ class accountContainer {
|
||||||
$this->current_page = array_search($currentPage, $this->order);
|
$this->current_page = array_search($currentPage, $this->order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the RDN part of a given DN.
|
* Returns the RDN part of a given DN.
|
||||||
*
|
*
|
||||||
|
@ -2085,7 +2085,7 @@ class accountContainer {
|
||||||
$rdn = substr($dn, 0, strpos($dn, ","));
|
$rdn = substr($dn, 0, strpos($dn, ","));
|
||||||
return $rdn;
|
return $rdn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the parent DN of a given DN.
|
* Returns the parent DN of a given DN.
|
||||||
*
|
*
|
||||||
|
@ -2095,9 +2095,9 @@ class accountContainer {
|
||||||
function getParentDN($dn) {
|
function getParentDN($dn) {
|
||||||
if (($dn == "") || ($dn == null)) return "";
|
if (($dn == "") || ($dn == null)) return "";
|
||||||
$parent = substr($dn, strpos($dn, ",") + 1);
|
$parent = substr($dn, strpos($dn, ",") + 1);
|
||||||
return $parent;
|
return $parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of OUs that exist for this account type.
|
* Returns a list of OUs that exist for this account type.
|
||||||
*
|
*
|
||||||
|
@ -2145,23 +2145,23 @@ class accountContainer {
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
interface passwordService {
|
interface passwordService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method specifies if a module manages password attributes. The module alias will
|
* This method specifies if a module manages password attributes. The module alias will
|
||||||
* then appear as option in the GUI.
|
* then appear as option in the GUI.
|
||||||
* <br>If the module only wants to get notified about password changes then return false.
|
* <br>If the module only wants to get notified about password changes then return false.
|
||||||
*
|
*
|
||||||
* @return boolean true if this module manages password attributes
|
* @return boolean true if this module manages password attributes
|
||||||
*/
|
*/
|
||||||
public function managesPasswordAttributes();
|
public function managesPasswordAttributes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies if this module supports to force that a user must change his password on next login.
|
* Specifies if this module supports to force that a user must change his password on next login.
|
||||||
*
|
*
|
||||||
* @return boolean force password change supported
|
* @return boolean force password change supported
|
||||||
*/
|
*/
|
||||||
public function supportsForcePasswordChange();
|
public function supportsForcePasswordChange();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is called whenever the password should be changed. Account modules
|
* This function is called whenever the password should be changed. Account modules
|
||||||
* must change their password attributes only if the modules list contains their module name.
|
* must change their password attributes only if the modules list contains their module name.
|
||||||
|
|
Loading…
Reference in New Issue