Ejemplo n.º 1
0
 public function setwifi()
 {
     $net = $this->input->post('net');
     $password = $this->input->post('password');
     $address = $this->input->post('address');
     /** LOAD HELPERS */
     $this->load->helper("os_helper");
     $wlans = scan_wlan();
     $type = '';
     foreach ($wlans as $wl) {
         if ($wl['address'] == $address) {
             $type = $wl['type'];
         }
     }
     if (setWifi($net, $password, $type)) {
         $wlan = wlan();
         $wlan_ip = isset($wlan['ip']) ? $wlan['ip'] : '';
         $this->load->database();
         $this->load->model('configuration');
         /** SAVE NEW WIFI CONFIGURATION TO DB */
         $this->configuration->save_confi_value('wifi', json_encode(array('ssid' => $net, 'password' => $password, 'ip' => $wlan_ip)));
         $response_items['wlan_ip'] = $wlan_ip;
         $response_items['response'] = 'OK';
     } else {
         $response_items['response'] = 'KO';
     }
     echo json_encode($response_items);
 }
Ejemplo n.º 2
0
<?php

/** * UTILITIES */
include "inc/utilities.php";
$_wlan_list = scan_wlan();
$_lan = lan();
$temp = explode('.', $_lan['ip']);
$ipLastNum = $temp[3];
?>
<div class="tab-pane" id="tab3">
	<br>
	<h3>
		<strong>
			Step 3
		</strong>
		- Setup your network configuration
	</h3>
	<div class="row">
		<table class="table table-striped table-forum smart-form">
			<thead>
				<th colspan="2">
					<i class="fa fa-sitemap text-muted">
					</i>
					LAN Network
				</th>
				<th class="text-right">
					<i class="fa  fa-angle-double-up text-muted">
					</i>
				</th>
				</tr>
			</thead>