Compare commits
No commits in common. "bd3da737111a281aa9930ea6d5be63415dc83110" and "b5d148304874a27a5cfbdccd8956042bf8b87db3" have entirely different histories.
bd3da73711
...
b5d1483048
|
@ -55,7 +55,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function phone($id_phone)
|
public function phone($id_phone)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_phone = new \controllers\internals\Phone($bdd);
|
$internal_phone = new \controllers\internals\Phone($bdd);
|
||||||
|
|
||||||
$phone = $internal_phone->get($id_phone);
|
$phone = $internal_phone->get($id_phone);
|
||||||
|
@ -74,7 +74,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function user_exists(string $email)
|
public function user_exists(string $email)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_user = new \controllers\internals\User($bdd);
|
$internal_user = new \controllers\internals\User($bdd);
|
||||||
|
|
||||||
$user = $internal_user->get_by_email($email);
|
$user = $internal_user->get_by_email($email);
|
||||||
|
@ -89,7 +89,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function user_id_exists(string $id)
|
public function user_id_exists(string $id)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_user = new \controllers\internals\User($bdd);
|
$internal_user = new \controllers\internals\User($bdd);
|
||||||
|
|
||||||
$user = $internal_user->get($id);
|
$user = $internal_user->get($id);
|
||||||
|
@ -111,7 +111,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function create_update_user(string $email, string $password, bool $admin, ?string $api_key = null, string $status = \models\User::STATUS_ACTIVE, bool $encrypt_password = true)
|
public function create_update_user(string $email, string $password, bool $admin, ?string $api_key = null, string $status = \models\User::STATUS_ACTIVE, bool $encrypt_password = true)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_user = new \controllers\internals\User($bdd);
|
$internal_user = new \controllers\internals\User($bdd);
|
||||||
|
|
||||||
$user = $internal_user->get_by_email($email);
|
$user = $internal_user->get_by_email($email);
|
||||||
|
@ -146,7 +146,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function update_user_status(string $id, string $status)
|
public function update_user_status(string $id, string $status)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_user = new \controllers\internals\User($bdd);
|
$internal_user = new \controllers\internals\User($bdd);
|
||||||
|
|
||||||
$user = $internal_user->get($id);
|
$user = $internal_user->get($id);
|
||||||
|
@ -167,7 +167,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function delete_user(string $id)
|
public function delete_user(string $id)
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_user = new \controllers\internals\User($bdd);
|
$internal_user = new \controllers\internals\User($bdd);
|
||||||
|
|
||||||
$success = $internal_user->delete($id);
|
$success = $internal_user->delete($id);
|
||||||
|
@ -180,7 +180,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function clean_unused_medias()
|
public function clean_unused_medias()
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_media = new \controllers\internals\Media($bdd);
|
$internal_media = new \controllers\internals\Media($bdd);
|
||||||
|
|
||||||
$medias = $internal_media->gets_unused();
|
$medias = $internal_media->gets_unused();
|
||||||
|
@ -198,7 +198,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function quota_limit_alerting()
|
public function quota_limit_alerting()
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_quota = new \controllers\internals\Quota($bdd);
|
$internal_quota = new \controllers\internals\Quota($bdd);
|
||||||
$internal_quota->alerting_for_limit_close_and_reached();
|
$internal_quota->alerting_for_limit_close_and_reached();
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ namespace controllers\internals;
|
||||||
*/
|
*/
|
||||||
public function renew_quotas()
|
public function renew_quotas()
|
||||||
{
|
{
|
||||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$internal_quota = new \controllers\internals\Quota($bdd);
|
$internal_quota = new \controllers\internals\Quota($bdd);
|
||||||
$internal_quota->renew_quotas();
|
$internal_quota->renew_quotas();
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,13 @@ namespace controllers\publics;
|
||||||
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!\controllers\internals\Tool::is_admin())
|
||||||
|
{
|
||||||
|
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour pouvoir supprimer un "STOP Sms" !');
|
||||||
|
|
||||||
|
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
||||||
|
}
|
||||||
|
|
||||||
$ids = $_GET['ids'] ?? [];
|
$ids = $_GET['ids'] ?? [];
|
||||||
foreach ($ids as $id)
|
foreach ($ids as $id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Launcher extends AbstractDaemon
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
//Create the internal controllers
|
//Create the internal controllers
|
||||||
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
$this->internal_phone = new \controllers\internals\Phone($this->bdd);
|
$this->internal_phone = new \controllers\internals\Phone($this->bdd);
|
||||||
|
|
||||||
$this->start_sender_daemon();
|
$this->start_sender_daemon();
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Phone extends AbstractDaemon
|
||||||
|
|
||||||
$this->read_tick += 1;
|
$this->read_tick += 1;
|
||||||
|
|
||||||
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
|
|
||||||
//Send smss in queue
|
//Send smss in queue
|
||||||
$this->send_smss();
|
$this->send_smss();
|
||||||
|
|
|
@ -94,7 +94,7 @@ class Sender extends AbstractDaemon
|
||||||
public function on_start()
|
public function on_start()
|
||||||
{
|
{
|
||||||
$this->logger->info('Starting Sender with pid ' . getmypid());
|
$this->logger->info('Starting Sender with pid ' . getmypid());
|
||||||
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function on_stop()
|
public function on_stop()
|
||||||
|
|
|
@ -12,6 +12,6 @@ environments:
|
||||||
user: '%APP_DATABASE_USER%'
|
user: '%APP_DATABASE_USER%'
|
||||||
pass: '%APP_DATABASE_PASS%'
|
pass: '%APP_DATABASE_PASS%'
|
||||||
port: 3306
|
port: 3306
|
||||||
charset: utf8mb4
|
charset: utf8
|
||||||
|
|
||||||
version_order: creation
|
version_order: creation
|
||||||
|
|
|
@ -40,7 +40,9 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Numéro</th>
|
<th>Numéro</th>
|
||||||
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
|
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
|
||||||
|
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
|
||||||
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -48,10 +50,12 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-right col-xs-12 no-padding">
|
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
|
||||||
<strong>Action pour la séléction :</strong>
|
<div class="text-right col-xs-12 no-padding">
|
||||||
<button class="btn btn-default btn-confirm" type="submit" formaction="<?php echo \descartes\Router::url('SmsStop', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
<strong>Action pour la séléction :</strong>
|
||||||
</div>
|
<button class="btn btn-default btn-confirm" type="submit" formaction="<?php echo \descartes\Router::url('SmsStop', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,12 +87,14 @@ jQuery(document).ready(function ()
|
||||||
{
|
{
|
||||||
data: 'number_formatted',
|
data: 'number_formatted',
|
||||||
}
|
}
|
||||||
|
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
|
||||||
,{
|
,{
|
||||||
data: 'id',
|
data: 'id',
|
||||||
render: function (data, type, row, meta) {
|
render: function (data, type, row, meta) {
|
||||||
return '<input name="ids[]" type="checkbox" value="' + data + '">';
|
return '<input name="ids[]" type="checkbox" value="' + data + '">';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
<?php } ?>
|
||||||
],
|
],
|
||||||
"deferRender": true
|
"deferRender": true
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue