Skip to content
Snippets Groups Projects
Verified Commit 43ec78e4 authored by David Beniamine's avatar David Beniamine
Browse files

Cleaner error handling

parent fe233a17
No related branches found
No related tags found
No related merge requests found
......@@ -33,17 +33,13 @@ error_reporting(E_ALL);
extract($_POST);
if(!isset($action)){
$lines=explode(PHP_EOL, shell_exec("../scripts/get_registry.sh"));
exec("../scripts/get_registry.sh", $lines, $code);
?>
<p>
<?php
$n=count($lines);
if(empty($lines)){
echo "Impossible de récupérer le registre";
ob_start();
shell_exec("../scripts/get_registry.sh");
$lines=ob_get_clean();
echo "$lines";
echo "Impossible de récupérer le registre, code $code";
}else if ($n == 1){
echo "$n poste est enregistré sur ce serveur";
}else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment