1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__nextcloudconnector4do.../log.php
Daniel Tartavel 6c8c96934c first commit
Signed-off-by: Daniel Tartavel <contact@librepc.com>
2019-08-31 11:31:29 +02:00

32 lines
692 B
PHP

<?php
require_once( "entete_mail.php" );
// $level => INFO, ALERT, ERROR
function log_write($log, $level=INFO)
{
global $webmaster, $headers;
if ( $level == ALERT )
{
mail( $webmaster, "Connecteur nextcloud pour dolibarr: Alerte", $log_mail, $headers );
}elseif ( $level == ERROR )
{
mail( $webmaster, "Connecteur nextcloud pour dolibarr: Erreur", $log_mail, $headers );
}
}
// $die = true -> execute die()
function log_error($log, $die=true)
{
global $webmaster, $headers;
echo "$log<br />" . EOL;
log_write($log);
$log_err = 'erreur dans la requête' . "<br/>" . "un rapport détaillé a été envoyé au webmaster";
if ( $die )
{
echo "\n";
die( $log_err );
}
}
?>