Browse Source

Fix installation process.

Julio Montoya 10 years ago
parent
commit
1ca49ab0c2
3 changed files with 12 additions and 21 deletions
  1. 1 10
      main/install/configuration.dist.php
  2. 9 6
      main/install/index.php
  3. 2 5
      main/install/install.lib.php

+ 1 - 10
main/install/configuration.dist.php

@@ -34,15 +34,6 @@ $_configuration['db_user'] = '{DATABASE_USER}';
 $_configuration['db_password'] = '{DATABASE_PASSWORD}';
 // main Chamilo database
 $_configuration['main_database'] = '{DATABASE_MAIN}';
-
-// Persistent connections may have profound effects (not always positive) on
-// your database server. Use with care.
-//$_configuration['db_persistent_connection'] = false;
-// For separate web and DB servers, reduce the bandwidth used by compressing
-// data returning from the DB server. By default, it is ignored. Uncomment
-// the following to enable compression.
-//$_configuration['db_client_flags'] = MYSQL_CLIENT_COMPRESS;
-
 // Enable access to database management for platform admins.
 $_configuration['db_manager_enabled'] = false;
 
@@ -303,7 +294,7 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
 // Limit for the Session Admin role. The administration page show only
 // User block -> Add user
 // Course Sessions block -> Training session list
-$_configuration['limit_session_admin_role'] = false;
+//$_configuration['limit_session_admin_role'] = false;
 // Show session description
 //$_configuration['show_session_description'] = false;
 

+ 9 - 6
main/install/index.php

@@ -122,6 +122,7 @@ require_once __DIR__.'/version.php';
 if (isAlreadyInstalledSystem()) {
 	// The system has already been installed, so block re-installation.
 	$global_error_code = 6;
+	// @todo uncomment this.
 	/*require '../inc/global_error_message.inc.php';
 	die();*/
 }
@@ -652,9 +653,9 @@ if (@$_POST['step2']) {
 
 				// Migrate using the file Version110.php
 				migrate('110', 1, $dbNameForm, $dbUsernameForm, $dbPassForm, $dbHostForm);
-                //include 'update-files-1.9.0-1.10.0.inc.php';
+                include 'update-files-1.9.0-1.10.0.inc.php';
                 // Only updates the configuration.inc.php with the new version
-                //include 'update-configuration.inc.php';
+                include 'update-configuration.inc.php';
                 break;
             default:
                 break;
@@ -727,12 +728,14 @@ if (@$_POST['step2']) {
 		(2, 'Anonymous', 'Joe', '', '', 'platform', 'anonymous@localhost', 6, 'anonymous', NULL, 1, NOW(), NULL, 1,NULL,'$languageForm')";
 		Database::query($sql);
 
+		$sql = "INSERT INTO admin VALUES(1, 1)";
+		Database::query($sql);
+
 		// The chosen during the installation platform language should be enabled.
 		$sql = "UPDATE language SET available=1 WHERE dokeos_folder = '$languageForm'";
 		Database::query($sql);
 
 		// Install settings
-
 		installSettings(
 			$institutionForm,
 			$institutionUrlForm,
@@ -746,13 +749,13 @@ if (@$_POST['step2']) {
 		);
 
 		lockSettings();
-
 		update_dir_and_files_permissions();
 
-
+		include 'install_files.inc.php';
 	}
     display_after_install_message($installType);
-    //Hide the "please wait" message sent previously
+
+    // Hide the "please wait" message sent previously
     echo '<script>$(\'#pleasewait\').hide(\'fast\');</script>';
 
 } elseif (@$_POST['step1'] || $badUpdatePath) {

+ 2 - 5
main/install/install.lib.php

@@ -1865,9 +1865,7 @@ function installSettings(
     $allowTeacherSelfRegistration
 ) {
     $sql = "
-        INSERT INTO settings_current
-        (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
-        VALUES
+        INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES
         ('Institution',NULL,'textfield','Platform','$organizationName','InstitutionTitle','InstitutionComment','platform',NULL, 1),
         ('InstitutionUrl',NULL,'textfield','Platform','$organizationUrl','InstitutionUrlTitle','InstitutionUrlComment',NULL,NULL, 1),
         ('siteName',NULL,'textfield','Platform','$campusName','SiteNameTitle','SiteNameComment',NULL,NULL, 1),
@@ -2167,8 +2165,7 @@ function installSettings(
         ('prevent_session_admins_to_manage_all_users', NULL, 'radio', 'Session', 'false', 'PreventSessionAdminsToManageAllUsersTitle', 'PreventSessionAdminsToManageAllUsersComment', NULL, NULL, 1),
         ('documents_default_visibility_defined_in_course', NULL,'radio','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1),
         ('enabled_mathjax', NULL, 'radio', 'Editor', 'false', 'EnableMathJaxTitle', 'EnableMathJaxComment', NULL, NULL, 0),
-        ('chamilo_database_version', NULL, 'textfield',NULL, '0', 'DatabaseVersion','', NULL, NULL, 0);
-    ";
+        ('chamilo_database_version', NULL, 'textfield',NULL, '0', 'DatabaseVersion','', NULL, NULL, 0);";
     Database::query($sql);
 
     $sql = "INSERT INTO settings_options (variable, value, display_text) VALUES