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 764 additions and 369 deletions
<?php
# JSON 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
......@@ -153,5 +153,37 @@ class json_response {
}
}
function jsonSuccess($name = 'Result',$type = 'int',$value = 0) {
# Build response
$res = new json_response;
$res->addField($name,$type);
$res->parseHash(array(
$name => $value
));
# Export
echo json_encode($res->export());
}
function jsonError($code,$reason) {
# Build response
$res = new json_response;
$res->setStatus(-1);
$res->addField('ErrorCode','int');
$res->addField('ErrorReason','string');
$res->parseHash(array(
'ErrorCode' => $code,
'ErrorReason' => $reason
));
# Export
echo json_encode($res->export());
}
# vim: ts=4
<?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
......@@ -74,9 +74,13 @@ function DBSelect($query,$args = array())
{
global $db;
# Replace table prefix template
$result = ReplacePrefix($query, $args);
$rawQuery = $result[0]; $rawArgs = $result[1];
# Try prepare, and catch exceptions
try {
$stmt = $db->prepare($query);
$stmt = $db->prepare($rawQuery);
} catch (PDOException $e) {
return $e->getMessage();
......@@ -84,7 +88,7 @@ function DBSelect($query,$args = array())
}
# Execute query
$res = $stmt->execute($args);
$res = $stmt->execute($rawArgs);
if ($res === FALSE) {
return $stmt->errorInfo();
}
......@@ -104,9 +108,13 @@ function DBDo($command,$args = array())
{
global $db;
# Replace table prefix template
$result = ReplacePrefix($command, $args);
$rawCommand = $result[0]; $rawArgs = $result[1];
# Try prepare, and catch exceptions
try {
$stmt = $db->prepare($command);
$stmt = $db->prepare($rawCommand);
} catch (PDOException $e) {
return $e->getMessage();
......@@ -114,7 +122,7 @@ function DBDo($command,$args = array())
}
# Execute query
$res = $stmt->execute($args);
$res = $stmt->execute($rawArgs);
if ($res === FALSE) {
return $stmt->errorInfo();
}
......@@ -134,7 +142,11 @@ function DBSelectNumResults($query,$args = array())
global $db;
$res = DBSelect("SELECT COUNT(*) AS num_results $query",$args);
# Replace table prefix template
$result = ReplacePrefix($query, $args);
$rawQuery = $result[0]; $rawArgs = $result[1];
$res = DBSelect("SELECT COUNT(*) AS num_results $rawQuery",$rawArgs);
if (!is_object($res)) {
return $res;
}
......@@ -373,6 +385,7 @@ function DBSelectSearch($query,$search,$filters,$sorts) {
# Select row count, pull out "SELECT .... " as we replace this in the NumResults query
$queryCount = $query; $queryCount = preg_replace("/^\s*SELECT\s.*\sFROM/is","FROM",$queryCount);
$numResults = DBSelectNumResults("$queryCount $sqlWhere");
if (!isset($numResults)) {
return array(NULL,"Backend database query 1 failed");
......@@ -457,4 +470,32 @@ function DBRollback()
$db = connect_db();
## @fn ReplacePrefix($query,$args)
# Return raw query and args based on table prefix
#
# @param query Query string
# @param args Array of arguments
#
# @return string rawQuery, array rawArgs
function ReplacePrefix($query, $args = array())
{
global $DB_TABLE_PREFIX;
# Fetch table prefix from config
$table_prefix = isset($DB_TABLE_PREFIX) ? $DB_TABLE_PREFIX : "";
# Replace query
$rawQuery = preg_replace('/\@TP\@/', $table_prefix, $query);
# Replace args
$rawArgs = array();
foreach ($args as $argItem) {
$rawArgItem = preg_replace('/\@TP\@/', $table_prefix, $argItem);
array_push($rawArgs, $rawArgItem);
}
return array($rawQuery, $rawArgs);
}
# vim: ts=4
<?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
......@@ -23,38 +23,54 @@
function strRadiusTermCode($errCode) {
if (is_numeric($errCode)) {
# Terminate codes RFC 2866
switch ($errCode) {
case 0:
return "Still logged in";
case 45: # Unknown
case 46: # Unknown
case 63: # Unknown
case 1:
return "User request";
return "User Request";
case 2:
case 816: # TCP connection reset? unknown
return "Carrier loss";
return "Lost Carrier";
case 3:
return "Lost Service";
case 4:
return "Idle Timeout";
case 5:
return "Session timeout";
case 6: # Admin reset
case 10: # NAS request
case 11: # NAS reboot
case 831: # NAS request? unknown
case 841: # NAS request? unknown
return "Router reset/reboot";
case 8: # Port error
return "Port error";
case 180: # Unknown
return "Local hangup";
case 827: # Unknown
return "Service unavailable";
return "Session Timeout";
case 6:
return "Admin Reset";
case 7:
return "Admin Reboot";
case 8:
return "Port Error";
case 9:
return "NAS Error";
case 10:
return "NAS Request";
case 11:
return "NAS Reboot";
case 12:
return "Port Unneeded";
case 13:
return "Port Preempted";
case 14:
return "Port Suspended";
case 15:
return "Service Unavailable";
case 16:
return "Callback";
case 17:
return "User Error";
case 18:
return "Host Request";
default:
return "Unkown";
}
} else {
return "Unknown";
switch ($errCode) {
case NULL:
return "Still logged in";
default:
return "Unkown";
}
}
}
......
<?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" />
<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/menu/EditableItem.js"></script>
<script type="text/javascript" src="js/custom/menu/RangeMenu.js"></script>
<script type="text/javascript" src="js/custom/GridFilters.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/Filter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/StringFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/DateFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/ListFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/NumericFilter.js"></script>
<script type="text/javascript" src="js/custom/GridFilters/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
......
......@@ -16,15 +16,6 @@ Ext.onReady(function(){
// Turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
// Range menu items, used on GridFilter
Ext.menu.RangeMenu.prototype.icons = {
gt: 'resources/extjs/images/greater_then.png',
lt: 'resources/extjs/images/less_then.png',
eq: 'resources/extjs/images/equals.png'
};
Ext.grid.filter.StringFilter.prototype.icon = 'resources/extjs/images/find.png';
// Turn off the loading icon
var hideMask = function () {
Ext.get('loading').remove();
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminClientAttributesWindow(clientID) {
tooltip:'Add attribute',
iconCls:'silk-table_add',
handler: function() {
showAdminClientAttributeAddEditWindow(clientID);
showAdminClientAttributeAddEditWindow(AdminClientAttributesWindow,clientID);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminClientAttributesWindow(clientID) {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminClientAttributeAddEditWindow(clientID,selectedItem.data.ID);
showAdminClientAttributeAddEditWindow(AdminClientAttributesWindow,clientID,selectedItem.data.ID);
} else {
AdminClientAttributesWindow.getEl().mask();
......@@ -161,7 +161,7 @@ function showAdminClientAttributesWindow(clientID) {
// Display edit/add form
function showAdminClientAttributeAddEditWindow(clientID,attrID) {
function showAdminClientAttributeAddEditWindow(AdminClientAttributesWindow,clientID,attrID) {
var submitAjaxConfig;
var icon;
......@@ -171,28 +171,48 @@ function showAdminClientAttributeAddEditWindow(clientID,attrID) {
if (attrID) {
icon = 'silk-table_edit';
submitAjaxConfig = {
ID: attrID,
SOAPFunction: 'updateAdminClientAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
ID: attrID,
SOAPFunction: 'updateAdminClientAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-table_add';
submitAjaxConfig = {
ClientID: clientID,
SOAPFunction: 'addAdminClientAttribute',
SOAPParams:
'0:ClientID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
ClientID: clientID,
SOAPFunction: 'addAdminClientAttribute',
SOAPParams:
'0:ClientID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -249,9 +269,9 @@ function showAdminClientAttributeAddEditWindow(clientID,attrID) {
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......@@ -290,9 +310,9 @@ function showAdminClientAttributeAddEditWindow(clientID,attrID) {
// Display remove form
function showAdminClientAttributeRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminClientAttributeRemoveWindow(AdminClientAttributesWindow,id) {
// Mask AdminClientAttributesWindow window
AdminClientAttributesWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -306,7 +326,7 @@ function showAdminClientAttributeRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminClientAttributesWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -315,13 +335,21 @@ function showAdminClientAttributeRemoveWindow(parent,id) {
SOAPModule: 'AdminClientAttributes',
SOAPFunction: 'removeAdminClientAttribute',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminClientAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminClientAttributesWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminClientRealmsWindow(clientID) {
tooltip:'Add realm',
iconCls: 'silk-world_add',
handler: function() {
showAdminClientRealmAddWindow(clientID);
showAdminClientRealmAddWindow(AdminClientRealmsWindow,clientID);
}
},
'-',
......@@ -115,7 +115,7 @@ function showAdminClientRealmsWindow(clientID) {
// Display edit/add form
function showAdminClientRealmAddWindow(clientID,id) {
function showAdminClientRealmAddWindow(AdminClientRealmsWindow,clientID,id) {
var submitAjaxConfig;
var icon;
......@@ -124,22 +124,42 @@ function showAdminClientRealmAddWindow(clientID,id) {
if (id) {
icon = 'silk-world_edit',
submitAjaxConfig = {
ID: id,
SOAPFunction: 'updateAdminRealm',
SOAPParams:
'0:ID,'+
'0:RealmID'
params: {
ID: id,
SOAPFunction: 'updateAdminRealm',
SOAPParams:
'0:ID,'+
'0:RealmID'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientRealmsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-world_add',
submitAjaxConfig = {
ClientID: clientID,
SOAPFunction: 'addAdminClientRealm',
SOAPParams:
'0:ClientID,'+
'0:RealmID'
params: {
ClientID: clientID,
SOAPFunction: 'addAdminClientRealm',
SOAPParams:
'0:ClientID,'+
'0:RealmID'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientRealmsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -218,10 +238,10 @@ function showAdminClientRealmAddWindow(clientID,id) {
// Display edit/add form
function showAdminClientRealmRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showAdminClientRealmRemoveWindow(AdminClientRealmsWindow,id) {
// Mask AdminClientRealmsWindow window
AdminClientRealmsWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -235,7 +255,7 @@ function showAdminClientRealmRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminClientRealmsWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -244,13 +264,21 @@ function showAdminClientRealmRemoveWindow(parent,id) {
SOAPModule: 'AdminClientRealms',
SOAPFunction: 'removeAdminClientRealm',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminClientRealmsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminClientRealmsWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -40,7 +40,7 @@ function showAdminClientWindow() {
tooltip:'Add client',
iconCls:'silk-server_add',
handler: function() {
showAdminClientAddEditWindow();
showAdminClientAddEditWindow(AdminClientWindow);
}
},
'-',
......@@ -53,7 +53,7 @@ function showAdminClientWindow() {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminClientAddEditWindow(selectedItem.data.ID);
showAdminClientAddEditWindow(AdminClientWindow,selectedItem.data.ID);
} else {
AdminClientWindow.getEl().mask();
......@@ -202,7 +202,7 @@ function showAdminClientWindow() {
// Display edit/add form
function showAdminClientAddEditWindow(id) {
function showAdminClientAddEditWindow(AdminClientWindow,id) {
var submitAjaxConfig;
var icon;
......@@ -211,22 +211,42 @@ function showAdminClientAddEditWindow(id) {
if (id) {
icon = 'silk-server_edit';
submitAjaxConfig = {
ID: id,
SOAPFunction: 'updateAdminClient',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:AccessList'
params: {
ID: id,
SOAPFunction: 'updateAdminClient',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:AccessList'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-server_add';
submitAjaxConfig = {
SOAPFunction: 'createAdminClient',
SOAPParams:
'0:Name,'+
'0:AccessList'
params: {
SOAPFunction: 'createAdminClient',
SOAPParams:
'0:Name,'+
'0:AccessList'
},
onSuccess: function() {
var store = Ext.getCmp(AdminClientWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -287,10 +307,10 @@ function showAdminClientAddEditWindow(id) {
}
// Display edit/add form
function showAdminClientRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showAdminClientRemoveWindow(AdminClientWindow,id) {
// Mask AdminClientWindow window
AdminClientWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -304,7 +324,7 @@ function showAdminClientRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminClientWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -313,13 +333,21 @@ function showAdminClientRemoveWindow(parent,id) {
SOAPModule: 'AdminClients',
SOAPFunction: 'removeAdminClient',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminClientWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminClientWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminGroupAttributesWindow(groupID) {
tooltip:'Add attribute',
iconCls:'silk-table_add',
handler: function() {
showAdminGroupAttributeAddEditWindow(groupID);
showAdminGroupAttributeAddEditWindow(AdminGroupAttributesWindow,groupID);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminGroupAttributesWindow(groupID) {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminGroupAttributeAddEditWindow(groupID,selectedItem.data.ID);
showAdminGroupAttributeAddEditWindow(AdminGroupAttributesWindow,groupID,selectedItem.data.ID);
} else {
AdminGroupAttributesWindow.getEl().mask();
......@@ -161,7 +161,7 @@ function showAdminGroupAttributesWindow(groupID) {
// Display edit/add form
function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
function showAdminGroupAttributeAddEditWindow(AdminGroupAttributesWindow,groupID,attrID) {
var submitAjaxConfig;
var icon;
......@@ -170,28 +170,48 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
if (attrID) {
icon = 'silk-table_edit';
submitAjaxConfig = {
ID: attrID,
SOAPFunction: 'updateAdminGroupAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
ID: attrID,
SOAPFunction: 'updateAdminGroupAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminGroupAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-table_add';
submitAjaxConfig = {
GroupID: groupID,
SOAPFunction: 'addAdminGroupAttribute',
SOAPParams:
'0:GroupID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
GroupID: groupID,
SOAPFunction: 'addAdminGroupAttribute',
SOAPParams:
'0:GroupID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminGroupAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -248,9 +268,9 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......@@ -289,9 +309,9 @@ function showAdminGroupAttributeAddEditWindow(groupID,attrID) {
// Display remove form
function showAdminGroupAttributeRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminGroupAttributeRemoveWindow(AdminGroupAttributesWindow,id) {
// Mask AdminGroupAttributesWindow window
AdminGroupAttributesWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -305,7 +325,7 @@ function showAdminGroupAttributeRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminGroupAttributesWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -314,13 +334,21 @@ function showAdminGroupAttributeRemoveWindow(parent,id) {
SOAPModule: 'AdminGroupAttributes',
SOAPFunction: 'removeAdminGroupAttribute',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminGroupAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminGroupAttributesWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -112,9 +112,9 @@ function showAdminGroupMembersWindow(groupID) {
// Display remove form
function showAdminGroupMemberRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminGroupMemberRemoveWindow(AdminGroupMembersWindow,id) {
// Mask AdminGroupMembersWindow window
AdminGroupMembersWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -128,7 +128,7 @@ function showAdminGroupMemberRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminGroupMembersWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -137,13 +137,21 @@ function showAdminGroupMemberRemoveWindow(parent,id) {
SOAPModule: 'AdminGroupMembers',
SOAPFunction: 'removeAdminGroupMember',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminGroupMembersWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminGroupMembersWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminGroupWindow() {
tooltip:'Add group',
iconCls:'silk-group_add',
handler: function() {
showAdminGroupAddEditWindow();
showAdminGroupAddEditWindow(AdminGroupWindow);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminGroupWindow() {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminGroupAddEditWindow(selectedItem.data.ID);
showAdminGroupAddEditWindow(AdminGroupWindow,selectedItem.data.ID);
} else {
AdminGroupWindow.getEl().mask();
......@@ -216,7 +216,7 @@ function showAdminGroupWindow() {
// Display edit/add form
function showAdminGroupAddEditWindow(id) {
function showAdminGroupAddEditWindow(AdminGroupWindow,id) {
var submitAjaxConfig;
var icon;
......@@ -226,20 +226,40 @@ function showAdminGroupAddEditWindow(id) {
if (id) {
icon = 'silk-group_edit';
submitAjaxConfig = {
ID: id,
SOAPFunction: 'updateAdminGroup',
SOAPParams:
'0:ID,'+
'0:Name'
params: {
ID: id,
SOAPFunction: 'updateAdminGroup',
SOAPParams:
'0:ID,'+
'0:Name'
},
onSuccess: function() {
var store = Ext.getCmp(AdminGroupWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-group_add';
submitAjaxConfig = {
SOAPFunction: 'createAdminGroup',
SOAPParams:
'0:Name'
params: {
SOAPFunction: 'createAdminGroup',
SOAPParams:
'0:Name'
},
onSuccess: function() {
var store = Ext.getCmp(AdminGroupWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -269,8 +289,6 @@ function showAdminGroupAddEditWindow(id) {
{
fieldLabel: 'Name',
name: 'Name',
vtype: 'usernamePart',
maskRe: usernamePartRe,
allowBlank: false
}
]
......@@ -299,10 +317,10 @@ function showAdminGroupAddEditWindow(id) {
// Display edit/add form
function showAdminGroupRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showAdminGroupRemoveWindow(AdminGroupWindow,id) {
// Mask AdminGroupWindow window
AdminGroupWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -316,7 +334,7 @@ function showAdminGroupRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminGroupWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -325,13 +343,21 @@ function showAdminGroupRemoveWindow(parent,id) {
SOAPModule: 'AdminGroups',
SOAPFunction: 'removeAdminGroup',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminGroupWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminGroupWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminRealmAttributesWindow(realmID) {
tooltip:'Add attribute',
iconCls:'silk-table_add',
handler: function() {
showAdminRealmAttributeAddEditWindow(realmID);
showAdminRealmAttributeAddEditWindow(AdminRealmAttributesWindow,realmID);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminRealmAttributesWindow(realmID) {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminRealmAttributeAddEditWindow(realmID,selectedItem.data.ID);
showAdminRealmAttributeAddEditWindow(AdminRealmAttributesWindow,realmID,selectedItem.data.ID);
} else {
AdminRealmAttributesWindow.getEl().mask();
......@@ -161,7 +161,7 @@ function showAdminRealmAttributesWindow(realmID) {
// Display edit/add form
function showAdminRealmAttributeAddEditWindow(realmID,attrID) {
function showAdminRealmAttributeAddEditWindow(AdminRealmAttributesWindow,realmID,attrID) {
var submitAjaxConfig;
var icon;
......@@ -171,28 +171,48 @@ function showAdminRealmAttributeAddEditWindow(realmID,attrID) {
if (attrID) {
icon = 'silk-table_edit';
submitAjaxConfig = {
ID: attrID,
SOAPFunction: 'updateAdminRealmAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
ID: attrID,
SOAPFunction: 'updateAdminRealmAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminRealmAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-table_add';
submitAjaxConfig = {
RealmID: realmID,
SOAPFunction: 'addAdminRealmAttribute',
SOAPParams:
'0:RealmID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
RealmID: realmID,
SOAPFunction: 'addAdminRealmAttribute',
SOAPParams:
'0:RealmID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminRealmAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -249,9 +269,9 @@ function showAdminRealmAttributeAddEditWindow(realmID,attrID) {
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......@@ -290,9 +310,9 @@ function showAdminRealmAttributeAddEditWindow(realmID,attrID) {
// Display remove form
function showAdminRealmAttributeRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminRealmAttributeRemoveWindow(AdminRealmAttributesWindow,id) {
// Mask AdminRealmAttributesWindow window
AdminRealmAttributesWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -306,7 +326,7 @@ function showAdminRealmAttributeRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminRealmAttributesWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -315,13 +335,21 @@ function showAdminRealmAttributeRemoveWindow(parent,id) {
SOAPModule: 'AdminRealmAttributes',
SOAPFunction: 'removeAdminRealmAttribute',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminRealmAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminRealmAttributesWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -106,9 +106,9 @@ function showAdminRealmMembersWindow(realmID) {
// Display remove form
function showAdminRealmMemberRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminRealmMemberRemoveWindow(AdminRealmMembersWindow,id) {
// Mask AdminRealmMembersWindow window
AdminRealmMembersWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -122,7 +122,7 @@ function showAdminRealmMemberRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminRealmMembersWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -131,13 +131,21 @@ function showAdminRealmMemberRemoveWindow(parent,id) {
SOAPModule: 'AdminRealmMembers',
SOAPFunction: 'removeAdminRealmMember',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminRealmMembersWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminRealmMembersWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminRealmWindow() {
tooltip:'Add realm',
iconCls:'silk-world_add',
handler: function() {
showAdminRealmAddEditWindow();
showAdminRealmAddEditWindow(AdminRealmWindow);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminRealmWindow() {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminRealmAddEditWindow(selectedItem.data.ID);
showAdminRealmAddEditWindow(AdminRealmWindow,selectedItem.data.ID);
} else {
AdminRealmWindow.getEl().mask();
......@@ -204,7 +204,7 @@ function showAdminRealmWindow() {
// Display edit/add form
function showAdminRealmAddEditWindow(id) {
function showAdminRealmAddEditWindow(AdminRealmWindow,id) {
var submitAjaxConfig;
var icon;
......@@ -214,20 +214,40 @@ function showAdminRealmAddEditWindow(id) {
if (id) {
icon = 'silk-world_edit';
submitAjaxConfig = {
ID: id,
SOAPFunction: 'updateAdminRealm',
SOAPParams:
'0:ID,'+
'0:Name'
params: {
ID: id,
SOAPFunction: 'updateAdminRealm',
SOAPParams:
'0:ID,'+
'0:Name'
},
onSuccess: function() {
var store = Ext.getCmp(AdminRealmWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-world_add';
submitAjaxConfig = {
SOAPFunction: 'createAdminRealm',
SOAPParams:
'0:Name'
params: {
SOAPFunction: 'createAdminRealm',
SOAPParams:
'0:Name'
},
onSuccess: function() {
var store = Ext.getCmp(AdminRealmWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -285,10 +305,10 @@ function showAdminRealmAddEditWindow(id) {
// Display edit/add form
function showAdminRealmRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showAdminRealmRemoveWindow(AdminRealmWindow,id) {
// Mask AdminRealmWindow window
AdminRealmWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -302,7 +322,7 @@ function showAdminRealmRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminRealmWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -311,13 +331,21 @@ function showAdminRealmRemoveWindow(parent,id) {
SOAPModule: 'AdminRealms',
SOAPFunction: 'removeAdminRealm',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminRealmWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminRealmWindow.getEl().unmask();
}
}
});
......
/*
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
......@@ -41,7 +41,7 @@ function showAdminUserAttributesWindow(userID) {
tooltip:'Add attribute',
iconCls:'silk-table_add',
handler: function() {
showAdminUserAttributeAddEditWindow(userID);
showAdminUserAttributeAddEditWindow(AdminUserAttributesWindow,userID);
}
},
'-',
......@@ -54,7 +54,7 @@ function showAdminUserAttributesWindow(userID) {
// Check if we have selected item
if (selectedItem) {
// If so display window
showAdminUserAttributeAddEditWindow(userID,selectedItem.data.ID);
showAdminUserAttributeAddEditWindow(AdminUserAttributesWindow,userID,selectedItem.data.ID);
} else {
AdminUserAttributesWindow.getEl().mask();
......@@ -161,7 +161,7 @@ function showAdminUserAttributesWindow(userID) {
// Display edit/add form
function showAdminUserAttributeAddEditWindow(userID,attrID) {
function showAdminUserAttributeAddEditWindow(AdminUserAttributesWindow,userID,attrID) {
var submitAjaxConfig;
var icon;
......@@ -171,28 +171,48 @@ function showAdminUserAttributeAddEditWindow(userID,attrID) {
if (attrID) {
icon = 'silk-table_edit';
submitAjaxConfig = {
ID: attrID,
SOAPFunction: 'updateAdminUserAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
ID: attrID,
SOAPFunction: 'updateAdminUserAttribute',
SOAPParams:
'0:ID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminUserAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-table_add';
submitAjaxConfig = {
UserID: userID,
SOAPFunction: 'addAdminUserAttribute',
SOAPParams:
'0:UserID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
params: {
UserID: userID,
SOAPFunction: 'addAdminUserAttribute',
SOAPParams:
'0:UserID,'+
'0:Name,'+
'0:Operator,'+
'0:Value,'+
'0:Disabled:boolean'
},
onSuccess: function() {
var store = Ext.getCmp(AdminUserAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -251,9 +271,9 @@ function showAdminUserAttributeAddEditWindow(userID,attrID) {
displayField: 'Operator',
valueField: 'Operator',
hiddenName: 'Operator',
forceSelection: true,
forceSelection: false,
triggerAction: 'all',
editable: false
editable: true
},
{
fieldLabel: "Value",
......@@ -292,9 +312,9 @@ function showAdminUserAttributeAddEditWindow(userID,attrID) {
// Display remove form
function showAdminUserAttributeRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
function showAdminUserAttributeRemoveWindow(AdminUserAttributesWindow,id) {
// Mask AdminUserAttributesWindow window
AdminUserAttributesWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -308,7 +328,7 @@ function showAdminUserAttributeRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(AdminUserAttributesWindow,{
params: {
ID: id,
SOAPUsername: globalConfig.soap.username,
......@@ -317,13 +337,21 @@ function showAdminUserAttributeRemoveWindow(parent,id) {
SOAPModule: 'AdminUserAttributes',
SOAPFunction: 'removeAdminUserAttribute',
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(AdminUserAttributesWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
AdminUserAttributesWindow.getEl().unmask();
}
}
});
......