Compare commits
3 Commits
296fbd61e8
...
b12738073b
Author | SHA1 | Date |
---|---|---|
osaajani | b12738073b | |
osaajani | 3f84622cbe | |
osaajani | 3b662c1153 |
|
@ -4,6 +4,7 @@
|
||||||
.credentials
|
.credentials
|
||||||
.credentials*
|
.credentials*
|
||||||
vendor/
|
vendor/
|
||||||
|
scripts/
|
||||||
composer.lock
|
composer.lock
|
||||||
env.*
|
env.*
|
||||||
phinx.*
|
phinx.*
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool;
|
public static function meta_hidden(): bool;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,14 +54,13 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the adapter.
|
* Name of the adapter.
|
||||||
* It should probably be the name of the service it adapt (e.g : Gammu SMSD, OVH SMS, SIM800L, etc.).
|
* It should probably be the name of the service it adapt (e.g : Gammu SMSD, OVH SMS, SIM800L, etc.).
|
||||||
|
|
|
@ -80,7 +80,7 @@ class OctopushShortcodeAdapter implements AdapterInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ class OctopushVirtualNumberAdapter implements AdapterInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace adapters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should this adapter be hidden in user interface for phone creation and
|
* Should this adapter be hidden in user interface for phone creation and
|
||||||
* available to creation through API only
|
* available to creation through API only.
|
||||||
*/
|
*/
|
||||||
public static function meta_hidden(): bool
|
public static function meta_hidden(): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace controllers\internals;
|
||||||
//Check for user
|
//Check for user
|
||||||
$internal_user = new \controllers\internals\User($this->bdd);
|
$internal_user = new \controllers\internals\User($this->bdd);
|
||||||
$user = $internal_user->check_credentials($decode_message['login'], $decode_message['password']);
|
$user = $internal_user->check_credentials($decode_message['login'], $decode_message['password']);
|
||||||
if (!$user || $user['id'] !== $id_user)
|
if (!$user || (int) $user['id'] !== $id_user)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,6 @@ namespace controllers\internals;
|
||||||
* Check if a user exists based on email.
|
* Check if a user exists based on email.
|
||||||
*
|
*
|
||||||
* @param string $email : User email
|
* @param string $email : User email
|
||||||
*
|
|
||||||
* @return void : exit code 1 on false, 0 else
|
|
||||||
*/
|
*/
|
||||||
public function user_exists(string $email)
|
public function user_exists(string $email)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace controllers\internals;
|
||||||
|
|
||||||
//Padding line with '' entries to make sure its same length as head
|
//Padding line with '' entries to make sure its same length as head
|
||||||
//this allow to mix users with data with users without data
|
//this allow to mix users with data with users without data
|
||||||
$line = array_pad($line, count($head), '');
|
$line = array_pad($line, \count($head), '');
|
||||||
|
|
||||||
$line = array_combine($head, $line);
|
$line = array_combine($head, $line);
|
||||||
if (false === $line)
|
if (false === $line)
|
||||||
|
@ -282,12 +282,13 @@ namespace controllers\internals;
|
||||||
$data = json_decode($contact['data'], true);
|
$data = json_decode($contact['data'], true);
|
||||||
|
|
||||||
$line = [$contact['name'], $contact['number']];
|
$line = [$contact['name'], $contact['number']];
|
||||||
foreach (array_slice($columns, 2) as $column) //ignore first two columns as it's alway name & number
|
foreach (\array_slice($columns, 2) as $column)
|
||||||
{
|
{ //ignore first two columns as it's alway name & number
|
||||||
//If their is no data for this column key, we set '' to ignore
|
//If their is no data for this column key, we set '' to ignore
|
||||||
if (!isset($data[$column]))
|
if (!isset($data[$column]))
|
||||||
{
|
{
|
||||||
$line[] = '';
|
$line[] = '';
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,9 +112,9 @@ namespace controllers\publics;
|
||||||
$contacts = $this->internal_contact->gets_for_user($id_user);
|
$contacts = $this->internal_contact->gets_for_user($id_user);
|
||||||
$phones = $this->internal_phone->gets_for_user($id_user);
|
$phones = $this->internal_phone->gets_for_user($id_user);
|
||||||
|
|
||||||
$contact_ids = (isset($_GET['contact_ids']) && is_array($_GET['contact_ids'])) ? $_GET['contact_ids'] : [];
|
$contact_ids = (isset($_GET['contact_ids']) && \is_array($_GET['contact_ids'])) ? $_GET['contact_ids'] : [];
|
||||||
$group_ids = (isset($_GET['group_ids']) && is_array($_GET['group_ids'])) ? $_GET['group_ids'] : [];
|
$group_ids = (isset($_GET['group_ids']) && \is_array($_GET['group_ids'])) ? $_GET['group_ids'] : [];
|
||||||
$conditional_group_ids = (isset($_GET['conditional_group_ids']) && is_array($_GET['conditional_group_ids'])) ? $_GET['conditional_group_ids'] : [];
|
$conditional_group_ids = (isset($_GET['conditional_group_ids']) && \is_array($_GET['conditional_group_ids'])) ? $_GET['conditional_group_ids'] : [];
|
||||||
|
|
||||||
$prefilled_contacts = [];
|
$prefilled_contacts = [];
|
||||||
$prefilled_groups = [];
|
$prefilled_groups = [];
|
||||||
|
|
|
@ -25,7 +25,7 @@ $config = PhpCsFixer\Config::create()
|
||||||
'@PHP56Migration' => true,
|
'@PHP56Migration' => true,
|
||||||
'@PHPUnit60Migration:risky' => true,
|
'@PHPUnit60Migration:risky' => true,
|
||||||
'@PhpCsFixer' => true,
|
'@PhpCsFixer' => true,
|
||||||
'@PhpCsFixer:risky' => true,
|
'@PhpCsFixer:risky' => false,
|
||||||
'header_comment' => ['header' => $header],
|
'header_comment' => ['header' => $header],
|
||||||
'list_syntax' => ['syntax' => 'long'],
|
'list_syntax' => ['syntax' => 'long'],
|
||||||
'array_syntax' => ['syntax' => 'short'],
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
|
|
Loading…
Reference in New Issue