Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationModify Active Directory Authentication Login.ascxModify Active Directory Authentication Login.ascx
Previous
 
Next
New Post
2/29/2012 2:23 PM
 

Hi,

I have modified the Login.ascx and Login.ascx.resx to select specific domain, and I would like to share for whoever is interested Modify the Login.ascx as show below:

<code>

<%@ Control Language="vb" Inherits="DotNetNuke.Authentication.ActiveDirectory.Login, DotNetNuke.Authentication.ActiveDirectory" AutoEventWireup="false" Explicit="True" CodeBehind="Login.ascx.vb" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>

<script type="text/jscript">
function checkInput(usrname_value, password_value, cboDomain_index) {
var Proceed = 1;
var Message;

while (Proceed == 1) {
if (!usrname_value) {
Message = "Please enter Username.";
Proceed = 0;
break;
}
if (!password_value) {
Message = "Please enter Password.";
Proceed = 0;
break;
}
if (cboDomain_index == 0) {
Message = "Please select Domain.";
Proceed = 0;
break;
}

break;
}

if (Proceed == 1) {
return true;
}
else {
Message = "";
return false;
}
}

function validateLogin() {
var username = document.getElementById('<%= txtUsername.ClientID %>');
var btn = document.getElementById("<%= cmdLogin.ClientID %>");
var password = document.getElementById('<%= txtPassword.ClientID %>');
var cboDomain = document.getElementById('<%= cboDomain.ClientID %>');
var usrname = document.getElementById('txtUsrname');

if (checkInput(usrname.value, password.value, cboDomain.selectedIndex)) {
username.value = cboDomain.options[cboDomain.selectedIndex].value + "\\" + usrname.value;
btn.click();
}
}
</script>

<table cellspacing="0" cellpadding="3" border="0" summary="SignIn Design Table" width="160">
<tr>
<td colspan="2" class="SubHead" align="left"><dnn:label id="plUsername" controlname="txtUsername" runat="server" text="UserName:" /></td>
</tr>
<tr>
<td colspan="2" align="left"><input type="text" id="txtUsrname" class="NormalTextBox" /></td>
</tr>
<tr>
<td colspan="2" class="SubHead" align="left"><dnn:label id="plPassword" controlname="txtPassword" runat="server" text="Password:" /></td>
</tr>
<tr>
<td colspan="2" align="left"><asp:TextBox ID="txtPassword" Columns="9" Width="130" TextMode="password" CssClass="NormalTextBox" runat="server" /></td>
</tr>
<tr>
<td colspan="2" class="SubHead" align="left"><dnn:label id="plDomain" controlname="auth" runat="server" text="Domain:" /></td>
</tr>
<tr>
<td colspan="2" align="left">
<asp:DropDownList ID="cboDomain" runat="server" class="NormalTextBox">
<asp:ListItem Value="">- Please Select -</asp:ListItem>
<asp:ListItem Value="joint">Joint</asp:ListItem>
<asp:ListItem Value="water">Water</asp:ListItem>
<asp:ListItem Value="power">Power</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr id="trCaptcha1" runat="server">
<td colspan="2" class="SubHead" align="center"><dnn:label id="plCaptcha" controlname="ctlCaptcha" runat="server" text="Password:" /></td>
</tr>
<tr id="trCaptcha2" runat="server">
<td colspan="2" align="center"><dnn:captchacontrol id="ctlCaptcha" captchawidth="130" captchaheight="40" cssclass="Normal" runat="server" errorstyle-cssclass="NormalRed" /></td>
</tr>
<tr>
<td colspan="2" id="tdLogin" runat="server" align="left">
<asp:Button ID="cmdLogin" Style="visibility: hidden;" runat="server" />
<input id="cmdLgin" type="button" value="Login" class="StandardButton" onclick="validateLogin();" />
<asp:TextBox ID="txtUsername" Style="visibility: hidden;" runat="server" />
</td>
</tr>
</table>

</code>

Modify/Insert the Login.ascx.resx as show below:

modify plUsername.Help -> Enter your User Name below

insert plDomain.Text -> Domain:

insert plDomain.Help -> Select your Domain below

I hope it helps.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationModify Active Directory Authentication Login.ascxModify Active Directory Authentication Login.ascx


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out