Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
6fedf142
Commit
6fedf142
authored
16 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
* Few changes testing
parent
b04c8850
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webui/agent-control-panel/include/db.php
+0
-22
0 additions, 22 deletions
webui/agent-control-panel/include/db.php
webui/agent-control-panel/radius-user-main.php
+67
-124
67 additions, 124 deletions
webui/agent-control-panel/radius-user-main.php
with
67 additions
and
146 deletions
webui/agent-control-panel/include/db.php
+
0
−
22
View file @
6fedf142
...
...
@@ -25,27 +25,5 @@ function connect_db()
}
# Connect to postfix DB
function
connect_postfix_db
()
{
global
$DB_POSTFIX_DSN
;
global
$DB_POSTFIX_USER
;
global
$DB_POSTFIX_PASS
;
try
{
$dbh
=
new
PDO
(
$DB_POSTFIX_DSN
,
$DB_POSTFIX_USER
,
$DB_POSTFIX_PASS
,
array
(
PDO
::
ATTR_PERSISTENT
=>
false
));
$dbh
->
setAttribute
(
PDO
::
ATTR_CASE
,
PDO
::
CASE_LOWER
);
}
catch
(
PDOException
$e
)
{
die
(
"Error connecting to Postfix DB: "
.
$e
->
getMessage
());
}
return
$dbh
;
}
# vim: ts=4
?>
This diff is collapsed.
Click to expand it.
webui/agent-control-panel/radius-user-main.php
+
67
−
124
View file @
6fedf142
...
...
@@ -72,32 +72,6 @@ function displaySearch() {
?>
/>
</td>
</tr>
<tr>
<td
class=
"title"
>
Service
</td>
<td
class=
"entry"
></td>
<td
align=
"center"
><input
type=
"radio"
name=
"searchOrderBy"
value=
"Service"
<?php
if
(
isset
(
$_SESSION
[
'radiusUser_searchOrderBy'
])
&&
$_SESSION
[
'radiusUser_searchOrderBy'
]
==
"Service"
)
{
echo
"checked"
;
}
?>
/>
</td>
</tr>
<tr>
<td
class=
"title"
>
Agent Ref
</td>
<td
class=
"entry"
>
<input
type=
"text"
name=
"searchAgentRef"
value=
"
<?php
if
(
isset
(
$_SESSION
[
'radiusUser_searchAgentRef'
]))
{
echo
$_SESSION
[
'radiusUser_searchAgentRef'
];
}
?>
"
/>
</td>
<td
align=
"center"
><input
type=
"radio"
name=
"searchOrderBy"
value=
"AgentRef"
<?php
if
(
isset
(
$_SESSION
[
'radiusUser_searchOrderBy'
])
&&
$_SESSION
[
'radiusUser_searchOrderBy'
]
==
"AgentRef"
)
{
echo
"checked"
;
}
?>
/>
</td>
</tr>
</table>
<div
class=
"text-center"
>
<input
type=
"submit"
/>
...
...
@@ -123,113 +97,82 @@ function displaySearchResults($searchOptions)
global
$userID
;
?>
<div
class=
"sectiontitle"
>
Radius User Search Results
</div>
<p
/>
<form
id=
"main_form"
action=
"radius-user-main.php"
method=
"post"
>
<div
class=
"text-center"
>
Action
<select
id=
"main_form_action"
name=
"frmaction"
onchange=
"
var myform = document.getElementById('main_form');
var myobj = document.getElementById('main_form_action');
if (myobj.selectedIndex == 2) {
myform.action = 'radius-user-change.php';
} else if (myobj.selectedIndex == 3) {
myform.action = 'radius-user-delete.php';
} else if (myobj.selectedIndex == 4) {
myform.action = 'radius-user-info.php';
} else if (myobj.selectedIndex == 5) {
myform.action = 'radius-user-logs.php';
} else if (myobj.selectedIndex == 6) {
myform.action = 'radius-user-topup-add.php';
} else if (myobj.selectedIndex == 7) {
myform.action = 'radius-user-topup-main.php';
} else if (myobj.selectedIndex == 8) {
myform.action = 'radius-user-portlock-main.php';
} else if (myobj.selectedIndex == 10) {
myform.action = 'radius-user-add.php';
}
myform.submit();
"
>
<option
selected=
"selected"
>
select action
</option>
<option
disabled=
"disabled"
>
- T H I S - U S E R -
</option>
<option
value=
"change_main"
>
Change
</option>
<option
value=
"delete_main"
>
Delete
</option>
<option
value=
"info_main"
>
Info
</option>
<option
value=
"logs_main"
>
Logs
</option>
<option
value=
"topups_add_main"
>
Topups: Add
</option>
<option
value=
"topups_main"
>
Topups: Search
</option>
<option
value=
"portlocks_main"
>
Port Locking
</option>
<option
disabled=
"disabled"
>
- - - - - - - - - - -
</option>
<option
value=
"add_main"
>
Add User
</option>
</select>
</div>
<table
class=
"resulttable"
>
<tr>
<td></td>
<td
class=
"title"
>
Username
</td>
<td
class=
"title"
>
Service Class
</td>
<td
class=
"title"
>
UsageCap
</td>
<td
class=
"title"
>
AgentRef
</td>
<td
class=
"title"
>
Disabled
</td>
</tr>
<div
class=
"sectiontitle"
>
Radius User Search Results
</div>
<p
/>
<form
id=
"main_form"
action=
"radius-user-main.php"
method=
"post"
>
<div
class=
"text-center"
>
Action
<select
id=
"main_form_action"
name=
"frmaction"
onchange=
"
var myform = document.getElementById('main_form');
var myobj = document.getElementById('main_form_action');
if (myobj.selectedIndex == 2) {
myform.action = 'radius-user-change.php';
} else if (myobj.selectedIndex == 3) {
myform.action = 'radius-user-delete.php';
} else if (myobj.selectedIndex == 4) {
myform.action = 'radius-user-info.php';
} else if (myobj.selectedIndex == 5) {
myform.action = 'radius-user-logs.php';
} else if (myobj.selectedIndex == 6) {
myform.action = 'radius-user-topup-add.php';
} else if (myobj.selectedIndex == 7) {
myform.action = 'radius-user-topup-main.php';
} else if (myobj.selectedIndex == 8) {
myform.action = 'radius-user-portlock-main.php';
} else if (myobj.selectedIndex == 10) {
myform.action = 'radius-user-add.php';
}
myform.submit();
"
>
<option
selected=
"selected"
>
select action
</option>
<option
disabled=
"disabled"
>
- T H I S - U S E R -
</option>
<option
value=
"change_main"
>
Change
</option>
<option
value=
"delete_main"
>
Delete
</option>
<option
value=
"info_main"
>
Info
</option>
<option
value=
"logs_main"
>
Logs
</option>
<option
value=
"topups_add_main"
>
Topups: Add
</option>
<option
value=
"topups_main"
>
Topups: Search
</option>
<option
value=
"portlocks_main"
>
Port Locking
</option>
<option
disabled=
"disabled"
>
- - - - - - - - - - -
</option>
<option
value=
"add_main"
>
Add User
</option>
</select>
</div>
<table
class=
"resulttable"
>
<tr>
<td></td>
<td
class=
"title"
>
Username
</td>
<td
class=
"title"
>
Service Class
</td>
<td
class=
"title"
>
UsageCap
</td>
<td
class=
"title"
>
AgentRef
</td>
<td
class=
"title"
>
Disabled
</td>
</tr>
<?php
foreach
(
$userList
as
$user
)
{
$sql
=
"SELECT ID, Username, Disabled FROM ${DB_TABLE_PREFIX}users ORDER BY ID ASC"
;
$res
=
$db
->
query
(
$sql
);
while
(
$row
=
$res
->
fetchObject
())
{
?>
<tr>
<td><input
type=
"radio"
name=
"user_id"
value=
"
<?php
echo
$user
->
ID
?>
"
/></td>
<td>
<?php
echo
$user
->
Username
;
?>
</td>
<td>
<?php
echo
$user
->
Service
;
?>
</td>
<td
class=
"text-right"
>
<?php
echo
$usageCap
;
?>
</td>
<td>
<?php
echo
$user
->
AgentRef
;
?>
</td>
<td
align=
"center"
>
<?php
echo
$user
->
AgentDisabled
?
"yes"
:
"no"
;
?>
</td>
</tr>
<tr>
<td><input
type=
"radio"
name=
"user_id"
value=
"
<?php
echo
$row
->
id
;
?>
"
/></td>
<td>
<?php
echo
$row
->
username
;
?>
</td>
<td
align=
"center"
>
<?php
echo
$row
->
disabled
?
"yes"
:
"no"
;
?>
</td>
</tr>
<?php
}
}
$res
->
closeCursor
();
?>
</table>
</form>
</table>
</form>
<?php
}
else
{
displayError
(
"getRadiusUsers: "
.
strSoapError
(
$userList
));
}
}
# Check if we have an action
if
(
!
isset
(
$_REQUEST
[
'frmaction'
]))
{
displaySearch
();
}
elseif
(
$_REQUEST
[
'frmaction'
]
==
"search_main"
)
{
# Process search options
if
(
isset
(
$_REQUEST
[
'searchUsername'
]))
{
$_SESSION
[
'radiusUser_searchUsername'
]
=
$_REQUEST
[
'searchUsername'
];
}
if
(
isset
(
$_REQUEST
[
'searchAgentRef'
]))
{
$_SESSION
[
'radiusUser_searchAgentRef'
]
=
$_REQUEST
[
'searchAgentRef'
];
}
if
(
isset
(
$_REQUEST
[
'searchOrderBy'
]))
{
$_SESSION
[
'radiusUser_searchOrderBy'
]
=
$_REQUEST
[
'searchOrderBy'
];
}
# Setup search
$searchOptions
->
searchUsername
=
isset
(
$_SESSION
[
'radiusUser_searchUsername'
])
?
$_SESSION
[
'radiusUser_searchUsername'
]
:
NULL
;
$searchOptions
->
searchAgentRef
=
isset
(
$_SESSION
[
'radiusUser_searchAgentRef'
])
?
$_SESSION
[
'radiusUser_searchAgentRef'
]
:
NULL
;
$searchOptions
->
searchOrderBy
=
isset
(
$_SESSION
[
'radiusUser_searchOrderBy'
])
?
$_SESSION
[
'radiusUser_searchOrderBy'
]
:
NULL
;
displaySearchResults
(
$searchOptions
);
}
# Menu footer
include
(
"../shared-php/menu-footer.php"
);
# Footer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment