2015-02-16 09:30:58 +00:00
|
|
|
<?php
|
|
|
|
|
2015-02-25 13:06:48 +00:00
|
|
|
/**
|
|
|
|
* Raspbian WiFi Configuration Portal
|
|
|
|
*
|
|
|
|
* Enables use of simple web interface rather than SSH to control wifi and hostapd on the Raspberry Pi.
|
2019-08-20 09:18:12 +00:00
|
|
|
* Recommended distribution is Raspbian Buster Lite. Specific instructions to install the supported software are
|
2015-02-25 13:06:48 +00:00
|
|
|
* in the README and original post by @SirLagz. For a quick run through, the packages required for the WebGUI are:
|
2019-08-20 09:18:12 +00:00
|
|
|
* lighttpd (I have version 1.4.53 installed via apt)
|
|
|
|
* php-cgi (I have version 7.1.20-1+b2 installed via apt)
|
|
|
|
* along with their supporting packages, php7.1 will also need to be enabled.
|
2019-04-10 08:37:35 +00:00
|
|
|
*
|
2017-10-03 04:32:30 +00:00
|
|
|
* @author Lawrence Yau <sirlagz@gmail.com>
|
2015-02-25 13:06:48 +00:00
|
|
|
* @author Bill Zimmerman <billzimmerman@gmail.com>
|
2016-06-14 19:00:17 +00:00
|
|
|
* @license GNU General Public License, version 3 (GPL-3.0)
|
2019-10-10 17:17:39 +00:00
|
|
|
* @version 1.6.2
|
2016-06-14 19:00:17 +00:00
|
|
|
* @link https://github.com/billz/raspap-webgui
|
2015-02-25 13:06:48 +00:00
|
|
|
* @see http://sirlagz.net/2013/02/08/raspap-webgui/
|
|
|
|
*/
|
|
|
|
|
2019-08-06 19:34:58 +00:00
|
|
|
require('includes/csrf.php');
|
2019-08-07 21:53:04 +00:00
|
|
|
ensureCSRFSessionToken();
|
2018-05-29 18:52:41 +00:00
|
|
|
|
2019-04-10 08:37:35 +00:00
|
|
|
include_once('includes/config.php');
|
|
|
|
include_once(RASPI_CONFIG.'/raspap.php');
|
|
|
|
include_once('includes/locale.php');
|
|
|
|
include_once('includes/functions.php');
|
|
|
|
include_once('includes/dashboard.php');
|
|
|
|
include_once('includes/authenticate.php');
|
|
|
|
include_once('includes/admin.php');
|
|
|
|
include_once('includes/dhcp.php');
|
|
|
|
include_once('includes/hostapd.php');
|
|
|
|
include_once('includes/system.php');
|
|
|
|
include_once('includes/configure_client.php');
|
|
|
|
include_once('includes/networking.php');
|
|
|
|
include_once('includes/themes.php');
|
|
|
|
include_once('includes/data_usage.php');
|
|
|
|
include_once('includes/about.php');
|
2015-02-25 13:06:48 +00:00
|
|
|
|
2015-02-16 09:30:58 +00:00
|
|
|
$output = $return = 0;
|
|
|
|
$page = $_GET['page'];
|
2016-06-24 21:39:39 +00:00
|
|
|
|
2019-04-10 08:37:35 +00:00
|
|
|
if (!isset($_COOKIE['theme'])) {
|
2017-10-09 14:04:59 +00:00
|
|
|
$theme = "custom.css";
|
2017-10-06 23:08:06 +00:00
|
|
|
} else {
|
2017-10-09 14:04:59 +00:00
|
|
|
$theme = $_COOKIE['theme'];
|
2017-10-06 23:08:06 +00:00
|
|
|
}
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2019-10-08 17:35:32 +00:00
|
|
|
$theme_url = 'app/css/'.htmlspecialchars($theme, ENT_QUOTES);
|
2018-07-31 21:51:15 +00:00
|
|
|
|
|
|
|
?><!DOCTYPE html>
|
2015-02-25 13:06:48 +00:00
|
|
|
<html lang="en">
|
2016-07-27 20:34:56 +00:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2019-07-30 15:22:03 +00:00
|
|
|
<?php echo CSRFMetaTag() ?>
|
2015-02-25 13:06:48 +00:00
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="author" content="">
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2019-08-20 09:18:12 +00:00
|
|
|
<title><?php echo _("RaspAP WiFi Configuration Portal"); ?></title>
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2015-02-25 13:06:48 +00:00
|
|
|
<!-- Bootstrap Core CSS -->
|
2019-10-11 19:37:59 +00:00
|
|
|
<link href="dist/bootstrap/css/bootstrap.css" rel="stylesheet">
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2019-03-06 10:43:36 +00:00
|
|
|
<!-- Bootstrap Toggle CSS -->
|
2019-10-15 00:17:42 +00:00
|
|
|
<link href="dist/bootstrap4-toggle/css/bootstrap4-toggle.min.css" rel="stylesheet">
|
2019-03-06 10:43:36 +00:00
|
|
|
|
2019-10-08 18:22:55 +00:00
|
|
|
<!-- SB-Admin-2 CSS -->
|
2019-10-08 17:35:32 +00:00
|
|
|
<link href="dist/sb-admin-2/css/sb-admin-2.min.css" rel="stylesheet">
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2015-02-25 13:06:48 +00:00
|
|
|
<!-- Custom Fonts -->
|
2019-10-11 19:37:59 +00:00
|
|
|
<link href="dist/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2015-02-25 13:06:48 +00:00
|
|
|
<!-- Custom CSS -->
|
2017-10-06 23:08:06 +00:00
|
|
|
<link href="<?php echo $theme_url; ?>" title="main" rel="stylesheet">
|
2015-02-16 09:30:58 +00:00
|
|
|
|
2019-10-08 17:35:32 +00:00
|
|
|
<link rel="shortcut icon" type="image/png" href="app/icons/favicon.png?ver=2.0">
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href="app/icons/apple-touch-icon.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="32x32" href="app/icons/favicon-32x32.png">
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href="app/icons/favicon-16x16.png">
|
|
|
|
<link rel="icon" type="image/png" href="app/icons/favicon.png" />
|
|
|
|
<link rel="manifest" href="app/icons/site.webmanifest">
|
|
|
|
<link rel="mask-icon" href="app/icons/safari-pinned-tab.svg" color="#b91d47">
|
|
|
|
<meta name="msapplication-config" content="app/icons/browserconfig.xml">
|
2019-04-23 21:30:00 +00:00
|
|
|
<meta name="msapplication-TileColor" content="#b91d47">
|
|
|
|
<meta name="theme-color" content="#ffffff">
|
2015-02-25 13:06:48 +00:00
|
|
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
|
|
|
<![endif]-->
|
2016-07-27 20:34:56 +00:00
|
|
|
</head>
|
2019-10-11 19:37:59 +00:00
|
|
|
<body id="page-top">
|
2019-10-12 23:25:35 +00:00
|
|
|
<!-- Page Wrapper -->
|
2016-07-27 20:34:56 +00:00
|
|
|
<div id="wrapper">
|
2019-10-11 19:37:59 +00:00
|
|
|
<!-- Sidebar -->
|
|
|
|
<ul class="navbar-nav bg-gray-100 sidebar sidebar-light accordion" id="accordionSidebar">
|
|
|
|
<!-- Sidebar - Brand -->
|
2019-10-15 00:17:42 +00:00
|
|
|
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.php?page=wlan0_info">
|
2019-10-11 19:37:59 +00:00
|
|
|
<div class="sidebar-brand-icon">
|
|
|
|
<img src="app/img/raspAP-logo64px.png" width="32" height="32">
|
|
|
|
</div>
|
2019-10-12 22:04:27 +00:00
|
|
|
<div class="sidebar-brand-text ml-1">RaspAP</div>
|
2019-10-11 19:37:59 +00:00
|
|
|
</a>
|
|
|
|
<!-- Divider -->
|
|
|
|
<hr class="sidebar-divider my-0">
|
2019-10-12 23:25:35 +00:00
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=wlan0_info"><i class="fas fa-tachometer-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("Dashboard"); ?></span></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php if (RASPI_WIFICLIENT_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=wpa_conf"><i class="fas fa-wifi fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure WiFi client"); ?></span></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_HOTSPOT_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=hostapd_conf"><i class="far fa-dot-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure hotspot"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_NETWORK_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-15 12:43:47 +00:00
|
|
|
<a class="nav-link" href="index.php?page=network_conf"><i class="fas fa-network-wired fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure networking"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_DHCP_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=dhcpd_conf"><i class="fas fa-exchange-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure DHCP Server"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_OPENVPN_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=openvpn_conf"><i class="fas fa-lock fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure OpenVPN"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_TORPROXY_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=torproxy_conf"><i class="fas fa-eye-slash fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure TOR proxy"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_CONFAUTH_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=auth_conf"><i class="fas fa-lock fa-fw mr-2"></i><span class="nav-label"><?php echo _("Configure Auth"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_CHANGETHEME_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=theme_conf"><i class="fas fa-paint-brush fa-fw mr-2"></i><span class="nav-label"><?php echo _("Change Theme"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (RASPI_VNSTAT_ENABLED) : ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=data_use"><i class="fas fa-chart-bar fa-fw mr-2"></i><span class="nav-label"><?php echo _("Data usage"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=system_info"><i class="fas fa-cube fa-fw mr-2"></i><span class="nav-label"><?php echo _("System"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
2019-10-13 22:48:09 +00:00
|
|
|
<a class="nav-link" href="index.php?page=about"><i class="fas fa-info-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("About RaspAP"); ?></a>
|
2019-10-12 23:25:35 +00:00
|
|
|
</li>
|
|
|
|
<hr class="sidebar-divider d-none d-md-block">
|
|
|
|
<!-- Sidebar Toggler (Sidebar) -->
|
|
|
|
<div class="text-center d-none d-md-inline">
|
|
|
|
<button class="rounded-circle border-0" id="sidebarToggle"></button>
|
2019-10-11 19:37:59 +00:00
|
|
|
</div>
|
2019-10-13 22:48:09 +00:00
|
|
|
</ul>
|
|
|
|
<!-- End of Sidebar -->
|
2016-07-27 20:34:56 +00:00
|
|
|
|
2019-10-13 22:48:09 +00:00
|
|
|
<!-- Content Wrapper -->
|
|
|
|
<div id="content-wrapper" class="d-flex flex-column">
|
|
|
|
<!-- Main Content -->
|
|
|
|
<div id="content">
|
|
|
|
<!-- Topbar -->
|
|
|
|
<nav class="navbar navbar-expand navbar-light bg-gray-100 topbar mb-1 static-top">
|
|
|
|
<!-- Sidebar Toggle (Topbar) -->
|
|
|
|
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
|
|
|
|
<i class="fa fa-bars"></i>
|
|
|
|
</button>
|
|
|
|
<!-- Topbar Navbar -->
|
2018-09-10 14:53:05 +00:00
|
|
|
|
2019-10-13 22:48:09 +00:00
|
|
|
<p class="text-left brand-title"><?php //echo _("WiFi Configuration Portal"); ?></p>
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
<div class="topbar-divider d-none d-sm-block"></div>
|
|
|
|
<!-- Nav Item - User -->
|
|
|
|
<li class="nav-item dropdown no-arrow">
|
|
|
|
<a class="nav-link" href="index.php?page=auth_conf">
|
|
|
|
<span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo htmlspecialchars($config['admin_user'], ENT_QUOTES); ?></span>
|
|
|
|
<i class="fas fa-user-circle fa-3x"></i>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<!-- End of Topbar -->
|
|
|
|
<!-- Begin Page Content -->
|
|
|
|
<div class="container-fluid">
|
|
|
|
<?php
|
|
|
|
$extraFooterScripts = array();
|
|
|
|
// handle page actions
|
|
|
|
switch ($page) {
|
|
|
|
case "wlan0_info":
|
|
|
|
DisplayDashboard();
|
|
|
|
break;
|
|
|
|
case "dhcpd_conf":
|
|
|
|
DisplayDHCPConfig();
|
|
|
|
break;
|
|
|
|
case "wpa_conf":
|
|
|
|
DisplayWPAConfig();
|
|
|
|
break;
|
|
|
|
case "network_conf":
|
|
|
|
DisplayNetworkingConfig();
|
|
|
|
break;
|
|
|
|
case "hostapd_conf":
|
|
|
|
DisplayHostAPDConfig();
|
|
|
|
break;
|
|
|
|
case "openvpn_conf":
|
|
|
|
DisplayOpenVPNConfig();
|
|
|
|
break;
|
|
|
|
case "torproxy_conf":
|
|
|
|
DisplayTorProxyConfig();
|
|
|
|
break;
|
|
|
|
case "auth_conf":
|
|
|
|
DisplayAuthConfig($config['admin_user'], $config['admin_pass']);
|
|
|
|
break;
|
|
|
|
case "save_hostapd_conf":
|
|
|
|
SaveTORAndVPNConfig();
|
|
|
|
break;
|
|
|
|
case "theme_conf":
|
|
|
|
DisplayThemeConfig();
|
|
|
|
break;
|
|
|
|
case "data_use":
|
|
|
|
DisplayDataUsage($extraFooterScripts);
|
|
|
|
break;
|
|
|
|
case "system_info":
|
|
|
|
DisplaySystem();
|
|
|
|
break;
|
|
|
|
case "about":
|
|
|
|
DisplayAbout();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DisplayDashboard();
|
|
|
|
}
|
|
|
|
?>
|
2019-10-12 23:25:35 +00:00
|
|
|
</div><!-- /.container-fluid -->
|
|
|
|
</div><!-- End of Main Content -->
|
|
|
|
<!-- Footer -->
|
|
|
|
<footer class="sticky-footer bg-grey-100">
|
|
|
|
<div class="container my-auto">
|
|
|
|
<div class="copyright text-center my-auto">
|
|
|
|
<span></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
<!-- End Footer -->
|
|
|
|
</div><!-- End of Content Wrapper -->
|
|
|
|
</div><!-- End of Page Wrapper -->
|
|
|
|
<!-- Scroll to Top Button-->
|
|
|
|
<a class="scroll-to-top rounded" href="#page-top" style="display: inline;">
|
|
|
|
<i class="fas fa-angle-up"></i>
|
|
|
|
</a>
|
2015-02-25 13:06:48 +00:00
|
|
|
|
|
|
|
<!-- jQuery -->
|
2019-10-08 17:35:32 +00:00
|
|
|
<script src="dist/jquery/jquery.min.js"></script>
|
2015-02-25 13:06:48 +00:00
|
|
|
|
|
|
|
<!-- Bootstrap Core JavaScript -->
|
2019-10-12 23:25:35 +00:00
|
|
|
<script src="dist/bootstrap/js/bootstrap.bundle.min.js"></script>
|
|
|
|
|
|
|
|
<!-- Core plugin JavaScript -->
|
|
|
|
<script src="dist/jquery-easing/jquery.easing.min.js"></script>
|
2015-02-25 13:06:48 +00:00
|
|
|
|
2019-03-06 10:43:36 +00:00
|
|
|
<!-- Bootstrap Toggle JavaScript -->
|
2019-10-15 00:17:42 +00:00
|
|
|
<script src="dist/bootstrap4-toggle/js/bootstrap4-toggle.min.js"></script>
|
2019-03-06 10:43:36 +00:00
|
|
|
|
2019-10-11 19:37:59 +00:00
|
|
|
<!-- Chart.js JavaScript -->
|
|
|
|
<script src="dist/chart.js/Chart.min.js"></script>
|
2015-02-25 13:06:48 +00:00
|
|
|
|
2019-10-08 18:22:55 +00:00
|
|
|
<!-- SB-Admin-2 JavaScript -->
|
2019-10-08 17:35:32 +00:00
|
|
|
<script src="dist/sb-admin-2/js/sb-admin-2.js"></script>
|
2017-10-27 18:40:30 +00:00
|
|
|
|
|
|
|
<!-- Custom RaspAP JS -->
|
2019-10-08 17:35:32 +00:00
|
|
|
<script src="app/js/custom.js"></script>
|
2018-09-10 14:53:05 +00:00
|
|
|
|
2019-10-14 10:33:02 +00:00
|
|
|
<!-- Link Quality Chart -->
|
|
|
|
<script src="app/js/linkquality.js"></script>
|
|
|
|
|
2019-10-12 23:25:35 +00:00
|
|
|
<?php
|
|
|
|
// Load non default JS/ECMAScript in footer.
|
|
|
|
foreach ($extraFooterScripts as $script) {
|
|
|
|
echo ' <script type="text/javascript" src="' , $script['src'] , '"';
|
|
|
|
if ($script['defer']) {
|
|
|
|
echo ' defer="defer"';
|
|
|
|
}
|
2018-09-10 14:53:05 +00:00
|
|
|
|
2019-10-12 23:25:35 +00:00
|
|
|
// if ($script['async']) { echo ( echo ' defer="async"'; ), intrigity=, nonce= etc. etc.
|
|
|
|
echo '></script>' , PHP_EOL;
|
|
|
|
}
|
2018-09-10 14:53:05 +00:00
|
|
|
|
2019-10-12 23:25:35 +00:00
|
|
|
?>
|
2016-07-27 20:34:56 +00:00
|
|
|
</body>
|
2015-02-25 13:06:48 +00:00
|
|
|
</html>
|