Commit 270bb98a authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '2895-add-support-for-paginating-ldap-result-in-setup' into '1.4-dev'

Resolve "Add support for paginating ldap result in setup"

See merge request fusiondirectory/fd!671
parents e5aa1639 85df6d5c
......@@ -435,6 +435,14 @@ function add_lock ($object, $user)
$ldap->cd(get_ou('lockRDN').get_ou('fusiondirectoryRDN').$config->current['BASE']);
$ldap->search('(&(objectClass=fdLockEntry)(fdUserDn='.ldap_escape_f($user).')(fdObjectDn='.base64_encode($object).'))',
['fdUserDn']);
if ($ldap->get_errno() == 32) {
/* No such object, means the locking branch is missing, create it */
$ldap->cd($config->current['BASE']);
$ldap->create_missing_trees(get_ou('lockRDN').get_ou('fusiondirectoryRDN').$config->current['BASE']);
$ldap->cd(get_ou('lockRDN').get_ou('fusiondirectoryRDN').$config->current['BASE']);
$ldap->search('(&(objectClass=fdLockEntry)(fdUserDn='.ldap_escape_f($user).')(fdObjectDn='.base64_encode($object).'))',
['fdUserDn']);
}
if (!$ldap->success()) {
msg_dialog::display(_('Configuration error'), sprintf(_('Cannot create locking information in LDAP tree. Please contact your administrator!').'<br><br>'._('LDAP server returned: %s'), '<br><br><i>'.$ldap->get_error().'</i>'), ERROR_DIALOG);
return;
......
......@@ -96,7 +96,7 @@ class setupStepConfig extends configInLdap
function save_object ()
{
global $config;
global $config, $plist;
parent::save_object();
$this->is_completed = FALSE;
$tmp = $this->check();
......@@ -123,6 +123,10 @@ class setupStepConfig extends configInLdap
$config->set_current($config->current['NAME']);
session::un_set('plist');
pluglist::load();
/* Insert default config values, even for installed plugin */
$config->loadPlist($plist);
$config->checkLdapConfig(TRUE);
/* Set as completed and reload step */
$this->is_completed = TRUE;
$this->parent->reBuildConfigStep(TRUE);
}
......
......@@ -52,33 +52,6 @@ class setupStepFinish extends setupStep
return $smarty->fetch(CONFIG_TEMPLATE_DIR.CONFIG_FILE);
}
function insertConfigDefaults ()
{
/* Insert default config values, even for installed plugin */
global $config, $ui, $plist, $BASE_DIR;
$cv = $this->parent->captured_values;
/* Create config object */
$config = new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
$config->set_current($config->data['MAIN']['DEFAULT']);
/* Create ui object */
/* got user dn, fill acl's */
$ui = new userinfo($cv['valid_admin']);
/* Username is set, load subtreeACL's now */
$ui->loadACL();
/* We need the pluglist object */
load_all_classes();
$plist = new pluglist();
/* Now we can save LDAP config */
$config->loadPlist($plist);
$config->checkLdapConfig(TRUE);
}
function execute (): string
{
/* Check if there is currently an active fusiondirectory.conf */
......@@ -108,7 +81,6 @@ class setupStepFinish extends setupStep
* - Permisssion are set correctly
*/
if (isset($_POST['next']) && $exists && !$this->is_world_readable(CONFIG_DIR.'/'.CONFIG_FILE)) {
$this->insertConfigDefaults();
session::destroy();
header('Location: index.php');
exit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment