From 8c5b65be3fe4c448d1ae09a47c020f9ecd07b11f Mon Sep 17 00:00:00 2001 From: Patrick Cool Date: Thu, 16 Nov 2006 09:01:30 +0100 Subject: [PATCH] [svn r9997] --- main/inc/banner.inc.php | 9 +++++++-- main/inc/course_document.inc.php | 20 ++++++++++---------- main/inc/global.inc.php | 24 +++++++++++++++--------- main/inc/local.inc.php | 24 ++++++++++++++++-------- 4 files changed, 48 insertions(+), 29 deletions(-) diff --git a/main/inc/banner.inc.php b/main/inc/banner.inc.php index d7f1914ff8..818987e07a 100644 --- a/main/inc/banner.inc.php +++ b/main/inc/banner.inc.php @@ -54,7 +54,9 @@ elseif (isset ($nameTools) && $langFile != 'course_home') { //Put the name of the user-tools in the header if (!isset ($_user['user_id'])) + { echo " "; + } elseif(!$noPHP_SELF) { echo "
", $nameTools, "
", "\n"; @@ -350,9 +352,12 @@ if (isset ($dokeos_database_connection))
date ("Y-m-d H:i:s", filemtime($path)), - "visibility" => 1, - "path" => $path, - "title" => basename($path), - "filetype" => filetype($path), - "size" => filesize ($path) + $file = array( + "lastedit_date" =>date ("Y-m-d H:i:s", filemtime($path)), + "visibility" => 1, + "path" => $path, + "title" => basename($path), + "filetype" => filetype($path), + "size" => filesize ($path) ); @@ -291,7 +289,9 @@ function getlist ($directory) { return $files; - } else { + } + else + { return false; } diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 50e35c2472..f0ed0f7eb4 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -93,15 +93,14 @@ if(empty($statsDbName) && $already_installed) $dokeos_database_connection = @mysql_connect($dbHost, $dbLogin, $dbPass) or die ($error_message); -if (! $dbHost) die($error_message); +if (! $dbHost) +{ + die($error_message); +} unset($error_message); -$selectResult = mysql_select_db($mainDbName,$dokeos_database_connection) - -or die ( "
" - ."WARNING ! SYSTEM UNABLE TO SELECT THE MAIN DOKEOS DATABASE" - ."
"); +$selectResult = mysql_select_db($mainDbName,$dokeos_database_connection) or die ('
WARNING ! SYSTEM UNABLE TO SELECT THE MAIN DOKEOS DATABASE
'); /* -------------------------------------------- @@ -113,9 +112,13 @@ $result=mysql_query($sql) or die(mysql_error()); while ($row=mysql_fetch_array($result)) { if ($row['subkey']==NULL) - { $_setting[$row['variable']]=$row['selected_value']; } + { + $_setting[$row['variable']]=$row['selected_value']; + } else - { $_setting[$row['variable']][$row['subkey']]=$row['selected_value']; } + { + $_setting[$row['variable']][$row['subkey']]=$row['selected_value']; + } } // we have to store the settings for the plugins differently because it expects an array $sql="SELECT * FROM settings_current WHERE category='plugins'"; @@ -141,7 +144,10 @@ require($includePath."/local.inc.php"); include_once($includePath."/lib/online.inc.php"); // check and modify the date of user in the track.e.online table -if (!$x=strpos($_SERVER['PHP_SELF'],'whoisonline.php')) { LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '',$statsDbName); } +if (!$x=strpos($_SERVER['PHP_SELF'],'whoisonline.php')) +{ + LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '',$statsDbName); +} // ===== end "who is logged in?" module section ===== diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index c7ab4e1f9e..90e17fc62d 100644 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -460,8 +460,8 @@ if (isset($cidReset) && $cidReset) // course session data refresh requested or e $_cid = $cData['code' ]; - $_course['id' ] = $cData['code' ]; //auto-assigned integer - $_course['name' ] = $cData['title' ]; + $_course['id' ] = $cData['code' ]; //auto-assigned integer + $_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 @@ -496,10 +496,13 @@ if (isset($cidReset) && $cidReset) // course session data refresh requested or e } else // continue with the previous values { - if(empty($_SESSION['_course']) OR empty($_SESSION['_cid'])){ //no previous values... + if(empty($_SESSION['_course']) OR empty($_SESSION['_cid'])) + { //no previous values... $_cid = -1; //set default values that will be caracteristic of being unset $_course = -1; - }else{ + } + else + { $_cid = $_SESSION['_cid' ]; $_course = $_SESSION['_course']; } @@ -565,7 +568,8 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) // sessi api_session_register('_courseUser'); } - else { + else + { // vérifier que c pas le coach du cours $sql = "SELECT 1 FROM `".$mainDbName."`.`session_rel_course` @@ -573,7 +577,8 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) // sessi AND session_rel_course.id_coach = '".$_user['user_id']."'"; $result = api_sql_query($sql,__FILE__,__LINE__); - if($row = mysql_fetch_array($result)){ + if($row = mysql_fetch_array($result)) + { $_courseUser['role'] = 'Professor'; $is_courseMember = true; $is_courseTutor = true; @@ -581,7 +586,8 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) // sessi api_session_register('_courseUser'); } - else { + else + { // vérifier que c pas un élève de la session $sql = "SELECT * FROM `".$mainDbName."`.`session_rel_course_rel_user` WHERE `id_user` = '".$_user['user_id']."' @@ -708,7 +714,9 @@ if ((isset($gidReset) && $gidReset) || (isset($cidReset) && $cidReset)) // sessi elseif(isset($_SESSION['_gid'])) // continue with the previous values { $_gid = $_SESSION ['_gid' ]; -}else{ //if no previous value, assign caracteristic undefined value +} +else +{ //if no previous value, assign caracteristic undefined value $_gid = -1; }