Skip to content

Commit

Permalink
Merge pull request #109 from jeedom/master
Browse files Browse the repository at this point in the history
Stable 1.183
  • Loading branch information
Loïc committed May 5, 2015
2 parents d1ed408 + 071cdfb commit 80370cc
Show file tree
Hide file tree
Showing 190 changed files with 5,891 additions and 45,861 deletions.
1,228 changes: 737 additions & 491 deletions 3rdparty/responsivevoices/responsivevoices.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Website (French): [https://jeedom.fr/](https://jeedom.fr/)
```bash
sudo apt-get update
sudo apt-get dist-upgrade
curl -sS https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh | sudo bash
curl -sS https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh | sudo sh
```

# French #
Expand All @@ -19,5 +19,5 @@ curl -sS https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh
```bash
sudo apt-get update
sudo apt-get dist-upgrade
curl -sS https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh | sudo bash
curl -sS https://raw.githubusercontent.com/jeedom/core/stable/install/install.sh | sudo sh
```
818 changes: 818 additions & 0 deletions adminer2986dsfez893qs2df/index.php

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion core/ajax/market.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@

if (init('action') == 'sendReportBug') {
$ticket = json_decode(init('ticket'), true);
print_r($ticket);
market::saveTicket($ticket);
ajax::success(array('url' => config::byKey('market::address') . '/index.php?v=d&p=ticket'));
}
Expand Down
76 changes: 40 additions & 36 deletions core/ajax/message.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,46 @@
*/

try {
require_once(dirname(__FILE__) . '/../../core/php/core.inc.php');
include_file('core', 'authentification', 'php');

if (!isConnect()) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}

if (init('action') == 'clearMessage') {
message::removeAll(init('plugin'));
ajax::success();
}

if (init('action') == 'nbMessage') {
ajax::success(message::nbMessage());
}

if (init('action') == 'all') {
if (init('plugin') == '') {
ajax::success(utils::o2a(message::all()));
} else {
ajax::success(utils::o2a(message::byPlugin(init('plugin'))));
}
}

if (init('action') == 'removeMessage') {
$message = message::byId(init('id'));
if (!is_object($message)) {
throw new Exception(__('Message inconnu verifié l\'id', __FILE__));
}
$message->remove();
ajax::success();
}

throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
include_file('core', 'authentification', 'php');

if (!isConnect()) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}

if (init('action') == 'clearMessage') {
message::removeAll(init('plugin'));
ajax::success();
}

if (init('action') == 'nbMessage') {
ajax::success(message::nbMessage());
}

if (init('action') == 'all') {
if (init('plugin') == '') {
$messages = utils::o2a(message::all());
} else {
$messages = utils::o2a(message::byPlugin(init('plugin')));
}
foreach ($messages as &$message) {
$message['message'] = htmlentities($message['message']);
}
ajax::success($messages);
}

if (init('action') == 'removeMessage') {
$message = message::byId(init('id'));
if (!is_object($message)) {
throw new Exception(__('Message inconnu verifié l\'id', __FILE__));
}
$message->remove();
ajax::success();
}

throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
} catch (Exception $e) {
ajax::error(displayExeption($e), $e->getCode());
ajax::error(displayExeption($e), $e->getCode());
}
?>
12 changes: 12 additions & 0 deletions core/ajax/network.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
include_file('core', 'authentification', 'php');

if (!isConnect('admin')) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}

