diff --git a/.htaccess b/.htaccess index e0be5de..994e4e0 100644 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,2 @@ RewriteEngine on -RewriteRule ^assets - [L] -RewriteRule ^.well-known - [L] -RewriteRule . index.php +RewriteRule "!\.(js|ico|ICO|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG|css|woff|woff2|ttf|wav|ogg|mp3|svg|json)$" index.php diff --git a/adapters/AdapterInterface.php b/adapters/AdapterInterface.php index eb3ec75..f778fcc 100644 --- a/adapters/AdapterInterface.php +++ b/adapters/AdapterInterface.php @@ -38,12 +38,6 @@ namespace adapters; */ public static function meta_uid(): string; - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool; - /** * Name of the adapter. * It should probably be the name of the service it adapt (e.g : Gammu SMSD, OVH SMS, SIM800L, etc.). diff --git a/adapters/BenchmarkAdapter.php b/adapters/BenchmarkAdapter.php index 866d9bd..43ea3dc 100644 --- a/adapters/BenchmarkAdapter.php +++ b/adapters/BenchmarkAdapter.php @@ -56,15 +56,6 @@ namespace adapters; { return 'benchmark_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/adapters/GammuAdapter.php b/adapters/GammuAdapter.php index f4512a1..d6fec3d 100644 --- a/adapters/GammuAdapter.php +++ b/adapters/GammuAdapter.php @@ -51,16 +51,6 @@ namespace adapters; { return 'gammu_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } - /** * Name of the adapter. diff --git a/adapters/OctopushShortcodeAdapter.php b/adapters/OctopushShortcodeAdapter.php index a93f34e..4123bc2 100644 --- a/adapters/OctopushShortcodeAdapter.php +++ b/adapters/OctopushShortcodeAdapter.php @@ -77,15 +77,6 @@ class OctopushShortcodeAdapter implements AdapterInterface { return 'octopush_shortcode_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. @@ -402,7 +393,7 @@ class OctopushShortcodeAdapter implements AdapterInterface $response = [ 'error' => false, 'error_message' => null, - 'sms' => null, + 'uid' => null, ]; header('Connection: close'); diff --git a/adapters/OctopushVirtualNumberAdapter.php b/adapters/OctopushVirtualNumberAdapter.php index 1525179..830e26b 100644 --- a/adapters/OctopushVirtualNumberAdapter.php +++ b/adapters/OctopushVirtualNumberAdapter.php @@ -83,15 +83,6 @@ class OctopushVirtualNumberAdapter implements AdapterInterface { return 'octopush_virtual_number_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/adapters/OvhSmsShortcodeAdapter.php b/adapters/OvhSmsShortcodeAdapter.php index f68c9d4..5deeda8 100644 --- a/adapters/OvhSmsShortcodeAdapter.php +++ b/adapters/OvhSmsShortcodeAdapter.php @@ -62,15 +62,6 @@ namespace adapters; { return 'ovh_sms_shortcode_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/adapters/OvhSmsVirtualNumberAdapter.php b/adapters/OvhSmsVirtualNumberAdapter.php index 00d3f86..3e7d3c9 100644 --- a/adapters/OvhSmsVirtualNumberAdapter.php +++ b/adapters/OvhSmsVirtualNumberAdapter.php @@ -74,15 +74,6 @@ namespace adapters; { return 'ovh_sms_virtual_number_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/adapters/TestAdapter.php b/adapters/TestAdapter.php index 99759fb..6586bd6 100644 --- a/adapters/TestAdapter.php +++ b/adapters/TestAdapter.php @@ -61,15 +61,6 @@ namespace adapters; { return 'test_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/adapters/TwilioVirtualNumberAdapter.php b/adapters/TwilioVirtualNumberAdapter.php index 3a78dd8..58e12e8 100644 --- a/adapters/TwilioVirtualNumberAdapter.php +++ b/adapters/TwilioVirtualNumberAdapter.php @@ -73,15 +73,6 @@ class TwilioVirtualNumberAdapter implements AdapterInterface { return 'twilio_virtual_number_adapter'; } - - /** - * Should this adapter be hidden in user interface for phone creation and - * available to creation through API only - */ - public static function meta_hidden(): bool - { - return false; - } /** * Name of the adapter. diff --git a/controllers/publics/Phone.php b/controllers/publics/Phone.php index a1349fe..60e71ab 100644 --- a/controllers/publics/Phone.php +++ b/controllers/publics/Phone.php @@ -209,13 +209,6 @@ class Phone extends \descartes\Controller return $this->redirect(\descartes\Router::url('Phone', 'add')); } - if ($find_adapter['meta_hidden']) - { - \FlashMessage\FlashMessage::push('danger', 'Ce type de téléphone ne peux pas être créé via l\'interface graphique.'); - - return $this->redirect(\descartes\Router::url('Phone', 'add')); - } - //If missing required data fields, error foreach ($find_adapter['meta_data_fields'] as $field) { diff --git a/templates/phone/add.php b/templates/phone/add.php index aad0103..74f52b2 100644 --- a/templates/phone/add.php +++ b/templates/phone/add.php @@ -54,16 +54,14 @@