diff --git a/htdocs/lib/CSMSFile.class.php b/htdocs/lib/CSMSFile.class.php index ae74974a31c..ba87099186a 100755 --- a/htdocs/lib/CSMSFile.class.php +++ b/htdocs/lib/CSMSFile.class.php @@ -141,7 +141,9 @@ class CSMSFile } else { - dol_syslog("CSMSFile::sendfile: sms send success", LOG_DEBUG); + dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); + //var_dump($res); // 1973128 + $this->dump_sms_result($res); } } else @@ -184,6 +186,26 @@ class CSMSFile } } + /** + * Write content of a SMTP request into a dump file (mode = all) + * Used for debugging. + */ + function dump_sms_result($result) + { + global $conf,$dolibarr_main_data_root; + + if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir + { + $fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","a+"); + + fputs($fp, "\nResult id=".$result); + + fclose($fp); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); + } + } + } ?> \ No newline at end of file