Enhance sms class
This commit is contained in:
parent
5a21d90411
commit
d1e22ae02a
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user