Fixed errors/warning due to leaved obsolete code.
[fa-stable.git] / install / index.php
index 590b5b4d0672d7a16d225f923bd8602ac6ad994f..e9e0ef59630379763a9f41588f8940940f3f7c9d 100644 (file)
@@ -127,7 +127,7 @@ function install_connect_db() {
 
 function do_install() {
 
-       global $path_to_root, $db_connections, $def_coy, $installed_extensions, 
+       global $path_to_root, $db_connections, $def_coy, $installed_extensions, $tb_pref_counter,
                $dflt_lang, $installed_languages;
 
        $coa = $_SESSION['inst_set']['coa'];
@@ -150,9 +150,10 @@ function do_install() {
                
                update_company_prefs(array('coy_name'=>$con['name']));
                $admin = get_user_by_login('admin');
-//             update_admin_password($con, md5($con['pass']));
-               update_user_prefs($admin['id'], array('language' => $_POST['lang'], 
-                       'password' => md5($con['pass'])));
+               update_user_prefs($admin['id'], array(
+                       'language' => $con['lang'], 
+                       'password' => md5($con['pass']),
+                       'user_id' => $con['admin']));
 
                if (!copy($path_to_root. "/config.default.php", $path_to_root. "/config.php")) {
                        display_error(_("Cannot save system configuration file 'config.php'."));
@@ -176,7 +177,7 @@ function do_install() {
                $dflt_lang = $_POST['lang'];
                write_lang();
                if (!isset($installed_extensions))
-                       write_extensions(array());
+                       update_extensions(array());
                return true;
        }
        return false;
@@ -386,7 +387,8 @@ start_form();
                case '6': // final screen
                        subpage_title(_('FrontAccounting ERP has been installed successsfully.'));
                        display_note(_('Please do not forget to remove install wizard folder.'));
-                       $install_done = true;
+                       session_unset();
+                       session_destroy();
                        hyperlink_no_params($path_to_root.'/index.php', _('Click here to start.'));
                        break;