* Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
try {
    require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';
    include_file('core', 'authentification', 'php');
    if (!isConnect('admin')) {
        throw new Exception('401 Unauthorized');
    }
    if (init('action') == 'updatehomebridge') {
        homebridge::updatehomebridge();
        ajax::success();
    }
    if (init('action') == 'stopDeamon') {
        homebridge::stopDeamon();
        ajax::success();
    }
    if (init('action') == 'startDeamon') {
        homebridge::runDeamon();
        ajax::success();
    }
    throw new Exception('Aucune methode correspondante');
    /*     * *********Catch exeption*************** */
} catch (Exception $e) {
    ajax::error(displayExeption($e), $e->getCode());
}
Exemplo n.º 2
0
    <?php 
/* This file is part of Jeedom.
 *
 * Jeedom is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';
global $jsonrpc;
if (!is_object($jsonrpc)) {
    throw new Exception(__('JSONRPC object not defined', __FILE__), -32699);
}
$params = $jsonrpc->getParams();
if ($jsonrpc->getMethod() == 'getModulesList') {
    log::add('homebridge', 'info', 'Recupération des modules');
    $modules = homebridge::getModulesList();
    log::add('homebridge', 'info', 'envoi de ' . json_encode($modules));
    $jsonrpc->makeSuccess($modules);
}
throw new Exception(__('Aucune methode correspondante pour le plugin homebridge : ' . $jsonrpc->getMethod(), __FILE__));
Exemplo n.º 3
0
 *
 * Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
require_once dirname(__FILE__) . '/../../../core/php/core.inc.php';
include_file('core', 'authentification', 'php');
if (!isConnect()) {
    include_file('desktop', '404', 'php');
    die;
}
$deamonRunningMaster = homebridge::deamonRunning();
echo '<form class="form-horizontal">';
echo '<fieldset>';
echo '<div class="form-group">';
echo '<label class="col-sm-4 control-label">{{Démon homebridge}}</label>';
if (!$deamonRunningMaster) {
    echo '<div class="col-sm-1"><span class="label label-danger tooltips" style="font-size : 1em;">NOK</span></div>';
} else {
    echo '<div class="col-sm-1"><span class="label label-success" style="font-size : 1em;">OK</span></div>';
}
echo '</div>';
if (exec('sudo cat /etc/sudoers') != "") {
    ?>

    <div class="form-group">
        <label class="col-lg-4 control-label">{{Installer/Mettre à jour les dépendances}}</label>