Compare commits
3 Commits
c713a4419a
...
61ba62ac86
Author | SHA1 | Date |
---|---|---|
osaajani | 61ba62ac86 | |
osaajani | 05cb62a503 | |
osaajani | c0c79781bf |
|
@ -1,2 +1,4 @@
|
|||
RewriteEngine on
|
||||
RewriteRule "!\.(js|ico|ICO|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG|css|woff|woff2|ttf|wav|ogg|mp3|svg|json)$" index.php
|
||||
RewriteRule ^assets - [L]
|
||||
RewriteRule ^.well-known - [L]
|
||||
RewriteRule . index.php
|
||||
|
|
|
@ -38,6 +38,12 @@ 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.).
|
||||
|
|
|
@ -56,6 +56,15 @@ 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.
|
||||
|
|
|
@ -51,6 +51,16 @@ 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.
|
||||
|
|
|
@ -77,6 +77,15 @@ 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.
|
||||
|
@ -393,7 +402,7 @@ class OctopushShortcodeAdapter implements AdapterInterface
|
|||
$response = [
|
||||
'error' => false,
|
||||
'error_message' => null,
|
||||
'uid' => null,
|
||||
'sms' => null,
|
||||
];
|
||||
|
||||
header('Connection: close');
|
||||
|
|
|
@ -83,6 +83,15 @@ 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.
|
||||
|
|
|
@ -62,6 +62,15 @@ 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.
|
||||
|
|
|
@ -74,6 +74,15 @@ 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.
|
||||
|
|
|
@ -61,6 +61,15 @@ 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.
|
||||
|
|
|
@ -73,6 +73,15 @@ 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.
|
||||
|
|
|
@ -209,6 +209,13 @@ 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)
|
||||
{
|
||||
|
|
|
@ -54,14 +54,16 @@
|
|||
</p>
|
||||
<select name="adapter" class="form-control" id="adapter-select">
|
||||
<?php foreach ($adapters as $adapter) { ?>
|
||||
<option
|
||||
value="<?= $adapter['meta_classname'] ?>"
|
||||
data-description="<?php $this->s($adapter['meta_description']); ?>"
|
||||
data-data-fields="<?php $this->s(json_encode($adapter['meta_data_fields'])); ?>"
|
||||
<?= ($_SESSION['previous_http_post']['adapter'] ?? '') == $adapter['meta_classname'] ? 'selected' : '' ?>
|
||||
>
|
||||
<?php $this->s($adapter['meta_name']); ?>
|
||||
</option>
|
||||
<?php if ($adapter['meta_hidden'] === false) { ?>
|
||||
<option
|
||||
value="<?= $adapter['meta_classname'] ?>"
|
||||
data-description="<?php $this->s($adapter['meta_description']); ?>"
|
||||
data-data-fields="<?php $this->s(json_encode($adapter['meta_data_fields'])); ?>"
|
||||
<?= ($_SESSION['previous_http_post']['adapter'] ?? '') == $adapter['meta_classname'] ? 'selected' : '' ?>
|
||||
>
|
||||
<?php $this->s($adapter['meta_name']); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue