Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • smradius/smradius
  • centiva-shail/smradius
  • nkukard/smradius
3 results
Show changes
Showing
with 240 additions and 162 deletions
<?php
# Web Admin UI Config
# Copyright (C) 2007-2009, AllWorldIT
# Copyright (C) 2007-2015, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
<?php
# Database Interface
# Copyright (C) 2007-2009, AllWorldIT
# Copyright (C) 2007-2015, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
<?php
# Radius term code mappings
# Copyright (C) 2007-2009, AllWorldIT
# Copyright (C) 2007-2015, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
<?php
# Utility functions
# Copyright (C) 2010-2015, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
## @fn isBoolean($param)
# Check if a variable is boolean
#
# @param var Variable to check
#
# @return 1, 0 or -1 on unknown
function isBoolean($param) {
# Check if we're set
if (!isset($param)) {
return -1;
}
# If it's already bool, just return it
if (is_bool($param)) {
return $param;
}
# If it's a string..
if (is_string($param)) {
# Nuke whitespaces
trim($param);
# Allow true, on, set, enabled, 1, false, off, unset, disabled, 0
if (preg_match('/^(?:true|on|set|enabled|1)$/i', $param)) {
return 1;
}
if (preg_match('/^(?:false|off|unset|disabled|0)$/i', $param)) {
return 0;
}
}
# Invalid or unknown
return -1;
}
# vim: ts=4
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
#loading-mask{
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:20000;
background-color:white;
}
#loading{
position:absolute;
left:45%;
top:40%;
padding:2px;
z-index:20001;
height:auto;
}
#loading a {
color:#225588;
}
#loading .loading-indicator{
background:white;
color:#444;
font:bold 13px tahoma,arial,helvetica;
padding:10px;
margin:0;
height:auto;
}
#loading-msg {
font: normal 10px arial,tahoma,sans-serif;
}
</style>
</head>
<body>
<div id="loading-mask" style=""></div>
<div id="loading">
<div class="loading-indicator">
<img src="resources/extjs/images/extanim32.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>
SMRadius WebGUI - <a href="http://smradius.org">smradius.org</a><br /><span id="loading-msg">Loading styles and images...</span>
</div>
</div>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading stylesheets...';</script>
<link rel="stylesheet" type="text/css" href="resources/extjs/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="resources/custom/css/silk-icons.css" />
<link rel="stylesheet" type="text/css" href="icons.css" />
<link rel="stylesheet" type="text/css" href="resources/extjs/css/examples.css" />
<link rel="stylesheet" type="text/css" href="js/custom/GridFilters/icons/style.css" />
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading core API...';</script>
<script type="text/javascript" src="js/extjs/ext-base.js"></script>
<script type="text/javascript" src="js/extjs/ext-all.js"></script>
<!--
Our own libraries
-->
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading libraries...';</script>
<script type="text/javascript" src="js/custom/util.js"></script>
<script type="text/javascript" src="js/custom/sprintf.js"></script>
<script type="text/javascript" src="js/custom/regexes.js"></script>
<script type="text/javascript" src="js/custom/vtypes.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/GridFilters.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/menu/EditableItem.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/menu/RangeMenu.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/Filter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/StringFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/DateFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/ListFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/NumericFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/filter/BooleanFilter.js"></script>
<script type="text/javascript" src="js/custom/ProgressFormPanel.js"></script>
<script type="text/javascript" src="js/custom/StatusBar.js"></script>
<script type="text/javascript" src="js/custom/common.js"></script>
<script type="text/javascript" src="js/custom/generic.js"></script>
<!--
Main application
-->
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading configuration...';</script>
<script type="text/javascript" src="js/app/config.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading menus...';</script>
<script type="text/javascript" src="js/app/menus.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading windows...';</script>
<script type="text/javascript" src="js/app/windows/WiSPUsers.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPUserLogs.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPUserTopups.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPLocations.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPLocationMembers.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPResellers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUsers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserLogs.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserGroups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserTopups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealms.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealmAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealmMembers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClients.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClientAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClientRealms.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroupAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroupMembers.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading layout...';</script>
<script type="text/javascript" src="js/app/main-layout.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Starting...';</script>
<script type="text/javascript" src="js/app/main.js"></script>
</body>
</html>
<!-- Index.html - load all our code
Copyright (C) 2007-2015, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
#loading-mask{
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:20000;
background-color:white;
}
#loading{
position:absolute;
left:45%;
top:40%;
padding:2px;
z-index:20001;
height:auto;
}
#loading a {
color:#225588;
}
#loading .loading-indicator{
background:white;
color:#444;
font:bold 13px tahoma,arial,helvetica;
padding:10px;
margin:0;
height:auto;
}
#loading-msg {
font: normal 10px arial,tahoma,sans-serif;
}
</style>
</head>
<body>
<div id="loading-mask" style=""></div>
<div id="loading">
<div class="loading-indicator">
<img src="awitef/resources/extjs/images/extanim32.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>
SMRadius WebGUI - <a href="http://smradius.org">smradius.org</a><br /><span id="loading-msg">Loading styles and images...</span>
</div>
</div>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading stylesheets...';</script>
<link rel="stylesheet" type="text/css" href="awitef/resources/extjs/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="awitef/resources/custom/css/silk-icons.css" />
<link rel="stylesheet" type="text/css" href="icons.css" />
<link rel="stylesheet" type="text/css" href="awitef/resources/extjs/css/examples.css" />
<link rel="stylesheet" type="text/css" href="awitef/js/custom/GridFilters/icons/style.css" />
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading core API...';</script>
<script type="text/javascript" src="awitef/js/extjs/ext-base.js"></script>
<script type="text/javascript" src="awitef/js/extjs/ext-all.js"></script>
<!--
Our own libraries
-->
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading libraries...';</script>
<script type="text/javascript" src="awitef/js/custom/util.js"></script>
<script type="text/javascript" src="awitef/js/custom/sprintf.js"></script>
<script type="text/javascript" src="awitef/js/custom/regexes.js"></script>
<script type="text/javascript" src="awitef/js/custom/vtypes.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/GridFilters.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/menu/EditableItem.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/menu/RangeMenu.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/Filter.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/StringFilter.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/DateFilter.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/ListFilter.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/NumericFilter.js"></script>
<script type="text/javascript" src="awitef/js/custom/GridFilters/filter/BooleanFilter.js"></script>
<script type="text/javascript" src="awitef/js/custom/ProgressFormPanel.js"></script>
<script type="text/javascript" src="awitef/js/custom/StatusBar.js"></script>
<script type="text/javascript" src="awitef/js/custom/common.js"></script>
<script type="text/javascript" src="awitef/js/custom/generic.js"></script>
<!--
Main application
-->
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading configuration...';</script>
<script type="text/javascript" src="js/app/config.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading menus...';</script>
<script type="text/javascript" src="js/app/menus.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading windows...';</script>
<script type="text/javascript" src="js/app/windows/WiSPUsers.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPUserLogs.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPUserTopups.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPLocations.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPLocationMembers.js"></script>
<script type="text/javascript" src="js/app/windows/WiSPResellers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUsers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserLogs.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserGroups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminUserTopups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealms.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealmAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminRealmMembers.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClients.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClientAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminClientRealms.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroups.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroupAttributes.js"></script>
<script type="text/javascript" src="js/app/windows/AdminGroupMembers.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading layout...';</script>
<script type="text/javascript" src="js/app/main-layout.js"></script>
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Starting...';</script>
<script type="text/javascript" src="js/app/main.js"></script>
</body>
</html>
/*
Webgui Global Config
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Webgui Main Layout
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Webgui Menus
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Client Attributes
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -269,9 +269,9 @@ function showAdminClientAttributeAddEditWindow(AdminClientAttributesWindow,clien
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......
/*
Admin Client Realms
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Clients
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Group Attributes
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -268,9 +268,9 @@ function showAdminGroupAttributeAddEditWindow(AdminGroupAttributesWindow,groupID
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......
/*
Admin Group Members
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Groups
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Realm Attributes
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -269,9 +269,9 @@ function showAdminRealmAttributeAddEditWindow(AdminRealmAttributesWindow,realmID
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......
/*
Admin Realm Members
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin Realms
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin User Attributes
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -271,9 +271,9 @@ function showAdminUserAttributeAddEditWindow(AdminUserAttributesWindow,userID,at
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......
/*
Admin User Groups
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*
Admin User Logs
Copyright (C) 2007-2009, AllWorldIT
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -292,14 +292,16 @@ function showAdminUserLogsWindow(id) {
// Topups
var trafficTopups = response.data.trafficTopups;
var uptimeTopups = response.data.uptimeTopups;
var totalTrafficTopups = response.data.TotalTrafficTopups;
var totalUptimeTopups = response.data.TotalUptimeTopups;
// Format string before printing
var trafficString = '';
// Prepaid traffic
if (trafficCap == -1) {
trafficCap = 'Prepaid';
trafficString += sprintf('Traffic:\nCap: %s \nTopup: %d MB\nUsage: %d/%d MB\n',
trafficCap,trafficTopups,trafficUsage,trafficTopups);
trafficString += sprintf('Traffic:\nCap: %s \nTopup balance for current month: %d MB\nTotal Topups: %d MB\nUsage: %d/%d MB\n',
trafficCap,trafficTopups,totalTrafficTopups,trafficUsage,trafficTopups);
trafficString += '---\n';
// Uncapped traffic
} else if (trafficCap == 0) {
......@@ -309,9 +311,9 @@ function showAdminUserLogsWindow(id) {
// Capped traffic
} else {
var combinedTrafficCap = trafficCap + trafficTopups;
trafficString += sprintf('Traffic:\nCap: %d MB\nTopup: %d MB\n'+
trafficString += sprintf('Traffic:\nCap: %d MB\nTopup balance for current month: %d MB\nTotal Topups: %d MB\n'+
'Usage: %d/%d MB\n',
trafficCap,trafficTopups,trafficUsage,combinedTrafficCap);
trafficCap,trafficTopups,totalTrafficTopups,trafficUsage,combinedTrafficCap);
trafficString += '---\n';
}
......@@ -320,9 +322,9 @@ function showAdminUserLogsWindow(id) {
// Prepaid uptime
if (uptimeCap == -1) {
uptimeCap = 'Prepaid';
uptimeString += sprintf('Uptime:\nCap: %s \nTopup: %d Min\n'+
uptimeString += sprintf('Uptime:\nCap: %s \nTopup balance for current month: %d Min\nTotal Topups: %d Min\n'+
'Usage: %d/%d Min\n',
uptimeCap,uptimeTopups,uptimeUsage,uptimeTopups);
uptimeCap,uptimeTopups,totalUptimeTopups,uptimeUsage,uptimeTopups);
uptimeString += '---\n';
// Uncapped uptime
} else if (uptimeCap == 0) {
......@@ -332,9 +334,9 @@ function showAdminUserLogsWindow(id) {
// Capped uptime
} else {
var combinedUptimeCap = uptimeCap + uptimeTopups;
uptimeString += sprintf('Uptime:\nCap: %d Min\nTopup: %d Min\n'+
uptimeString += sprintf('Uptime:\nCap: %d Min\nTopup balance for current month: %d Min\nTotal Topups: %d Min\n'+
'Usage: %d/%d Min\n',
uptimeCap,uptimeTopups,uptimeUsage,combinedUptimeCap);
uptimeCap,uptimeTopups,totalUptimeTopups,uptimeUsage,combinedUptimeCap);
uptimeString += '---\n';
}
......