- Fixed NPE caused when calling listRemoteAccessVpn API command with no vpn record in DB.

- Fixed UI to pass in ipaddress when you create/delete remote access vpn.
This commit is contained in:
will 2010-12-29 18:43:18 -08:00
parent a73b9dd7fb
commit de6b9eb0e2
2 changed files with 6 additions and 3 deletions

View File

@ -471,7 +471,10 @@ public class RemoteAccessVpnManagerImpl implements RemoteAccessVpnService, Manag
_accountMgr.checkAccess(caller, publicIp);
List<RemoteAccessVpnVO> vpns = new ArrayList<RemoteAccessVpnVO>(1);
vpns.add(_remoteAccessVpnDao.findById(ipAddress));
RemoteAccessVpnVO remoteVpn = _remoteAccessVpnDao.findById(ipAddress);
if (remoteVpn != null) {
vpns.add(remoteVpn);
}
return vpns;
}

View File

@ -481,7 +481,7 @@ function showEnableVPNDialog($thisTab) {
var $thisDialog = $(this);
$spinningWheel = $thisDialog.find("#spinning_wheel").show();
$.ajax({
data: createURL("command=createRemoteAccessVpn&account="+ipObj.account+"&domainid="+ipObj.domainid+"&zoneid="+ipObj.zoneid),
data: createURL("command=createRemoteAccessVpn&publicip="+ipObj.ipaddress+"&account="+ipObj.account+"&domainid="+ipObj.domainid+"&zoneid="+ipObj.zoneid),
dataType: "json",
success: function(json) {
var jobId = json.createremoteaccessvpnresponse.jobid;
@ -595,7 +595,7 @@ function showVpnUsers(presharedkey, publicip) {
var $thisDialog = $(this);
$spinningWheel = $thisDialog.find("#spinning_wheel").show();
$.ajax({
data: createURL("command=deleteRemoteAccessVpn&account="+ipObj.account+"&domainid="+ipObj.domainid+"&zoneid="+ipObj.zoneid),
data: createURL("command=deleteRemoteAccessVpn&publicip="+ipObj.ipaddress+"&account="+ipObj.account+"&domainid="+ipObj.domainid+"&zoneid="+ipObj.zoneid),
dataType: "json",
success: function(json) {
var jobId = json.deleteremoteaccessvpnresponse.jobid;