diff --git a/setup/class_setup.inc b/setup/class_setup.inc index 7e92a630c123c7480f8ab19aa2d7fa2abc9e672a..eda49fc380ffcba73d381ef459323061519d1c2b 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -1,5 +1,4 @@ <?php - /* This code is part of FusionDirectory (http://www.fusiondirectory.org/) Copyright (C) 2003 Cajus Pollmeier diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index 6756ec225b755388c81c2c4d16023e4855c2ec15..49c44180e3c3e806763f5e9b5d530d4eb2896550 100644 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -133,103 +133,4 @@ class setupStep extends simplePlugin return $ldap; } } - -class setup_step extends plugin -{ - var $s_title = "Still undefined"; - var $s_title_long = "This is a still undefined long title"; - var $s_info = "This info is still undefined. This setup step detect the type of your ldap for FusionDirectory.This is a basic requirement for fusiondirectory."; - var $is_active = FALSE; - var $is_enabled = FALSE; - var $is_completed = FALSE; - - var $header_image = ""; - - var $attributes = array(); - var $parent = NULL; - var $dialog = FALSE; - - function __construct() - { - } - - function execute() - { - } - - function save_object() - { - /* Do not call plugin::save_object. This causes acl trouble */ - } - - function get_title() - { - return $this->s_title; - } - - function get_long_title() - { - return $this->s_title_long; - } - - function get_small_info() - { - return $this->s_info; - } - - function is_active() - { - return $this->is_active; - } - - function is_enabled() - { - return $this->is_enabled; - } - - function is_completed() - { - return $this->is_completed; - } - - function set_active($value = TRUE) - { - $this->is_active = ($value == TRUE); - } - - function set_enabled($value = TRUE) - { - $this->is_enabled = ($value == TRUE); - } - - function set_completed($value = TRUE) - { - $this->is_completed = ($value == TRUE); - } - - /* Return attributes handled by this setup step */ - function get_attributes() - { - $tmp = array(); - foreach ($this->attributes as $attr) { - $tmp[$attr] = $this->$attr; - } - return $tmp; - } - - function get_ldap_link() - { - /* Establish ldap connection */ - $cv = $this->parent->captured_values; - $ldap_l = new LDAP($cv['admin'], - $cv['password'], - $cv['connection'], - FALSE, - $cv['tls']); - - $ldap = new ldapMultiplexer($ldap_l); - $ldap->cd($cv['base']); - return $ldap; - } -} ?> diff --git a/setup/class_setupStep_Finish.inc b/setup/class_setupStep_Finish.inc index 1a52e0806d755df6245e4a0ed814c1ed7bf2e418..7a4f2a8835b8d492ffb37956b4e70352fb2c3581 100644 --- a/setup/class_setupStep_Finish.inc +++ b/setup/class_setupStep_Finish.inc @@ -19,28 +19,35 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -class Step_Finish extends setup_step +class Step_Finish extends setupStep { var $header_image = 'geticon.php?context=devices&icon=server&size=48'; - function __construct() + static function getAttributesInfo() { - $this->update_strings(); + return array( + 'welcome' => array( + 'name' => _('Welcome'), + 'template' => get_template_path("setup_finish.tpl", TRUE, dirname(__FILE__)), + 'attrs' => array( + ) + ) + ); } function update_strings() { - $this->s_title = _("Finish"); - $this->s_info = _("Write configuration file"); - $this->s_title_long = _("Finish - write the configuration file"); + $this->s_title = _('Finish'); + $this->s_info = _('Write configuration file'); + $this->s_title_long = _('Finish - write the configuration file'); } function get_conf_data() { $smarty = get_smarty(); - $smarty->assign("cv", xmlentities($this->parent->captured_values)); - $smarty->assign("config_checksum", md5(file_get_contents(CONFIG_TEMPLATE_DIR.CONFIG_FILE))); - $smarty->assign("templateCompileDirectory", SPOOL_DIR); + $smarty->assign('cv', xmlentities($this->parent->captured_values)); + $smarty->assign('config_checksum', md5(file_get_contents(CONFIG_TEMPLATE_DIR.CONFIG_FILE))); + $smarty->assign('templateCompileDirectory', SPOOL_DIR); return $smarty->fetch(CONFIG_TEMPLATE_DIR.CONFIG_FILE); } @@ -74,43 +81,43 @@ class Step_Finish extends setup_step function execute() { - global $BASE_DIR; - /* Check if there is currently an active fusiondirectory.conf */ - $exists = file_exists(CONFIG_DIR."/".CONFIG_FILE); + $exists = file_exists(CONFIG_DIR."/".CONFIG_FILE); + $err_msg = ''; + + if ($exists && $this->is_world_readable(CONFIG_DIR.'/'.CONFIG_FILE)) { + $err_msg = _('Your configuration file is currently world readable. Please update the file permissions!'); + } elseif (!$exists) { + $err_msg = _('The configuration is currently not readable or it does not exists.'); + } + + $smarty = get_smarty(); + $smarty->assign('err_msg', $err_msg); + $smarty->assign('msg2', sprintf(_('After downloading and placing the file under %s, please make sure that the user the webserver is running with is able to read %s, while other users shouldn\'t.'), CONFIG_DIR, CONFIG_FILE)); + + return parent::execute(); + } + + function save_object() + { + parent::save_object(); + $exists = file_exists(CONFIG_DIR.'/'.CONFIG_FILE); /* Redirect to FusionDirectory login, if : * - fusiondirectory.conf exists * - Permisssion are set correctly */ - - if (isset($_POST['next']) && $exists && !$this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)) { + if (isset($_POST['next']) && $exists && !$this->is_world_readable(CONFIG_DIR.'/'.CONFIG_FILE)) { $this->insertConfigDefaults(); session::destroy(); - header("Location: index.php"); + header('Location: index.php'); exit(); } /* Download config */ if (isset($_POST['getconf'])) { - send_binary_content($this->get_conf_data(), CONFIG_FILE, "text/plain"); - } - - $err_msg = ""; - - if ($exists && $this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)) { - $err_msg = _("Your configuration file is currently world readable. Please update the file permissions!"); - } elseif (!$exists) { - $err_msg = _("The configuration is currently not readable or it does not exists."); + send_binary_content($this->get_conf_data(), CONFIG_FILE, 'text/plain'); } - - $smarty = get_smarty(); - $smarty->assign("err_msg", $err_msg); - $smarty->assign("msg2", sprintf(_("After downloading and placing the file under %s, please make sure that the user the webserver is running with is able to read %s, while other users shouldn't."), CONFIG_DIR, CONFIG_FILE)); - - //~ Changer ça pour du sp. - - return $smarty->fetch("$BASE_DIR/setup/setup_finish.tpl"); } /* check if given file is world readable */ @@ -121,5 +128,4 @@ class Step_Finish extends setup_step return (decbin($p & 4) == TRUE); } } - ?> diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index 74365384fabc9c0f6cd3d8bbe291e160b45fbd60..d3f8f781dae667a951f8cb6416d55c7dd4c05473 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -142,7 +142,6 @@ class StepMigrateCheck public function save_object() { - $this->is_completed = TRUE; if (isset($_POST[$this->name.'_create'])) { $fnc = $this->fnc.'_create'; $this->step->$fnc($this); @@ -309,6 +308,7 @@ class Step_Migrate extends setupStep function save_object() { + $this->is_completed = TRUE; parent::save_object(); foreach ($this->checks as &$check) { $check->save_object(); diff --git a/setup/setup_finish.tpl b/setup/setup_finish.tpl index b9fcaa5a87b1972b7864baca0d9615b94fca26f5..cd1c04c91d2204b7972d2847af3500c4c3be49c6 100644 --- a/setup/setup_finish.tpl +++ b/setup/setup_finish.tpl @@ -6,7 +6,7 @@ {$msg2} </p> <p> - {t}Run {/t}<a style="color:black ; font-weight:bold ">fusiondirectory-setup --check-config</a>{t} to put the correct right on fusiondirectory.conf{/t} + {t escape=no 1="<strong>fusiondirectory-setup --check-config</strong>"}Run %1 to put the correct right on fusiondirectory.conf{/t} </p> <p> <input type="submit" name="getconf" value="{t}Download configuration{/t}"/> @@ -15,8 +15,6 @@ <hr/> <br/> {t}Status: {/t} - <a style="color:red ; font-weight:bold ">{$err_msg}</a> + <strong>{$err_msg}</strong> {/if} - </div> -<input type="hidden" value="1" name="step8_posted"/> diff --git a/setup/setup_migrate.tpl b/setup/setup_migrate.tpl index 7846ea5f6b366b09ab3be1b2371ed297ae9eb531..fe194fdf5acf607472465baa301674e46dd63510 100644 --- a/setup/setup_migrate.tpl +++ b/setup/setup_migrate.tpl @@ -4,25 +4,24 @@ </span> <div> {foreach from=$attributes item=checks} - <p>{t}During the LDAP inspection, we're going to check for several common pitfalls that may occur when migration to FusionDirectory base LDAP administration. You may want to fix the problems below, in order to provide smooth services.{/t} </p> {foreach from=$checks item=check key=key} - <div style='width:98%; padding:4px; background-color:{cycle values="#F0F0F0, #FFF"}'> + <div style="width:98%; padding:4px; background-color:{cycle values="#F0F0F0, #FFF"}"> {if $check->error} <!-- Add ability to display info popup --> - <div class='step2_entry_container_info'> + <div class="step2_entry_container_info"> {else} <!-- Normal entry everything is fine --> - <div class='step2_entry_container'> + <div class="step2_entry_container"> {/if} - <div class='step2_entry_name'><b>{$check->title}</b></div> - <div class='step2_entry_status'> + <div class="step2_entry_name"><b>{$check->title}</b></div> + <div class="step2_entry_status"> {if $check->status} - <div class='step2_successful'>{$check->msg}</div> + <div class="step2_successful">{$check->msg}</div> {else} - <div class='step2_failed'>{$check->msg}</div> + <div class="step2_failed">{$check->msg}</div> {/if} </div> {if $check->error} @@ -31,9 +30,8 @@ </div> </div> {/foreach} - <br/> - <input type='submit' name='reload' value='{t}Check again{/t}'/> - {/foreach} + <br/> + <input type="submit" name="reload" value="{t}Check again{/t}"/> </div> </div>