if (init('action') == 'restartNgrok') {
config::save('market::allowDNS', 1);
if (network::ngrok_run()) {
Expand All @@ -44,6 +48,14 @@
ajax::success();
}

if (init('action') == 'listWifi') {
ajax::success(network::listWifi());
}

if (init('action') == 'writeInterfaceFile') {
ajax::success(network::writeInterfaceFile());
}

throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
} catch (Exception $e) {
Expand Down
4 changes: 2 additions & 2 deletions core/ajax/plan.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
continue;
}
$link = 'index.php?v=d&p=plan&plan_id=' . $plan_link->getId();
$html = '<span class="plan-link-widget label label-success" data-link_id="' . $plan_link->getId() . '" data-offsetX="' . $plan->getDisplay('offsetX') . '" data-offsetY="' . $plan->getDisplay('offsetY') . '">';
$html = '<span class="cursor plan-link-widget label label-success" data-link_id="' . $plan_link->getId() . '" data-offsetX="' . $plan->getDisplay('offsetX') . '" data-offsetY="' . $plan->getDisplay('offsetY') . '">';
$html .= '<a style="color:' . $plan->getCss('color', 'white') . ';text-decoration:none;font-size : 1.5em;">';
if ($plan->getDisplay('name') != '' || $plan->getDisplay('icon') != '') {
$html .= $plan->getDisplay('icon') . ' ' . $plan->getDisplay('name');
Expand All @@ -77,7 +77,7 @@
continue;
}
$link = 'index.php?p=view&view_id=' . $view->getId();
$html = '<span href="' . $link . '" class="view-link-widget label label-primary" data-link_id="' . $view->getId() . '" >';
$html = '<span href="' . $link . '" class=" cursor view-link-widget label label-primary" data-link_id="' . $view->getId() . '" >';
$html .= '<a href="' . $link . '" style="color:' . $plan->getCss('color', 'white') . ';text-decoration:none;font-size : 1.5em;">';
if ($plan->getDisplay('name') != '' || $plan->getDisplay('icon') != '') {
$html .= $plan->getDisplay('icon') . ' ' . $plan->getDisplay('name');
Expand Down
14 changes: 12 additions & 2 deletions core/ajax/user.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@
include_file('core', 'authentification', 'php');

if (init('action') == 'login') {
if (!login(init('username'), init('password'), true)) {
if (!isConnect() && config::byKey('sso:allowRemoteUser') == 1) {
$user = user::byLogin($_SERVER['REMOTE_USER']);
if (is_object($user) && $user->getEnable() == 1) {
connection::success($user->getLogin());
@session_start();
$_SESSION['user'] = $user;
@session_write_close();
log::add('connection', 'info', __('Connexion de l\'utilisateur par REMOTE_USER : ', __FILE__) . $user->getLogin());
}
}
if (!isConnect() && !login(init('username'), init('password'), true)) {
throw new Exception('Mot de passe ou nom d\'utilisateur incorrect');
}
if (init('storeConnection') == 1) {
Expand Down Expand Up @@ -166,7 +176,7 @@
ajax::success(utils::o2a($_SESSION['user']));
}

if (init('action') == 'testLdapConneciton') {
if (init('action') == 'testLdapConnection') {
if (!isConnect('admin')) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}
Expand Down
18 changes: 17 additions & 1 deletion core/api/jeeApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,22 @@
$jsonrpc->makeSuccess($return);
}

/* * ************************datastore*************************** */

if ($jsonrpc->getMethod() == 'datastore::byTypeLinkIdKey') {
$jsonrpc->makeSuccess(dataStore::byTypeLinkIdKey($params['type'], $params['linkId'], $params['key']));
}

if ($jsonrpc->getMethod() == 'datastore::save') {
$dataStore = new dataStore();
$dataStore->setType($params['type']);
$dataStore->setKey($params['key']);
$dataStore->setValue($params['value']);
$dataStore->setLink_id($params['linkId']);
$dataStore->save();
$jsonrpc->makeSuccess('ok');
}

/* * ************************Equipement*************************** */
if ($jsonrpc->getMethod() == 'eqLogic::all') {
$jsonrpc->makeSuccess(utils::o2a(eqLogic::all()));
Expand Down Expand Up @@ -490,7 +506,7 @@
'jeedom::url' => config::byKey('jeedom::url'),
'ngrok::port' => config::byKey('ngrok::port'),
);
if (filter_var(network::getNetworkAccess('external', 'ip'), FILTER_VALIDATE_IP) || network::getNetworkAccess('external', 'ip') == '') {
if (!filter_var(network::getNetworkAccess('external', 'ip'), FILTER_VALIDATE_IP) && network::getNetworkAccess('external', 'ip') != '') {
$return['jeedom::url'] = network::getNetworkAccess('internal');
}
foreach (plugin::listPlugin(true) as $plugin) {
Expand Down
Loading

0 comments on commit 80370cc

Please sign in to comment.