Explorar o código

[svn r13855] fix a bug when logging to a protected course (FS#2085)

Eric Marguin %!s(int64=17) %!d(string=hai) anos
pai
achega
0a06d512ec
Modificáronse 1 ficheiros con 1 adicións e 10 borrados
  1. 1 10
      main/inc/lib/main_api.lib.php

+ 1 - 10
main/inc/lib/main_api.lib.php

@@ -607,13 +607,6 @@ function api_sql_query($query, $file = '', $line = 0)
 
 	if ($line && !$result)
 	{
-		if (api_get_setting('server_type') !== 'test')
-		{
-			@ mysql_close();
-			die('SQL error in file <b>'.$file.'</b> at line <b>'.$line.'</b>');
-		}
-		else
-		{
 			$info = '<pre>';
 			$info .= '<b>MYSQL ERROR :</b><br/> ';
 			$info .= mysql_error();
@@ -629,7 +622,6 @@ function api_sql_query($query, $file = '', $line = 0)
 			$info .= '</pre>';
 			@ mysql_close();
 			die($info);
-		}
 	}
 	return $result;
 }
@@ -1588,8 +1580,7 @@ function api_not_allowed($print_headers = false)
 	}
 	elseif(!empty($_SERVER['REQUEST_URI']) && !empty($_GET['cidReq'])){
 		//only display form and return to the previous URL if there was a course ID included
-		include_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
-		$form = new FormValidator('formLogin');
+		include_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');$form = new FormValidator('formLogin','post',api_get_self().'?'.$_SERVER['QUERY_STRING']);
 		$form->addElement('static',null,null,'Username');
 		$form->addElement('text','login','',array('size'=>15));
 		$form->addElement('static',null,null,'Password');