Commit 04bb71eb authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '6122-problems-with-fd-web-setup' into '1.4-dev'

Resolve "Problems with FD web setup"

See merge request fusiondirectory/fd!824
Showing with 18 additions and 17 deletions
+18 -17
......@@ -121,10 +121,6 @@ class setup implements FusionDirectoryDialog
public function update (): bool
{
if (!$this->selectable_step($this->i_current)) {
$this->i_current = $this->i_previous;
}
$this->o_steps[$this->i_previous]->update();
/* Get attributes from setup step */
......@@ -155,9 +151,14 @@ class setup implements FusionDirectoryDialog
}
}
if (!$this->selectable_step($this->i_current)) {
$this->i_current = $this->i_previous;
}
if ($this->i_current != $this->i_previous) {
$this->o_steps[$this->i_current]->update();
}
return TRUE;
}
......@@ -267,12 +268,11 @@ class setup implements FusionDirectoryDialog
}
/* Called when LDAP is configured */
function read_ldap_config ()
public function read_ldap_config (array $captured_values)
{
global $config;
/* Get attributes from current ldap step */
$tmp = $this->o_steps[$this->i_current]->get_attributes();
foreach ($tmp as $name => $value) {
/* Get attributes from ldap step */
foreach ($captured_values as $name => $value) {
$this->captured_values[$name] = $value;
}
$smarty = get_smarty();
......
......@@ -93,7 +93,7 @@ class setupStep extends simplePlugin
}
/* Return attributes handled by this setup step */
function get_attributes ()
public function get_attributes (): array
{
$tmp = [];
foreach (array_keys($this->attributesAccess) as $attr) {
......
......@@ -152,7 +152,7 @@ class setupStepLdap extends setupStep
$this->status = $this->get_connection_status();
if ($this->bind_id && !empty($this->admin) && !empty($this->base)) {
$this->is_completed = TRUE;
$this->parent->read_ldap_config();
$this->parent->read_ldap_config($this->get_attributes());
} else {
$this->is_completed = FALSE;
}
......
......@@ -131,7 +131,7 @@ class StepMigrateCheck
public $fnc;
private $step;
public function __construct ($step, $name, $title)
public function __construct (setupStepMigrate $step, string $name, string $title)
{
$this->name = $name;
$this->title = $title;
......@@ -434,7 +434,7 @@ class setupStepMigrate extends setupStep
$mods['ou'] = $val;
}
/*Append description, it is required by gosaDepartment too */
/* Append description, it is required by gosaDepartment too */
if (!isset($attrs['description'])) {
$val = "GOsa";
if (isset($attrs[$dep_infos['mainAttr']][0])) {
......@@ -447,7 +447,7 @@ class setupStepMigrate extends setupStep
$this->rootOC_details['target'] = $str;
$this->rootOC_details['mods'] = $mods;
/* Add button that allows to open the migration details */
/* Add button that allows to open the migration details */
throw new CheckFailedException(
_('Failed'),
' '.$checkobj->submit()
......@@ -460,6 +460,8 @@ class setupStepMigrate extends setupStep
function check_baseOC_migrate (&$checkobj)
{
/* Refresh $this->rootOC_details */
$checkobj->run();
$this->openDialog(new StepMigrateDialog($checkobj, 'setup_migrate_baseOC.tpl', $this->rootOC_details));
}
......@@ -894,16 +896,15 @@ class setupStepMigrate extends setupStep
}
/* Creating user */
$infos = $checkobj->getInfos();
$tabObject = objects::create('user');
$baseObject = $tabObject->getBaseObject();
$baseObject->givenName = 'System';
$baseObject->sn = 'Administrator';
$baseObject->uid = $infos['uid'];
$baseObject->uid = $_POST['uid'];
$baseObject->userPassword = [
'',
$infos['password'],
$infos['password2'],
$_POST['userPassword_password'],
$_POST['userPassword_password2'],
'',
FALSE
];
......
Supports Markdown
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