Esempio n. 1
0
 public function wan()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $ssid = $request->postvar('ssid');
         $key = $request->postvar('key');
         $wan_success = NetAidManager::setup_wan($ssid, $key);
         if ($request->isAjax()) {
             echo $wan_success ? "SUCCESS" : "FAILURE";
             exit;
         }
     }
 }
Esempio n. 2
0
 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();
 }