Skip to content

Commit

Permalink
correction authentification
Browse files Browse the repository at this point in the history
  • Loading branch information
JEALG committed Sep 29, 2024
1 parent 0c73407 commit 64900c0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 65 deletions.
60 changes: 31 additions & 29 deletions core/class/Freebox_OS.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,41 @@ public static function cron()
{
$eqLogics = eqLogic::byType('Freebox_OS');
$deamon_info = self::deamon_info();
if ($deamon_info['state'] != 'ok' && config::byKey('deamonAutoMode', 'Freebox_OS') != 0) {
log::add('Freebox_OS', 'debug', ':fg-info: Etat du Démon ' . $deamon_info['state'] . ':/fg:');
Freebox_OS::deamon_start();
$Free_API = new Free_API();
$Free_API->getFreeboxOpenSession();
$deamon_info = self::deamon_info();
log::add('Freebox_OS', 'debug', ':fg-info: Redémarrage du démon : ' . $deamon_info['state'] . ':/fg:');
}
foreach ($eqLogics as $eqLogic) {
$autorefresh = $eqLogic->getConfiguration('autorefresh', '*/5 * * * *');
try {
$c = new Cron\CronExpression($autorefresh, new Cron\FieldFactory);
if ($deamon_info['launchable'] == 'ok') {
if ($deamon_info['state'] != 'ok' && config::byKey('deamonAutoMode', 'Freebox_OS') != 0) {
log::add('Freebox_OS', 'debug', ':fg-info: Etat du Démon ' . $deamon_info['state'] . ':/fg:');
Freebox_OS::deamon_start();
$Free_API = new Free_API();
$Free_API->getFreeboxOpenSession();
$deamon_info = self::deamon_info();
log::add('Freebox_OS', 'debug', ':fg-info: Redémarrage du démon : ' . $deamon_info['state'] . ':/fg:');
}
foreach ($eqLogics as $eqLogic) {
$autorefresh = $eqLogic->getConfiguration('autorefresh', '*/5 * * * *');
try {
$c = new Cron\CronExpression($autorefresh, new Cron\FieldFactory);

if ($c->isDue() && $deamon_info['state'] == 'ok') {
if ($eqLogic->getIsEnable()) {
if (($eqLogic->getConfiguration('eq_group') == 'nodes' || $eqLogic->getConfiguration('eq_group') == 'tiles') && (config::byKey('TYPE_FREEBOX_TILES', 'Freebox_OS') == 'OK' && config::byKey('FREEBOX_TILES_CRON', 'Freebox_OS') == 1)) {
} else {
log::add('Freebox_OS', 'debug', '──────────▶︎ :fg-info: CRON pour l\'actualisation de : ' . $eqLogic->getName() . ':/fg: ◀︎───────────');
Free_Refresh::RefreshInformation($eqLogic->getId());
log::add('Freebox_OS', 'debug', '───────────────────────────────────────────');
if ($c->isDue() && $deamon_info['state'] == 'ok') {
if ($eqLogic->getIsEnable()) {
if (($eqLogic->getConfiguration('eq_group') == 'nodes' || $eqLogic->getConfiguration('eq_group') == 'tiles') && (config::byKey('TYPE_FREEBOX_TILES', 'Freebox_OS') == 'OK' && config::byKey('FREEBOX_TILES_CRON', 'Freebox_OS') == 1)) {
} else {
log::add('Freebox_OS', 'debug', '──────────▶︎ :fg-info: CRON pour l\'actualisation de : ' . $eqLogic->getName() . ':/fg: ◀︎───────────');
Free_Refresh::RefreshInformation($eqLogic->getId());
log::add('Freebox_OS', 'debug', '───────────────────────────────────────────');
}
}
}
if ($deamon_info['state'] != 'ok' && config::byKey('deamonAutoMode', 'Freebox_OS') != 0) {
log::add('Freebox_OS', 'debug', '[WARNING] - PAS DE CRON pour d\'actualisation ' . $eqLogic->getName() . ' à cause du Démon : ' . $deamon_info['state']);
}
} catch (Exception $exc) {
//log::add('Freebox_OS', 'error', __('Expression cron non valide pour ', __FILE__) . $eqLogic->getHumanName() . ' : ' . $autorefresh . ' Ou problème dans le CRON');
}
if ($deamon_info['state'] != 'ok' && config::byKey('deamonAutoMode', 'Freebox_OS') != 0) {
log::add('Freebox_OS', 'debug', '[WARNING] - PAS DE CRON pour d\'actualisation ' . $eqLogic->getName() . ' à cause du Démon : ' . $deamon_info['state']);
}
} catch (Exception $exc) {
//log::add('Freebox_OS', 'error', __('Expression cron non valide pour ', __FILE__) . $eqLogic->getHumanName() . ' : ' . $autorefresh . ' Ou problème dans le CRON');
}
if ($eqLogic->getLogicalId() == 'network' || $eqLogic->getLogicalId() == 'networkwifiguest' || $eqLogic->getLogicalId() == 'disk' || $eqLogic->getLogicalId() == 'homeadapters') {
if ($eqLogic->getIsEnable()) {
if ($deamon_info['state'] == 'ok') {
Freebox_OS::cron_autorefresh_eqLogic($eqLogic, $deamon_info);
if ($eqLogic->getLogicalId() == 'network' || $eqLogic->getLogicalId() == 'networkwifiguest' || $eqLogic->getLogicalId() == 'disk' || $eqLogic->getLogicalId() == 'homeadapters') {
if ($eqLogic->getIsEnable()) {
if ($deamon_info['state'] == 'ok') {
Freebox_OS::cron_autorefresh_eqLogic($eqLogic, $deamon_info);
}
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions desktop/js/authentification.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,9 @@ $('.bt_FreeboxOS_Save_room').on('click', function () {
logs('info', "───▶︎ :fg-info:Cron Global Titles ::/fg: OK:");
cron_tiles = '1';
};
/*checkvalueCmd = $('.checkbox_freeboxCmdbyCmd:checked').val();
if (checkvalueCmd == null) {
logs('info', "───▶︎ :fg-warning:Actualisation par commande ::/fg: NOK");
CmdbyCmd = '0';
} else {
logs('info', "───▶︎ :fg-warning:Actualisation par commande ::/fg: OK");
CmdbyCmd = '1';
};*/
console.log('CRON TILES : ' + cron_tiles)
//console.log('CMD BY CMD : ' +CmdbyCmd)
//SetSettingTiles(cron_tiles, CmdbyCmd);
SetSettingTiles(cron_tiles);
logs('info', "──────────▶︎ :fg-warning:{{Sauvegarde des Pièces des Tiles}}:/fg: ◀︎───────────");
//SaveTitelRoom();
});


Expand Down
50 changes: 25 additions & 25 deletions desktop/modal/authentification.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<div class="FreeboxOS_Display home">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand All @@ -69,11 +69,11 @@
<div class="FreeboxOS_Display setting" style="display:none;">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-danger bt_FreeboxOS_ResetConfig" title="{{Reset de la configuration}}"><i class="fas fa-trash"></i><span class="hidden-xs">{{Reset de la configuration}}</span>
</a><a class="btn btn-sm btn-success bt_FreeboxOS_Save"><i class="fas fa-save"></i><span class="hidden-xs"> {{Sauvegarder}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-danger bt_Freebox_ResetConfig" title="{{Reset de la configuration}}"><i class="fas fa-trash"></i><span class="hidden-xs">{{Reset de la configuration}}</span>
</a><a class="btn btn-sm btn-success bt_Freebox_Save"><i class="fas fa-save"></i><span class="hidden-xs"> {{Sauvegarder}}</span>
</a><a class="btn btn-sm bt_Freebox_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand Down Expand Up @@ -145,10 +145,10 @@
<div class="FreeboxOS_Display authentification" style="display:none;">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-warning bt_FreeboxOS_Autorisation" title="{{Lancer la procédure d'authentification}}"><i class="fas fa-exclamation-circle"></i><span class="hidden-xs"> {{Lancement de l'authentification}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-warning bt_Freebox_Autorisation" title="{{Lancer la procédure d'authentification}}"><i class="fas fa-exclamation-circle"></i><span class="hidden-xs"> {{Lancement de l'authentification}}</span>
</a><a class="btn btn-sm bt_Freebox_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand Down Expand Up @@ -176,12 +176,12 @@
<div class="FreeboxOS_Display rights" style="display:none;">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-danger bt_FreeboxOS_droitVerif_pass" title="{{Ignorer la vérification des droits}}"><i class="fas fa-balance-scale"></i><span class="hidden-xs"> {{Ignorer Vérification des droits}}</span>
</a><a id="bt_FreeboxOS_droitVerif" class="btn btn-sm btn-warning bt_FreeboxOS_droitVerif" title="{{Lancer la vérification des droits}}"><i class="fas fa-balance-scale"></i><span class="hidden-xs"> {{Vérification des droits}}</span>
</a><a id="bt_FreeboxOS" class="btn btn-sm btn-default bt_FreeboxOS" target='_blank' href='http://mafreebox.freebox.fr'><i class="far fa-hand-point-right"></i> <span class="hidden-xs">{{Ouvrir Interface Freebox}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-danger bt_Freebox_droitVerif_pass" title="{{Ignorer la vérification des droits}}"><i class="fas fa-balance-scale"></i><span class="hidden-xs"> {{Ignorer Vérification des droits}}</span>
</a><a id="bt_Freebox_droitVerif" class="btn btn-sm btn-warning bt_Freebox_droitVerif" title="{{Lancer la vérification des droits}}"><i class="fas fa-balance-scale"></i><span class="hidden-xs"> {{Vérification des droits}}</span>
</a><a id="bt_Freebox" class="btn btn-sm btn-default bt_Freebox" target='_blank' href='http://mafreebox.freebox.fr'><i class="far fa-hand-point-right"></i> <span class="hidden-xs">{{Ouvrir Interface Freebox}}</span>
</a><a class="btn btn-sm bt_Freebox_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand Down Expand Up @@ -285,11 +285,11 @@
<div class="FreeboxOS_Display room" style="display:none;">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-warning bt_FreeboxOS_Room" title="{{Lancer le scan des Pièces}}"><i class="fas fa-exclamation-circle"></i><span class="hidden-xs"> {{Recherche des Pièces}}</span>
</a><a class="btn btn-sm btn-success bt_FreeboxOS_Save_room"><i class="fas fa-save"></i><span class="hidden-xs"> {{Sauvegarder}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm btn-warning bt_Freebox_Room" title="{{Lancer le scan des Pièces}}"><i class="fas fa-exclamation-circle"></i><span class="hidden-xs"> {{Recherche des Pièces}}</span>
</a><a class="btn btn-sm btn-success bt_Freebox_Save_room"><i class="fas fa-save"></i><span class="hidden-xs"> {{Sauvegarder}}</span>
</a><a class="btn btn-sm bt_Freebox_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand Down Expand Up @@ -341,9 +341,9 @@
<div class="FreeboxOS_Display scan" style="display:none;">
<div class="input-group pull-right" style="display:inline-flex;">
<span class="input-group-btn">
<a class="btn btn-sm btn-primary bt_FreeboxOS_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_FreeboxOS_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
<a class="btn btn-sm btn-primary bt_Freebox_doc roundedLeft" title="{{Documentation}}" target='_blank' href='http://mika-nt28.github.io/Documentations/Freebox_OS/fr_FR/'><i class="fas fa-book"></i><span class="hidden-xs"> {{Documentation}}</span>
</a><a class="btn btn-sm bt_Freebox_Previous" title="{{Précedent}}"><i class="fas fa-angle-double-left"></i><span class="hidden-xs"> {{Précédent}}</span>
</a><a class="btn btn-sm bt_Freebox_Next roundedRight" title="{{Suivant}}"><span class="hidden-xs">{{Suivant}} </span><i class="fas fa-angle-double-right"></i>
</a>
</span>
</div>
Expand Down

0 comments on commit 64900c0

Please sign in to comment.