Exemplo n.º 1
0
    header("Status: 404 Not Found");
    header('HTTP/1.0 404 Not Found');
    $_SERVER['REDIRECT_STATUS'] = 404;
    echo "<h1>404 Not Found</h1>";
    echo "The page that you have requested could not be found.";
    exit;
}
require_once dirname(__FILE__) . '/../../../core/php/core.inc.php';
echo "Début de la migration vers openzwave\n";
$server_convertion = array(1 => 1, 2 => 2, 3 => 3);
for ($i = 1; $i <= 3; $i++) {
    if (config::byKey('zwaveAddr' . $i, 'zwave') != '' && config::byKey('zwaveAddr' . $i, 'zwave') != -1) {
        if (config::byKey('zwaveAddr' . $i, 'zwave') == '127.0.0.1' || config::byKey('zwaveAddr' . $i, 'zwave') == 'localhost') {
            $server_convertion[$i] = 0;
        } else {
            foreach (jeeNetwork::all() as $jeeNetwork) {
                if (config::byKey('zwaveAddr' . $i, 'zwave') == $jeeNetwork->getRealIp()) {
                    $server_convertion[$i] = $jeeNetwork->getId();
                }
            }
        }
    }
}
foreach (eqLogic::byType('zwave') as $eqLogic) {
    $eqLogic->setEqType_name('openzwave');
    $server_id = $eqLogic->getConfiguration('serverID', 1);
    if (isset($server_convertion[$server_id])) {
        $server_id = $server_convertion[$server_id];
    } else {
        $server_id = 0;
    }
Exemplo n.º 2
0
         throw new Exception(__('Objet inconnu, vérifiez l\'ID : ', __FILE__) . init('id'));
     }
     ajax::success($jeeNetwork->removeAllMessage());
 }
 if (init('action') == 'getMessage') {
     $jeeNetwork = jeeNetwork::byId(init('id'));
     if (!is_object($jeeNetwork)) {
         throw new Exception(__('Objet inconnu, vérifiez l\'ID : ', __FILE__) . init('id'));
     }
     ajax::success($jeeNetwork->getMessage());
 }
 if (init('action') == 'all') {
     if (!isConnect('admin')) {
         throw new Exception(__('401 - Accès non autorisé', __FILE__));
     }
     ajax::success(utils::o2a(jeeNetwork::all()));
 }
 if (init('action') == 'restoreLocalBackup') {
     $jeeNetwork = jeeNetwork::byId(init('id'));
     if (!is_object($jeeNetwork)) {
         throw new Exception(__('JeeNetwork inconnu, vérifiez l\'ID : ', __FILE__) . init('id'));
     }
     ajax::success($jeeNetwork->restoreLocalBackup(init('backup')));
 }
 if (init('action') == 'backup') {
     $jeeNetwork = jeeNetwork::byId(init('id'));
     if (!is_object($jeeNetwork)) {
         throw new Exception(__('JeeNetwork inconnu, vérifiez l\'ID : ', __FILE__) . init('id'));
     }
     ajax::success($jeeNetwork->backup());
 }