Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/class/autologin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

/* * ***************************Includes********************************* */

require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';

//error_reporting(E_ALL);
//ini_set('display_errors', 'On');
Expand Down Expand Up @@ -46,8 +47,8 @@ public function preUpdate() {
if ( $this->getConfiguration('ip', '') == '' ) {
throw new Exception(__('Le champs IP ne peut etre vide.', __FILE__));
}
if ( !filter_var($this->getConfiguration('ip', ''), FILTER_VALIDATE_IP) ) {
throw new Exception(__('Le champs IP n\'est pas au bon format.', __FILE__));
if ( !filter_var(scenarioExpression::setTags(gethostbyname($this->getConfiguration('ip', ''))), FILTER_VALIDATE_IP)) {
throw new Exception(__('Le champs IP n\'est pas au bon format. '.scenarioExpression::setTags(gethostbyname($this->getConfiguration('ip', ''))).'', __FILE__));
}
if ( $this->getConfiguration('user', '') == '' ) {
throw new Exception(__('Le champs Utilisateur ne peut etre vide.', __FILE__));
Expand Down
4 changes: 2 additions & 2 deletions core/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"Catégorie": "Category",
"Activer": "Enable",
"Visible": "Visible",
"IP Autorisée": "Allowed IP",
"eg: 192.168.X.Y": "eg: 192.168.X.Y",
"IP ou Hostname Autorisée": "Allowed IP or Hostname",
"eg: 192.168.X.Y ou hostname": "eg: 192.168.X.Y or hostname",
"Utilisateur": "User",
"Selectionner un utilisateur (non admin)": "Select a non-admin user",
"Page Jeedom": "Jeedom page",
Expand Down
4 changes: 2 additions & 2 deletions core/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"Catégorie": "Catégorie",
"Activer": "Activer",
"Visible": "Visible",
"IP Autorisée": "IP Autorisée",
"eg: 192.168.X.Y": "eg: 192.168.X.Y",
"IP ou Hostname Autorisée": "IP ou Hostname Autorisée",
"eg: 192.168.X.Y ou hostname": "eg: 192.168.X.Y ou hostname",
"Utilisateur": "Utilisateur",
"Selectionner un utilisateur (non admin)": "Selectionner un utilisateur (non admin)",
"Page Jeedom": "Page Jeedom",
Expand Down
5 changes: 4 additions & 1 deletion core/php/go.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
}

$url = $scheme . '://' . $host . '/' .$autologin->getRedirectUrl();
$allowedIP = $autologin->getIP();
$allowedIP = scenarioExpression::setTags($autologin->getIP());
if ( !filter_var($allowedIP, FILTER_VALIDATE_IP)) {
$allowedIP = gethostbyname($autologin->getIP());
}
$user = $autologin->getUser();
$hashRegisteredDevice = $autologin->getHash();
$hashregisterdevice = $autologin->getHash();
Expand Down
4 changes: 2 additions & 2 deletions desktop/php/autologin.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ function sortByOption($a, $b) {
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">{{IP Autorisée}}</label>
<label class="col-lg-3 control-label">{{IP ou Hostname Autorisée}}</label>
<div class="col-lg-4">
<input type="text" class="eqLogicAttr form-control" data-l1key="configuration" data-l2key="ip" placeholder="{{eg: 192.168.X.Y}}"/>
<input type="text" class="eqLogicAttr form-control" data-l1key="configuration" data-l2key="ip" placeholder="{{eg: 192.168.X.Y ou hostname }}"/>
</div>
</div>
<div class="form-group">
Expand Down
5 changes: 4 additions & 1 deletion docs/fr_FR/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ La configuration des sessions Autologin est accessible à partir du menu *Plugin

Liste des paramêtres :

- IP autorisée : L'IP à partir duquel l'équipement devra se connecter
- IP autorisée à partir duquel l'équipement devra se connecter:
- Adresse IP (ex: 127.0.0.1)
- Hostname
- Variable (ex: variable(ip))
- Utilisateur : Choisir un utilisateur non admin (il est nécessaire d'avoir créé un utilisateur non admin au préalable)
- Page Jeedom : La page Jeedom de redirection une fois l'autologin effectué (sans le *http[s]://jeedom/*).
Exemple : "*index.php*" ou "*index.php?v=d&p=plan&plan_id=1*"
Expand Down