HomeHomeDotNetNuke Forg...DotNetNuke Forg...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
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationModify Active Directory Authentication Login.ascxModify Active Directory Authentication Login.ascx


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Start  Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke (DNN) provides a suite of solutions that make designing, building and managing feature-rich sites and communities fast, easy and cost-effective. The DotNetNuke Platform CMS is the foundation for more than one million websites worldwide. DNN Social, our newest solution, enables businesses to create immersive, interactive communities. Thousands of organizations like True Value Hardware, Bose, Cornell University, Glacier Water, Dannon, Delphi, USAA, NASCAR, Northern Health and the City of Denver have leveraged DNN to deploy highly engaging business- critical websites. Our rapid growth in product sales and deployments resulted in DotNetNuke Corp. being named one of the fastest growing private companies in America by Inc. Magazine in 2011 and 2012.