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';
|
include '../master.inc.php';
|
||||||
|
|
||||||
$phone = GETPOST('phone');
|
$phone = GETPOST('phone');
|
||||||
|
$notfound = "Not found";
|
||||||
|
$error = "Error"
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->clicktodial->enabled)) {
|
if (empty($conf->clicktodial->enabled)) {
|
||||||
@ -64,13 +65,15 @@ if ($resql)
|
|||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$found = $obj->name;
|
$found = $obj->name;
|
||||||
|
} else {
|
||||||
|
$found = $notfound;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db,'Error');
|
dol_print_error($db,'Error');
|
||||||
|
$found = $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $found;
|
echo $found;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user