Merge pull request #2825 from fentman/patch-1
Provide NotFound and Error return values
This commit is contained in:
commit
3d1c0752d3
@ -32,7 +32,8 @@
|
||||
include '../master.inc.php';
|
||||
|
||||
$phone = GETPOST('phone');
|
||||
|
||||
$notfound = "Not found";
|
||||
$error = "Error"
|
||||
|
||||
// Security check
|
||||
if (empty($conf->clicktodial->enabled)) {
|
||||
@ -64,13 +65,15 @@ if ($resql)
|
||||
if ($obj)
|
||||
{
|
||||
$found = $obj->name;
|
||||
} else {
|
||||
$found = $notfound;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'Error');
|
||||
$found = $error;
|
||||
}
|
||||
|
||||
echo $found;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user