mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Greatly improve adapters. Add twilio adapter for virtual numbers (no shortcode support before next version). Improve daemons exception + ERRORS handling. A lot of other little things
This commit is contained in:
parent
cbaa186c9e
commit
0c8fc7b3ac
17 changed files with 713 additions and 118 deletions
|
@ -171,11 +171,38 @@ class Phone extends \descartes\Controller
|
|||
return $this->redirect(\descartes\Router::url('Phone', 'add'));
|
||||
}
|
||||
|
||||
//If field phone number is invalid
|
||||
foreach ($find_adapter['meta_datas_fields'] as $field)
|
||||
{
|
||||
if (false === ($field['number'] ?? false))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($adapter_datas[$field['name']]))
|
||||
{
|
||||
$adapter_datas[$field['name']] = \controllers\internals\Tool::parse_phone($adapter_datas[$field['name']]);
|
||||
|
||||
if ($adapter_datas[$field['name']])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump($field);
|
||||
var_dump($adapter_datas[$field['name']]);
|
||||
die();
|
||||
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous avez fourni un numéro de téléphone avec un format invalide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Phone', 'add'));
|
||||
}
|
||||
|
||||
$adapter_datas = json_encode($adapter_datas);
|
||||
|
||||
//Check adapter is working correctly with thoses names and datas
|
||||
$adapter_classname = $find_adapter['meta_classname'];
|
||||
$adapter_instance = new $adapter_classname($name, $adapter_datas);
|
||||
$adapter_instance = new $adapter_classname($adapter_datas);
|
||||
$adapter_working = $adapter_instance->test();
|
||||
|
||||
if (!$adapter_working)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue