2008-11-07 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Style corrections ins give_acl(). Show nothing on sql_error_handler based on error_reporting() level. * ChangeLog: Fixed my previous commit date. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1223 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cb4457ccf0
commit
0ababc37d4
|
@ -1,3 +1,10 @@
|
|||
2008-11-07 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* include/functions_db.php: Style corrections ins give_acl(). Show
|
||||
nothing on sql_error_handler based on error_reporting() level.
|
||||
|
||||
* ChangeLog: Fixed my previous commit date.
|
||||
|
||||
2008-11-06 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||
|
||||
* operation/snmpconsole/snmp_View.php: Added a span with title over the
|
||||
|
@ -16,7 +23,7 @@
|
|||
godmode/agentes/configurar_agente.php: Renamed functions
|
||||
|
||||
|
||||
2009-11-05 Esteban Sanchez <estebans@artica.es>
|
||||
2008-11-05 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* include/functions_db.php: Added sql_error_handler() to show SQL
|
||||
errors. Improved SQL error messages in process_sql() so it shows now
|
||||
|
|
|
@ -83,7 +83,7 @@ function give_acl ($id_user, $id_group, $access) {
|
|||
AND tusuario_perfil.id_usuario = '%s' AND (tusuario_perfil.id_grupo = %d OR tusuario_perfil.id_grupo= 1)", $id_user, $id_group);
|
||||
}
|
||||
|
||||
$rowdup = get_db_all_rows_sql($query1);
|
||||
$rowdup = get_db_all_rows_sql ($query1);
|
||||
$result = 0;
|
||||
|
||||
if (!$rowdup)
|
||||
|
@ -1044,7 +1044,7 @@ function list_group ($id_user, $show_all = 1){
|
|||
*/
|
||||
function list_group2 ($id_user) {
|
||||
$mis_grupos = array (); // Define array mis_grupos to put here all groups with Agent Read permission
|
||||
$result = get_db_all_fields_in_table ("tgrupo", "id_grupo");
|
||||
$result = get_db_all_fields_in_table ('tgrupo', 'id_grupo');
|
||||
if (!$result)
|
||||
return $mis_grupos;
|
||||
foreach ($result as $row) {
|
||||
|
@ -1454,6 +1454,8 @@ function get_db_all_rows_sql ($sql) {
|
|||
* @param $errstr Contains the error message.
|
||||
*/
|
||||
function sql_error_handler ($errno, $errstr) {
|
||||
if (error_reporting () <= $errno)
|
||||
return false;
|
||||
echo "<strong>SQL error</strong>: ".$errstr."<br />\n";
|
||||
return true;
|
||||
}
|
||||
|
@ -1476,8 +1478,12 @@ function sql_error_handler ($errno, $errstr) {
|
|||
function process_sql ($sql, $rettype = "affected_rows") {
|
||||
global $config;
|
||||
global $sql_cache;
|
||||
|
||||
$retval = array();
|
||||
|
||||
if ($sql == '')
|
||||
return false;
|
||||
|
||||
if (! empty ($sql_cache[$sql])) {
|
||||
$retval = $sql_cache[$sql];
|
||||
$sql_cache['saved']++;
|
||||
|
@ -1557,7 +1563,6 @@ function get_db_all_rows_field_filter ($table, $field, $condition, $order_field
|
|||
*
|
||||
* @param $table Database table name.
|
||||
* @param $field Field of the table.
|
||||
* @param $condition Condition the field must have to be selected.
|
||||
*
|
||||
* @return A matrix with all the values in the table that matches the condition in the field
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue