From 06341bc43145b46d6c307d8f58698d19f43a348e Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Thu, 21 Jan 2010 14:29:56 -0500 Subject: [PATCH] Added a new user id session CT#191 --- tests/load_global.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 tests/load_global.php diff --git a/tests/load_global.php b/tests/load_global.php old mode 100644 new mode 100755 index 06d6364072..8cae52bdfc --- a/tests/load_global.php +++ b/tests/load_global.php @@ -9,10 +9,11 @@ $rs = Database::query($sql, __FILE__, __LINE__); $row = Database::fetch_row($rs); if (empty($row[0])) { - // create a course + + // create a course $course_datos = array( - 'wanted_code'=> 'COURSEX', - 'title'=>'COURSEX', + 'wanted_code'=> $cidReq, + 'title'=>$cidReq, 'tutor_name'=>'John Doe', 'category_code'=>'LANG', 'course_language'=>'spanish', @@ -35,6 +36,7 @@ WHERE course.code = '$cidReq'"; $result = Database::query($sql,__FILE__,__LINE__); + //create the session if (Database::num_rows($result)>0) { $cData = Database::fetch_array($result); @@ -44,7 +46,7 @@ $_course['name' ] = $cData['title' ]; $_course['official_code'] = $cData['visual_code' ]; // use in echo $_course['sysCode' ] = $cData['code' ]; // use as key in db - $_course['path' ] = $cData['directory' ]; // use as key in path + $_course['path' ] = $cData['directory']; // use as key in path $_course['dbName' ] = $cData['db_name' ]; // use as key in db list $_course['dbNameGlu' ] = $_configuration['table_prefix'] . $cData['db_name'] . $_configuration['db_glue']; // use in all queries $_course['titular' ] = $cData['tutor_name' ]; @@ -62,6 +64,7 @@ } $_SESSION['_user']['user_id'] = 1; + $_user['user_id'] = $_SESSION['_user']['user_id']; $_SESSION['is_courseAdmin'] = 1; ?>