From eaf0024c0f56b33754217d6ddb95ba021deefccf Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 25 Apr 2010 18:18:04 +0200 Subject: [PATCH] bugfix when filling the database in first run dialog --- inc/lib_base.php | 1 + inc/lib_config.php | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/inc/lib_base.php b/inc/lib_base.php index 5992004f53..851fc254b8 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -67,6 +67,7 @@ oc_require_once('lib_files.php'); oc_require_once('lib_log.php'); oc_require_once('lib_config.php'); oc_require_once('lib_user.php'); +oc_require_once('lib_ocs.php'); if(OC_USER::isLoggedIn()){ //jail the user in a seperate data folder diff --git a/inc/lib_config.php b/inc/lib_config.php index 130731b79f..389aeff646 100755 --- a/inc/lib_config.php +++ b/inc/lib_config.php @@ -202,9 +202,9 @@ class OC_CONFIG{ self::filldatabase(); } }catch(Exception $e){ + echo 'testin'; $error.='error while trying to fill the database
'; } - if(!OC_USER::createuser($_POST['adminlogin'],$_POST['adminpassword']) && !OC_USER::login($_POST['adminlogin'],$_POST['adminpassword'])){ $error.='error while trying to create the admin user
'; } @@ -303,7 +303,7 @@ CREATE TABLE 'users' ( ); "; }elseif($CONFIG_DBTYPE=='mysql'){ - $query="SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\"; + $query="SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; CREATE TABLE IF NOT EXISTS `locks` ( `token` varchar(255) NOT NULL DEFAULT '', @@ -351,10 +351,22 @@ UNIQUE ( ) ) ENGINE = MYISAM ; +CREATE TABLE IF NOT EXISTS `groups` ( +`group_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`group_name` VARCHAR( 64 ) NOT NULL , +UNIQUE ( +`group_name` +) +) ENGINE = MYISAM ; + +CREATE TABLE IF NOT EXISTS `user_group` ( +`user_group_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`user_id` VARCHAR( 64 ) NOT NULL , +`group_id` VARCHAR( 64 ) NOT NULL +) ENGINE = MYISAM ; "; } OC_DB::multiquery($query); - die(); } /**