Compare commits

..

No commits in common. "bd3da737111a281aa9930ea6d5be63415dc83110" and "b5d148304874a27a5cfbdccd8956042bf8b87db3" have entirely different histories.

8 changed files with 32 additions and 19 deletions

View File

@ -1 +1 @@
v3.2.6
v3.2.4

View File

@ -55,7 +55,7 @@ namespace controllers\internals;
*/
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);
$phone = $internal_phone->get($id_phone);
@ -74,7 +74,7 @@ namespace controllers\internals;
*/
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);
$user = $internal_user->get_by_email($email);
@ -89,7 +89,7 @@ namespace controllers\internals;
*/
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);
$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)
{
$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);
$user = $internal_user->get_by_email($email);
@ -146,7 +146,7 @@ namespace controllers\internals;
*/
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);
$user = $internal_user->get($id);
@ -167,7 +167,7 @@ namespace controllers\internals;
*/
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);
$success = $internal_user->delete($id);
@ -180,7 +180,7 @@ namespace controllers\internals;
*/
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);
$medias = $internal_media->gets_unused();
@ -198,7 +198,7 @@ namespace controllers\internals;
*/
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->alerting_for_limit_close_and_reached();
}
@ -208,7 +208,7 @@ namespace controllers\internals;
*/
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->renew_quotas();
}

View File

@ -74,6 +74,13 @@ namespace controllers\publics;
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'] ?? [];
foreach ($ids as $id)
{

View File

@ -44,7 +44,7 @@ class Launcher extends AbstractDaemon
public function run()
{
//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->start_sender_daemon();

View File

@ -60,7 +60,7 @@ class Phone extends AbstractDaemon
$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
$this->send_smss();

View File

@ -94,7 +94,7 @@ class Sender extends AbstractDaemon
public function on_start()
{
$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()

View File

@ -12,6 +12,6 @@ environments:
user: '%APP_DATABASE_USER%'
pass: '%APP_DATABASE_PASS%'
port: 3306
charset: utf8mb4
charset: utf8
version_order: creation

View File

@ -40,7 +40,9 @@
<thead>
<tr>
<th>Numéro</th>
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
<?php } ?>
</tr>
</thead>
<tbody>
@ -48,10 +50,12 @@
</table>
</div>
<div>
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
<div class="text-right col-xs-12 no-padding">
<strong>Action pour la séléction :</strong>
<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>
</form>
</div>
@ -83,12 +87,14 @@ jQuery(document).ready(function ()
{
data: 'number_formatted',
}
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
,{
data: 'id',
render: function (data, type, row, meta) {
return '<input name="ids[]" type="checkbox" value="' + data + '">';
},
},
<?php } ?>
],
"deferRender": true
});