public function init() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_OFFLINE) { $this->_redirect('/setup/wan'); } }
public function index() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_OFFLINE) { $this->_redirect('/setup/wan'); } $params = array(); $view = new View('settings', $params); return $view->display(); }
public function index() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_OFFLINE) { $this->_redirect('/setup/wan'); } $broadcast_hidden_status = NetAidManager::broadcast_hidden_status(); $params = array('broadcast_hidden_status' => $broadcast_hidden_status); $view = new View('network', $params); return $view->display(); }
public function index() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_OFFLINE) { $this->_redirect('/setup/wan'); } $torLog = $this->_getTorLog(); $vpnLog = $this->_getVpnLog(); $params = array('torLog' => $torLog, 'vpnLog' => $vpnLog); $view = new View('logs', $params); return $view->display(); }
public function index() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_OFFLINE) { $this->_redirect('/setup/wan'); } $wan_ssid = NetAidManager::wan_ssid(); if ($wan_ssid == 'NETAIDKIT') { $wan_ssid = 'Wired connection'; } $cur_stage = NetAidManager::get_stage(); $vpn_obj = new Ovpn(); $vpn_options = $vpn_obj->getOptions(); $cur_vpn = basename($vpn_obj->getCurrent()); $tor_status = $this->_get_tor_status(); $vpn_status = $this->_get_vpn_status(); $routing_status = NetAidManager::routing_status(); $params = array('cur_stage' => $cur_stage, 'wan_ssid' => $wan_ssid, 'vpn_options' => $vpn_options, 'cur_vpn' => $cur_vpn, 'tor_status' => $tor_status, 'vpn_status' => $vpn_status, 'routing_status' => $routing_status); $view = new View('admin', $params); return $view->display(); }
public function wan() { $cur_stage = NetAidManager::get_stage(); if ($cur_stage == STAGE_DEFAULT) { $this->_redirect('/setup/ap'); } if ($cur_stage == STAGE_ONLINE) { $this->_redirect('/admin/index'); } if (NetAidManager::get_inetstat()) { NetAidManager::go_online(); NetAidManager::set_stage(STAGE_ONLINE); $this->_addMessage('info', 'Setup complete.', 'setup'); $this->_redirect('/admin/index'); } $request = $this->getRequest(); if ($request->isPost()) { $ssid = $request->postvar('ssid'); $key = $request->postvar('key'); $wan_success = NetAidManager::setup_wan($ssid, $key); if ($wan_success) { NetAidManager::set_stage(STAGE_ONLINE); $this->_addMessage('info', 'Setup complete.', 'setup'); } if ($request->isAjax()) { echo $wan_success ? "SUCCESS" : "FAILURE"; exit; } } $wifi_list = NetAidManager::scan_wifi(); $params = array('wifi_list' => $wifi_list); $view = new View('setup_wan', $params); return $view->display(); }
<?php require_once '/nak/webapp/bootstrap.php'; if (!session_id()) { session_start(); } $cur_stage = NetAidManager::get_stage(); $request = new Request($_GET['query']); $dispatcher = new Dispatcher(); $controller = $request->getController(); $action = $request->getAction(); $updater = new Updater(); if ($cur_stage >= STAGE_ONLINE && $_SESSION['logged_in'] == 1 && $updater->updateAvailable()) { if ($controller != 'update') { $request->setController('update'); $request->setAction('index'); } } else { if ($cur_stage != STAGE_ONLINE && $_SERVER['SERVER_NAME'] != '192.168.101.1') { header('Location: http://192.168.101.1/' . $controller . '/' . $action); die; } } $page_html = ''; try { $page_html = $dispatcher->run($request); } catch (NotFoundException $e) { if ($cur_stage != STAGE_ONLINE) { header('Location: http://192.168.101.1/index/index'); die; }