Radius Add NAS

This commit is contained in:
Ibnu Maksum 2023-09-18 16:25:47 +07:00
parent 64a9e38cce
commit e64f27bc63
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 80 additions and 6 deletions

View File

@ -101,12 +101,12 @@ try {
$http_proxyauth = $config['http_proxyauth'];
}
}
if ($config['radius_mode']) {
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
ORM::configure('username', $radius_user, 'radius');
ORM::configure('password', $radius_password, 'radius');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
ORM::configure('return_result_sets', true, 'radius');
if (!empty($radius_user)) {
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'rad');
ORM::configure('username', $radius_user, 'rad');
ORM::configure('password', $radius_pass, 'rad');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'rad');
ORM::configure('return_result_sets', true, 'rad');
}
} catch (Exception $e) {
$ui = new Smarty();

72
ui/ui/radius-nas.tpl Normal file
View File

@ -0,0 +1,72 @@
{include file="sections/header.tpl"}
<!-- pool -->
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">
Radius
</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}radius/nas-list">
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control"
placeholder="{$_L['Search_by_Name']}...">
<div class="input-group-btn">
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}radius/nas-add" class="btn btn-primary btn-block waves-effect"><i
class="ion ion-android-add"> </i> New NAS</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>IP</th>
<th>Type</th>
<th>Port</th>
<th>Server</th>
<th>Community</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $nas as $ds}
<tr>
<td align="center">{$no++}</td>
<td>{$ds['shortname']}</td>
<td>{$ds['nasname']}</td>
<td>{$ds['type']}</td>
<td>{$ds['ports']}</td>
<td>{$ds['server']}</td>
<td>{$ds['community']}</td>
<td align="center">
<a href="{$_url}radius/nas-edit/{$ds['id']}" class="btn btn-info btn-xs">{$_L['Edit']}</a>
<a href="{$_url}radius/nas-delete/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{$_L['Delete']}?')"
class="btn btn-danger btn-xs">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -199,6 +199,8 @@
<ul class="treeview-menu">
<li {if $_routes[0] eq 'routers' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}routers/list">{$_L['Routers']}</a></li>
<li {if $_routes[1] eq 'nas-list' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}radius/nas-list">Radius NAS</a></li>
<li {if $_routes[0] eq 'pool' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}pool/list">{$_L['Pool']}</a></li>
{$_MENU_NETWORK}