moved suffix option from main module to profile page

This commit is contained in:
Roland Gruber 2004-06-27 18:07:43 +00:00
parent df8aa61bcd
commit a7862e4dab
2 changed files with 18 additions and 17 deletions

View File

@ -283,23 +283,6 @@ class main extends baseModule {
return $return; return $return;
} }
function get_profileOptions() {
$return = array();
$suffixes = array();
// get root suffix
$rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($_SESSION[$this->base]->type) . 'Suffix'));
// get subsuffixes
foreach ($_SESSION['ldap']->search_units($rootsuffix) as $suffix) {
$suffixes[] = $suffix;
}
$return[] = array(
0 => array('kind' => 'text', 'text' => _('Suffix') . ': '),
1 => array('kind' => 'select', 'name' => 'main_suffix', 'options' => $suffixes, 'option_selected' => array($rootsuffix)),
2 => array('kind' => 'help', 'value' => 'TODO')
);
return $return;
}
function get_pdfFields($account_type="user") { function get_pdfFields($account_type="user") {
return array( 'dn'); return array( 'dn');
} }

View File

@ -75,6 +75,24 @@ if ($_GET['edit']) {
// display formular // display formular
echo ("<form action=\"profilecreate.php?type=$type\" method=\"post\">\n"); echo ("<form action=\"profilecreate.php?type=$type\" method=\"post\">\n");
// suffix box
// get root suffix
$rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($type) . 'Suffix'));
// get subsuffixes
$suffixes = array();
foreach ($_SESSION['ldap']->search_units($rootsuffix) as $suffix) {
$suffixes[] = $suffix;
}
if (sizeof($suffixes) > 0) {
echo "<fieldset>\n<legend><b>" . _("LDAP suffix") . "</b></legend>\n";
echo _("LDAP suffix") . ":&nbsp;&nbsp;";
echo "<select>";
for ($i = 0; $i < sizeof($suffixes); $i++) echo "<option>" . $suffixes[$i] . "</option>\n";
echo "</select>\n";
echo "&nbsp;&nbsp;<a href=../help.php?HelpNumber=TODO>" . _('Help') . "</a>\n";
echo "</fieldset>\n<br>\n";
}
// display module options // display module options
$modules = array_keys($options); $modules = array_keys($options);
for ($m = 0; $m < sizeof($modules); $m++) { for ($m = 0; $m < sizeof($modules); $m++) {