Beispiel #1
0
 */
try {
    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::dns_run()) {
            network::dns_stop();
        }
        network::dns_start();
        ajax::success();
    }
    if (init('action') == 'stopNgrok') {
        config::save('market::allowDNS', 0);
        network::dns_stop();
        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) {
    ajax::error(displayExeption($e), $e->getCode());
}