diff --git a/main/auth/lost_password.lib.php b/main/auth/lost_password.lib.php old mode 100644 new mode 100755 index 9cf7934b1b..8b52d2df5b --- a/main/auth/lost_password.lib.php +++ b/main/auth/lost_password.lib.php @@ -190,7 +190,7 @@ function reset_password($secret, $id, $by_username = false) { $tbl_user = Database::get_main_table(TABLE_MAIN_USER); $id = intval($id); $sql = "SELECT user_id AS uid, lastname AS lastName, firstname AS firstName, username AS loginName, password, email FROM ".$tbl_user." WHERE user_id=$id"; - $result = Database::query($sql,__FILE__,__LINE__); + $result = Database::query($sql); $num_rows = Database::num_rows($result); if ($result && $num_rows > 0) { @@ -204,7 +204,7 @@ function reset_password($secret, $id, $by_username = false) { $crypted = $user['password']; $crypted = api_get_encrypted_password($crypted); $sql = "UPDATE ".$tbl_user." SET password='$crypted' WHERE user_id=$id"; - $result = Database::query($sql, __FILE__, __LINE__); + $result = Database::query($sql); return send_password_to_user($user, $by_username); } else { return 'Not allowed.'; // TODO: This message has to be translated. diff --git a/main/calendar/allagendas.php b/main/calendar/allagendas.php index 8b7f92e75a..cf32a6660b 100755 --- a/main/calendar/allagendas.php +++ b/main/calendar/allagendas.php @@ -157,7 +157,7 @@ function get_agenda_items_by_course_list($course_list, $month, $year, $session_i AND item_property.visibility='1' $session_condition GROUP BY agenda.id ORDER BY start_date "; - $result = Database::query($sqlquery, __FILE__, __LINE__); + $result = Database::query($sqlquery); while ($item = Database::fetch_array($result,'ASSOC')) { //var_dump($item); //taking the day diff --git a/main/gradebook/lib/gradebook_functions.inc.php b/main/gradebook/lib/gradebook_functions.inc.php index 3dfa727e25..1852a77e8d 100755 --- a/main/gradebook/lib/gradebook_functions.inc.php +++ b/main/gradebook/lib/gradebook_functions.inc.php @@ -400,7 +400,7 @@ function parse_xml_data($file) { if (!UserManager::is_user_certified($cat_id,$user_id)) { $sql='UPDATE '.$table_certificate.' SET path_certificate="'.Database::escape_string($path_certificate).'" WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'" '; - $rs=Database::query($sql,__FILE__,__LINE__); + $rs=Database::query($sql); } } @@ -416,7 +416,7 @@ function parse_xml_data($file) { $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); $sql_exist='SELECT COUNT(*) as count FROM '.$table_certificate.' gc WHERE gc.cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'" '; - $rs_exist=Database::query($sql_exist,__FILE__,__LINE__); + $rs_exist=Database::query($sql_exist); $row=Database::fetch_array($rs_exist); if ($row['count']==0) { $sql='INSERT INTO '.$table_certificate.' (cat_id,user_id,score_certificate,created_at) @@ -434,7 +434,7 @@ function parse_xml_data($file) { function get_certificate_date_by_user_id ($cat_id,$user_id) { $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); $sql_get_date='SELECT created_at FROM '.$table_certificate.' WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'"'; - $rs_get_date=Database::query($sql_get_date,__FILE__,__LINE__); + $rs_get_date=Database::query($sql_get_date); $row_get_date=Database::fetch_array($rs_get_date,'ASSOC'); return $row_get_date['created_at']; } @@ -453,7 +453,7 @@ function parse_xml_data($file) { $sql.=' WHERE cat_id='.Database::escape_string($cat_id); } $sql.=' ORDER BY u.firstname'; - $rs=Database::query($sql,__FILE__,__LINE__); + $rs=Database::query($sql); $list_users=array(); while ($row=Database::fetch_array($rs)) { $list_users[]=$row; @@ -475,7 +475,7 @@ function parse_xml_data($file) { $sql.=' AND cat_id='.Database::escape_string($cat_id); } - $rs = Database::query($sql,__FILE__,__LINE__); + $rs = Database::query($sql); $list_certificate=array(); while ($row=Database::fetch_array($rs)) { $list_certificate[]=$row; @@ -492,7 +492,7 @@ function parse_xml_data($file) { $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); $sql_verified='SELECT count(*) AS count,path_certificate as path,user_id FROM '.$table_certificate.' gc WHERE cat_id="'.Database::escape_string($cat_id).'" AND user_id="'.Database::escape_string($user_id).'" GROUP BY user_id,cat_id'; - $rs_verified=Database::query($sql_verified,__FILE__,__LINE__); + $rs_verified=Database::query($sql_verified); $path=Database::result($rs_verified,0,'path'); $user_id=Database::result($rs_verified,0,'user_id'); if (!is_null($path) || $path!='' || strlen($path)) { @@ -508,7 +508,7 @@ function parse_xml_data($file) { } if (Database::result($rs_verified,0,'count')==1 && $delete_db===true) { $sql_delete='DELETE FROM '.$table_certificate.' WHERE cat_id="'.Database::escape_string($cat_id).'" AND user_id="'.Database::escape_string($user_id).'" '; - $rs_delete=Database::query($sql_delete,__FILE__,__LINE__); + $rs_delete=Database::query($sql_delete); return true; } else { return false; @@ -516,7 +516,7 @@ function parse_xml_data($file) { } else { //path is not generate delete only the DB record $sql_delete='DELETE FROM '.$table_certificate.' WHERE cat_id="'.Database::escape_string($cat_id).'" AND user_id="'.Database::escape_string($user_id).'" '; - $rs_delete=Database::query($sql_delete,__FILE__,__LINE__); + $rs_delete=Database::query($sql_delete); return true; } } \ No newline at end of file diff --git a/main/survey/fillsurvey.php b/main/survey/fillsurvey.php index c7b13b728c..485ecb6b82 100755 --- a/main/survey/fillsurvey.php +++ b/main/survey/fillsurvey.php @@ -92,7 +92,7 @@ if ($invitationcode == 'auto' && isset($_GET['scode'])){ // Now we check if the invitationcode is valid $sql = "SELECT * FROM $table_survey_invitation WHERE invitation_code = '" . Database :: escape_string($invitationcode) . "'"; -$result = Database::query($sql, __FILE__, false); // false = suppress errors +$result = Database::query($sql); // false = suppress errors if (Database::num_rows($result) < 1) { Display :: display_error_message(get_lang('WrongInvitationCode'), false); Display :: display_footer();