Simplify ...

This commit is contained in:
Jakob A. Dam 2015-04-16 10:48:06 +02:00
parent 01c78645ad
commit 917b38d77b
2 changed files with 33 additions and 95 deletions

View file

@ -79,9 +79,7 @@
}
// gives us https://<machine>/rdweb/pages/<lang>/
// baseUrl = new Uri(new Uri(Request.Url, Request.FilePath), ".");
baseUrl = new Uri(new Uri(GetRealRequestUri(), Request.FilePath), ".");
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
if ((sLocalHelp != null) && (sLocalHelp == "true"))
{
@ -92,74 +90,17 @@
sHelpSourceServer = "http://go.microsoft.com/fwlink/?LinkId=141038";
}
try
{
strPrivateModeTimeout = ConfigurationManager.AppSettings["PrivateModeSessionTimeoutInMinutes"].ToString();
strPublicModeTimeout = ConfigurationManager.AppSettings["PublicModeSessionTimeoutInMinutes"].ToString();
}
catch (Exception objException)
{
}
try
{
if (ConfigurationManager.AppSettings["OTP"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bOTP = true;
}
else
{
bOTP = false;
}
}
catch (Exception objException)
{
bOTP = false;
}
try
{
if (ConfigurationManager.AppSettings["EnableSMS"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bEnableSMS = true;
}
else
{
bEnableSMS = false;
}
}
catch (Exception objException)
{
bEnableSMS = false;
}
try
{
if (ConfigurationManager.AppSettings["EnableMail"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bEnableMail = true;
}
else
{
bEnableMail = false;
}
}
catch (Exception objException)
{
bEnableMail = false;
}
strPrivateModeTimeout = ConfigurationManager.AppSettings["PrivateModeSessionTimeoutInMinutes"];
strPublicModeTimeout = ConfigurationManager.AppSettings["PublicModeSessionTimeoutInMinutes"];
bOTP = ConfigurationManager.AppSettings["OTP"] == "true";
bEnableSMS = ConfigurationManager.AppSettings["EnableSMS"] == "true";
bEnableMail = ConfigurationManager.AppSettings["EnableMail"] == "true";
}
void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Session["UserPass"] = "";
@ -333,7 +274,6 @@ public static Uri GetRealRequestUri()
return ub.Uri;
}
private void SafeRedirect(string strRedirectUrl)
{
string strRedirectSafeUrl = null;
@ -373,7 +313,6 @@ public static Uri GetRealRequestUri()
}
Response.Redirect(strRedirectSafeUrl);
}
</script>
<RDWAPage
helpurl="<%=sHelpSourceServer%>"

View file

@ -84,15 +84,14 @@
Label1.Text = (string)Session["Delivery"];
bool Debug = true;
RADIUSClient myRadius = new RADIUSClient(RadiusServer, 1812, RadiusSecret);
RADIUSClient client = new RADIUSClient(RadiusServer, 1812, RadiusSecret);
RADIUSAttributes atts = new RADIUSAttributes();
RADIUSPacket response = default(RADIUSPacket);
myRadius.Debug = Debug;
client.Debug = Debug;
try {
VendorSpecificAttribute vsa = new VendorSpecificAttribute(VendorSpecificType.Generic,(string)Session["Delivery"]);
vsa.SetRADIUSAttribute(ref atts);
response = myRadius.Authenticate(username,strPassword, atts);
RADIUSPacket response = client.Authenticate(username, strPassword, atts);
if (response.Code == RadiusPacketCode.AccessChallenge) {
state = response.Attributes.GetFirstAttribute(RadiusAttributeType.State);