mirror of
https://github.com/jakobadam/RDSFactor.git
synced 2025-06-13 07:54:33 +02:00
Simplify ...
This commit is contained in:
parent
01c78645ad
commit
917b38d77b
2 changed files with 33 additions and 95 deletions
|
@ -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"] = "";
|
||||
|
@ -310,7 +251,7 @@
|
|||
Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||||
}
|
||||
|
||||
public static Uri GetRealRequestUri()
|
||||
public static Uri GetRealRequestUri()
|
||||
{
|
||||
if ((HttpContext.Current == null) ||
|
||||
(HttpContext.Current.Request == null))
|
||||
|
@ -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%>"
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue