diff --git a/include/database/MssqlManager.php b/include/database/MssqlManager.php index adae1127..0e6796c7 100755 --- a/include/database/MssqlManager.php +++ b/include/database/MssqlManager.php @@ -182,10 +182,6 @@ class MssqlManager extends DBManager } } - if($this->checkError('Could Not Connect:', $dieOnError)) - $GLOBALS['log']->info("connected to db"); - - $GLOBALS['log']->info("Connect:".$this->database); } /** @@ -218,7 +214,6 @@ class MssqlManager extends DBManager if (empty($app_strings) or !isset($app_strings['ERR_MSSQL_DB_CONTEXT'])) { //ignore the message from sql-server if $app_strings array is empty. This will happen //only if connection if made before languge is set. - $GLOBALS['log']->debug("Ignoring this database message: " . $sqlmsg); $sqlmsg = ''; } else { @@ -229,7 +224,6 @@ class MssqlManager extends DBManager } if ( strlen($sqlmsg) > 2 ) { - $GLOBALS['log']->fatal("SQL Server error: " . $sqlmsg); return true; } @@ -246,12 +240,8 @@ class MssqlManager extends DBManager $suppress = false ) { - // Flag if there are odd number of single quotes - if ((substr_count($sql, "'") & 1)) - $GLOBALS['log']->error("SQL statement[" . $sql . "] has odd number of single quotes."); $this->countQuery($sql); - $GLOBALS['log']->info('Query:' . $sql); $this->checkConnection(); $this->query_time = microtime(true); @@ -268,7 +258,6 @@ class MssqlManager extends DBManager $this->lastmysqlrow = -1; $this->query_time = microtime(true) - $this->query_time; - $GLOBALS['log']->info('Query Execution Time:'.$this->query_time); $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); @@ -295,8 +284,6 @@ class MssqlManager extends DBManager if ($start < 0) $start=0; - $GLOBALS['log']->debug(print_r(func_get_args(),true)); - $this->lastsql = $sql; //change the casing to lower for easier string comparison, and trim whitespaces @@ -392,7 +379,6 @@ class MssqlManager extends DBManager else { if ($start < 0) $start = 0; - $GLOBALS['log']->debug(print_r(func_get_args(),true)); $this->lastsql = $sql; $matches = array(); preg_match('/^(.*SELECT )(.*?FROM.*WHERE)(.*)$/isU',$sql, $matches); @@ -547,8 +533,6 @@ class MssqlManager extends DBManager } } } - - $GLOBALS['log']->debug('Limit Query: ' . $newSQL); $result = $this->query($newSQL, $dieOnError, $msg); $this->dump_slow_queries($newSQL); return $result; @@ -779,13 +763,11 @@ class MssqlManager extends DBManager return $col_name; } //break out of here, log this - $GLOBALS['log']->debug("No match was found for order by, pass string back untouched as: $orig_order_match"); return $orig_order_match; } else { //if found, then parse and return //grab string up to the aliased column - $GLOBALS['log']->debug("order by found, process sql string"); $psql = (trim($this->getAliasFromSQL($sql, $orderMatch ))); if (empty($psql)) @@ -810,7 +792,6 @@ class MssqlManager extends DBManager $col_name = $col_name. " ". $asc_desc; //pass in new order by - $GLOBALS['log']->debug("order by being returned is " . $col_name); return $col_name; } } @@ -829,7 +810,6 @@ class MssqlManager extends DBManager { global $beanList, $beanFiles; - $GLOBALS['log']->debug("Module being processed is " . $module_str); //get the right module files //the module string exists in bean list, then process bean for correct table name //note that we exempt the reports module from this, as queries from reporting module should be parsed for @@ -847,14 +827,12 @@ class MssqlManager extends DBManager $tbl_name = trim($tbl_name); if(empty($tbl_name)){ - $GLOBALS['log']->debug("Could not find table name for module $module_str. "); $tbl_name = $module_str; } } else { //since the module does NOT exist in beanlist, then we have to parse the string //and grab the table name from the passed in sql - $GLOBALS['log']->debug("Could not find table name from module in request, retrieve from passed in sql"); $tbl_name = $module_str; $sql = strtolower($sql); @@ -873,7 +851,6 @@ class MssqlManager extends DBManager if ($next_space > 0) { $tbl_name= substr($tableEnd,0, $next_space); if(empty($tbl_name)){ - $GLOBALS['log']->debug("Could not find table name sql either, return $module_str. "); $tbl_name = $module_str; } } @@ -911,7 +888,6 @@ class MssqlManager extends DBManager } } //return table name - $GLOBALS['log']->debug("Table name for module $module_str is: ".$tbl_name); return $tbl_name; } @@ -1066,7 +1042,6 @@ class MssqlManager extends DBManager $tableName ) { - $GLOBALS['log']->info("tableExists: $tableName"); $this->checkConnection(); $result = $this->query( @@ -1135,7 +1110,6 @@ class MssqlManager extends DBManager */ public function getTablesArray() { - $GLOBALS['log']->debug('MSSQL fetching table list'); if($this->getDatabase()) { $tables = array(); @@ -1159,7 +1133,6 @@ class MssqlManager extends DBManager */ public function wakeupFTS() { - $GLOBALS['log']->debug('MSSQL about to wakeup FTS'); if($this->getDatabase()) { //create wakup catalog diff --git a/include/database/MysqlManager.php b/include/database/MysqlManager.php index d6b9f106..0cc79ce5 100755 --- a/include/database/MysqlManager.php +++ b/include/database/MysqlManager.php @@ -120,13 +120,10 @@ class MysqlManager extends DBManager if (mysql_errno($this->getDatabase())) { if ($this->dieOnError || $dieOnError){ - $GLOBALS['log']->fatal("MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database)); sugar_die ($msg."MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database)); } else { $this->last_error = $msg."MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database); - $GLOBALS['log']->error("MySQL error ".mysql_errno($this->database).": ".mysql_error($this->database)); - } return true; } @@ -152,7 +149,6 @@ class MysqlManager extends DBManager ) { parent::countQuery($sql); - $GLOBALS['log']->info('Query:' . $sql); $this->checkConnection(); //$this->freeResult(); $this->query_time = microtime(true); @@ -165,8 +161,6 @@ class MysqlManager extends DBManager $this->lastmysqlrow = -1; $this->query_time = microtime(true) - $this->query_time; - $GLOBALS['log']->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); if($autofree) @@ -187,7 +181,6 @@ class MysqlManager extends DBManager { if ($start < 0) $start = 0; - $GLOBALS['log']->debug('Limit Query:' . $sql. ' Start: ' .$start . ' count: ' . $count); $sql = "$sql LIMIT $start,$count"; $this->lastsql = $sql; @@ -225,20 +218,7 @@ class MysqlManager extends DBManager if ( empty($badQuery) ) return true; - - foreach($badQuery as $table=>$data ){ - if(!empty($data)){ - $warning = ' Table:' . $table . ' Data:' . $data; - if(!empty($GLOBALS['sugar_config']['check_query_log'])){ - $GLOBALS['log']->fatal($sql); - $GLOBALS['log']->fatal('CHECK QUERY:' .$warning); - } - else{ - $GLOBALS['log']->warn('CHECK QUERY:' .$warning); - } - } - } - + return false; } @@ -331,7 +311,6 @@ class MysqlManager extends DBManager public function getTablesArray() { global $sugar_config; - $GLOBALS['log']->debug('Fetching table list'); if ($this->getDatabase()) { $tables = array(); @@ -363,7 +342,6 @@ class MysqlManager extends DBManager $tableName ) { - $GLOBALS['log']->info("tableExists: $tableName"); if ($this->getDatabase()) { $result = $this->query("SHOW TABLES LIKE '".$tableName."'"); @@ -441,10 +419,6 @@ class MysqlManager extends DBManager mysql_query($charset, $this->database); // no quotes around "[charset]" mysql_query("SET NAMES 'utf8'", $this->database); - if($this->checkError('Could Not Connect:', $dieOnError)) - $GLOBALS['log']->info("connected to db"); - - $GLOBALS['log']->info("Connect:".$this->database); } /** diff --git a/include/database/MysqliManager.php b/include/database/MysqliManager.php index 0037bc51..adc09569 100755 --- a/include/database/MysqliManager.php +++ b/include/database/MysqliManager.php @@ -123,13 +123,10 @@ class MysqliManager extends MysqlManager if (mysqli_errno($this->getDatabase())){ if($this->dieOnError || $dieOnError){ - $GLOBALS['log']->fatal("MySQL error ".mysqli_errno($this->database).": ".mysqli_error($this->database)); sugar_die ($msg."MySQL error ".mysqli_errno($this->database).": ".mysqli_error($this->database)); } else{ $this->last_error = $msg."MySQL error ".mysqli_errno($this->database).": ".mysqli_error($this->database); - $GLOBALS['log']->error("MySQL error ".mysqli_errno($this->database).": ".mysqli_error($this->database)); - } return true; } @@ -149,7 +146,6 @@ class MysqliManager extends MysqlManager { static $queryMD5 = array(); parent::countQuery($sql); - $GLOBALS['log']->info('Query:' . $sql); $this->checkConnection(); //$this->freeResult(); $this->query_time = microtime(true); @@ -166,8 +162,6 @@ class MysqliManager extends MysqlManager $this->lastmysqlrow = -1; $this->query_time = microtime(true) - $this->query_time; - $GLOBALS['log']->info('Query Execution Time:'.$this->query_time); - $this->checkError($msg.' Query Failed:' . $sql . '::', $dieOnError); if($autofree) @@ -318,9 +312,5 @@ class MysqliManager extends MysqlManager mysqli_query($this->database,"SET CHARACTER SET utf8"); // no quotes around "[charset]" mysqli_query($this->database,"SET NAMES 'utf8'"); - if($this->checkError('Could Not Connect:', $dieOnError)) - $GLOBALS['log']->info("connected to db"); } } - -?> diff --git a/include/utils.php b/include/utils.php index 412a00ab..a8c31356 100644 --- a/include/utils.php +++ b/include/utils.php @@ -504,7 +504,6 @@ function get_user_array($add_blank = true, $status = "Active", $assigned_user = $query .= " OR id='$assigned_user'"; } $query = $query . ' ORDER BY user_name ASC'; - $GLOBALS['log']->debug("get_user_array query: $query"); $result = $db->query($query, true, "Error filling in user array: "); if ($add_blank == true) { @@ -623,7 +622,6 @@ function safe_map($request_var, & $focus, $always_copy = false) { */ function safe_map_named($request_var, & $focus, $member_var, $always_copy) { if (isset($_REQUEST[$request_var]) && ($always_copy || is_null($focus->$member_var))) { - $GLOBALS['log']->debug("safe map named called assigning '{$_REQUEST[$request_var]}' to $member_var"); $focus->$member_var = $_REQUEST[$request_var]; } } @@ -688,32 +686,26 @@ function return_app_list_strings_language($language) { if ($language_used != $default_language) { if (file_exists("custom/application/Ext/Language/$default_language.lang.ext.php")) { $app_list_strings = _mergeCustomAppListStrings("custom/application/Ext/Language/" . $default_language . ".lang.ext.php", $app_list_strings); - $GLOBALS['log']->info("Found extended language file: " . $default_language . ".lang.ext.php"); } if (file_exists("custom/include/language/" . $default_language . ".lang.php")) { include("custom/include/language/" . $default_language . ".lang.php"); - $GLOBALS['log']->info("Found custom language file: " . $default_language . ".lang.php"); } } if (file_exists("custom/application/Ext/Language/" . $language . ".lang.ext.php")) { $app_list_strings = _mergeCustomAppListStrings("custom/application/Ext/Language/" . $language . ".lang.ext.php", $app_list_strings); - $GLOBALS['log']->info("Found extended language file: " . $language . ".lang.ext.php"); } if (file_exists("custom/include/language/" . $language . ".lang.php")) { include("custom/include/language/" . $language . ".lang.php"); - $GLOBALS['log']->info("Found custom language file: " . $language . ".lang.php"); } if (!isset($app_list_strings)) { - $GLOBALS['log']->warn("Unable to find the application language file for language: " . $language); $language_used = $default_language; $app_list_strings = $en_app_list_strings; } if (!isset($app_list_strings)) { - $GLOBALS['log']->fatal("Unable to load the application language file for the selected language(" . $language . ") or the default language(" . $default_language . ")"); return null; } //add mz 2015-01-07 @@ -824,16 +816,13 @@ function return_application_language($language) { } if (file_exists("custom/application/Ext/Language/$language.lang.ext.php")) { include("custom/application/Ext/Language/$language.lang.ext.php"); - $GLOBALS['log']->info("Found extended language file: $language.lang.ext.php"); } if (file_exists("custom/include/language/$language.lang.php")) { include("custom/include/language/$language.lang.php"); - $GLOBALS['log']->info("Found custom language file: $language.lang.php"); } if (!isset($app_strings)) { - $GLOBALS['log']->warn("Unable to find the application language file for language: " . $language); require("include/language/$default_language.lang.php"); if (file_exists("include/language/$default_language.lang.override.php")) { include("include/language/$default_language.lang.override.php"); @@ -844,13 +833,11 @@ function return_application_language($language) { if (file_exists("custom/application/Ext/Language/$default_language.lang.ext.php")) { include("custom/application/Ext/Language/$default_language.lang.ext.php"); - $GLOBALS['log']->info("Found extended language file: $default_language.lang.ext.php"); } $language_used = $default_language; } if (!isset($app_strings)) { - $GLOBALS['log']->fatal("Unable to load the application language file for the selected language($language) or the default language($default_language)"); return null; } @@ -892,7 +879,6 @@ function return_module_language($language, $module, $refresh = false) { // Jenny - Bug 8119: Need to check if $module is not empty if (empty($module)) { $stack = debug_backtrace(); - $GLOBALS['log']->warn("Variable module is not in return_module_language " . var_export($stack, true)); return array(); } @@ -991,7 +977,6 @@ function return_mod_list_strings_language($language, $module) { // if we still don't have a language pack, then log an error if (!isset($mod_list_strings)) { - $GLOBALS['log']->fatal("Unable to load the application list language file for the selected language($language) or the default language($default_language) for module({$module})"); return null; } @@ -1022,13 +1007,11 @@ function return_theme_language($language, $theme) { include(SugarThemeRegistry::get($theme)->getFilePath() . "/language/$current_language.lang.php.override"); } if (!isset($theme_strings)) { - $GLOBALS['log']->warn("Unable to find the theme file for language: " . $language . " and theme: " . $theme); require(SugarThemeRegistry::get($theme)->getFilePath() . "/language/$default_language.lang.php"); $language_used = $default_language; } if (!isset($theme_strings)) { - $GLOBALS['log']->fatal("Unable to load the theme($theme) language file for the selected language($language) or the default language($default_language)"); return null; } @@ -1091,7 +1074,6 @@ function generate_where_statement($where_clauses) { $where .= $clause; } - $GLOBALS['log']->info("Here is the where clause for the list view: $where"); return $where; } @@ -1697,9 +1679,6 @@ function clean_string($str, $filter = "STANDARD") { ); if (preg_match($filters[$filter], $str)) { - if (isset($GLOBALS['log']) && is_object($GLOBALS['log'])) { - $GLOBALS['log']->fatal("SECURITY: bad data passed in; string: {$str}"); - } die("Bad data passed in; Return to Home"); } else { return $str; @@ -2246,7 +2225,6 @@ function get_bean_select_array($add_blank = true, $bean_name, $display_columns, $query .= ' order by ' . $order_by; } - $GLOBALS['log']->debug("get_user_array query: $query"); $result = $db->query($query, true, "Error filling in user array: "); if ($add_blank == true) { @@ -3566,7 +3544,6 @@ function getJavascriptSiteURL() { $site_url = preg_replace('/^http\:/', 'https:', $site_url); } } - $GLOBALS['log']->debug("getJavascriptSiteURL(), site_url=" . $site_url); return $site_url; } @@ -4105,7 +4082,6 @@ function verify_image_file($path, $jpeg = false) { $data = fread($fp, 4096); fclose($fp); if (preg_match("/<(html|!doctype|script|body|head|plaintext|table|img |pre(>| )|frameset|iframe|object|link|base|style|font|applet|meta|center|form|isindex)/i", $data, $m)) { - $GLOBALS['log']->info("Found {$m[0]} in $path, not allowing upload"); return false; } return true; diff --git a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/importApiloInvoices.php b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/importApiloInvoices.php index f3921a93..0e26894f 100644 --- a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/importApiloInvoices.php +++ b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/importApiloInvoices.php @@ -41,6 +41,7 @@ function importInvoices() addapiloInvoice($invoice, $platforms, $apilo_config['token']); } } + $GLOBALS['log']->info('----- Importing invoices from Apilo, all processed, return TRUE'); return true; } function loadApiloConfiguration() @@ -233,6 +234,7 @@ function addApiloInvoice($invoice, $platforms, $token) addApiloInvoiceProduct($invoice->id, $item); } } + return true; } function addApiloInvoiceProduct($invoiceId, $item) { diff --git a/modules/Schedulers/_AddJobsHere.php b/modules/Schedulers/_AddJobsHere.php index 6cc47ce1..81eae73a 100644 --- a/modules/Schedulers/_AddJobsHere.php +++ b/modules/Schedulers/_AddJobsHere.php @@ -71,11 +71,14 @@ $job_strings = array( function importApiloInvoices() { try { + $GLOBALS['log']->info('----- Importing invoices from Apilo, _addJobsHereReturn, starting'); $GLOBALS['db']->query("USE preDb_0dcc87940d3655fa574b253df04ca1c3;"); require_once('modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/importApiloInvoices.php'); - importInvoices(); + $res = importInvoices(); + $GLOBALS['log']->info('----- Importing invoices from Apilo, _addJobsHereReturn', $res); return true; } catch (Exception $e) { + $GLOBALS['log']->info('----- Importing invoices from Apilo, _addJobsHereReturn, error catched', $e); return false; } }