[svn r16653] FS#2787 - Add session sql_mode = '' to mysql_connect (avoid strict SQL mode). Inseting all the code as planned.

skala
Ivan Tcholakov 18 years ago
parent 3b9a09a964
commit a6abdb402b
  1. 4
      main/inc/global.inc.php
  2. 7
      main/inc/lib/session_handler.class.php
  3. 9
      main/install/compare_db.php
  4. 3
      main/install/install_db.inc.php
  5. 7
      main/install/install_functions.inc.php
  6. 2
      main/install/update-db-1.6.x-1.8.0.inc.php
  7. 4
      main/install/update-db-1.8.0-1.8.2.inc.php
  8. 4
      main/install/update-db-1.8.2-1.8.3.inc.php
  9. 4
      main/install/update-db-1.8.3-1.8.4.inc.php
  10. 6
      main/install/update-db-1.8.4-1.8.5.inc.php
  11. 5
      main/install/update_db.inc.php

@ -146,10 +146,12 @@ if (! $_configuration['db_host'])
die($error_message_db_problem);
}
unset($error_message_db_problem);
unset($error_message_not_installed);
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
api_sql_query("set session sql_mode='';", __FILE__, __LINE__);
$selectResult = mysql_select_db($_configuration['main_database'],$dokeos_database_connection) or die ('<center>WARNING ! SYSTEM UNABLE TO SELECT THE MAIN DOKEOS DATABASE</center>');
/*

@ -1,4 +1,4 @@
<?php // $Id: session_handler.class.php 10684 2007-01-11 22:39:42Z yannoo $
<?php // $Id: session_handler.class.php 16653 2008-11-03 22:49:07Z ivantcholakov $
/*
===============================================================================
Dokeos - elearning and course management software
@ -61,6 +61,9 @@ class session_handler
if(!$this->idConnexion)
{
$this->idConnexion=@mysql_connect($this->connexion['server'],$this->connexion['login'],$this->connexion['password'],true);
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';", $this->idConnexion);
}
return $this->idConnexion?true:false;
@ -173,4 +176,4 @@ class session_handler
return false;
}
};
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: compare_db.php 10527 2006-12-19 11:01:20Z yannoo $
<?php // $Id: compare_db.php 16653 2008-11-03 22:49:07Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -50,6 +50,8 @@ $prefix_new = 'dokeos180_';
$bases_new=array($prefix_new.'dokeos_main',$prefix_new.'dokeos_stats',$prefix_new.'dokeos_user','z'.$prefix_new.'COURSE',$prefix_new.'dokeos_scorm');
$db_new = mysql_connect($sql_server_new,$sql_user_new,$sql_pass_new) or die(mysql_error());
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';", $db_new);
$sql_server_old='localhost';
$sql_user_old='root';
@ -58,6 +60,9 @@ $prefix_old = 'dokeos160_';
$bases_old=array($prefix_old.'dokeos_main',$prefix_old.'dokeos_stats',$prefix_old.'dokeos_user',$prefix_old.'COURSE',$prefix_old.'dokeos_scorm');
$db_old = mysql_connect($sql_server_old,$sql_user_old,$sql_pass_old) or die(mysql_error());
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';", $db_old);
$field_details = array(0=>'Field',1=>'Type',2=>'Null',3=>'Key',4=>'Default',5=>'Extra');
/********************************/
@ -279,4 +284,4 @@ foreach($all_db_changes as $base => $changes){
}
}
}
?>
?>

@ -69,6 +69,9 @@ if(mysql_errno() > 0)
exit();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
if($urlForm[strlen($urlForm)-1] != '/')
{
$urlForm=$urlForm.'/';

@ -271,6 +271,10 @@ function get_config_param($param,$updatePath='')
function get_config_param_from_db($host,$login,$pass,$db_name,$param='')
{
$mydb = mysql_connect($host,$login,$pass);
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$myconnect = mysql_select_db($db_name);
$sql = "SELECT * FROM settings_current WHERE variable = '$param'";
$res = mysql_query($sql);
@ -1146,6 +1150,9 @@ function test_db_connect ($dbHostForm, $dbUsernameForm, $dbPassForm, $singleDbFo
{
if(mysql_connect($dbHostForm, $dbUsernameForm, $dbPassForm) !== false)
{
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$multipleDbCheck = @mysql_query("CREATE DATABASE ".$dbPrefixForm."test_dokeos_connection");
if($multipleDbCheck !== false)
{

@ -111,6 +111,8 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$dblistres = mysql_list_dbs();
$dblist = array();

@ -111,6 +111,8 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$dblistres = mysql_list_dbs();
$dblist = array();
@ -311,4 +313,4 @@ else
{
echo 'You are not allowed here !';
}
?>
?>

@ -111,6 +111,8 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$dblistres = mysql_list_dbs();
$dblist = array();
@ -311,4 +313,4 @@ else
{
echo 'You are not allowed here !';
}
?>
?>

@ -111,6 +111,8 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$dblistres = mysql_list_dbs();
$dblist = array();
@ -371,4 +373,4 @@ else
{
echo 'You are not allowed here !';
}
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: update-db-1.8.4-1.8.5.inc.php 15952 2008-08-08 03:56:21Z yannoo $
<?php // $Id: update-db-1.8.4-1.8.5.inc.php 16653 2008-11-03 22:49:07Z ivantcholakov $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
@ -93,6 +93,8 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
$dblistres = mysql_list_dbs();
$dblist = array();
@ -379,4 +381,4 @@ else
{
echo 'You are not allowed here !';
}
?>
?>

@ -102,6 +102,9 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
exit ();
}
// The Dokeos system has not been designed to use special SQL modes that were introduced since MySQL 5
@mysql_query("set session sql_mode='';");
/*
-----------------------------------------------------------
Normal upgrade procedure:
@ -686,4 +689,4 @@ function get_forumcategory_id_by_name($forum_category_name)
//echo $row['cat_id'];
return $row['cat_id'];
}
?>
?>

Loading…
Cancel
Save