Author |
Topic |
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 22 May 2003 : 11:41:09
|
We have just started implementing Snitz on our Intranet. We are using NT authentication and Autologin. Everything is working great except that I'm not sure how to automatically fill in the email field for each new user. We are a Windows 2000, Active Directory shop and I have seen the post that suggests using LDAP to pull the data from AD, but I can't seem to get that to work. I'm thinking of maybe implementing something a little simpler. All of our users' email addresses are username@ourdomain.com. Instead of trying the get the data from AD couldn't I just automatically fill in the email with userid@ourdomain.com? If this is possible, how do I do it?
Thanks in advance,
Greg
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 22 May 2003 : 13:15:56
|
you would make those changes in inc_profile.asp (only for registration though .. unless you want to prohibit members from changing their addy) give me a little more detail of what you want to do exactly and I'll work out something for you tonight. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 22 May 2003 : 13:59:08
|
Nikkol,
Thanks for your help. I really appreciate it. Here is what I am trying to do. Let's suppose that I have a user here named Bob Smith. When Bob first accesses the forum, a new user is created. If I look at the FORUM_MEMBERS table in SQL, the M_NAME field is automatically filled in as 'Smith, Bob' and the M_USERNAME field is automatically filled in as 'smith'. The M_EMAIL field is blank. I would like to automatically fill in the M_EMAIL field with 'M_USERNAME@ourdomain.com'. The goal is for our users to use this forum without having to login or enter any information at all. The simpler for them, the better for me!
Thanks again for your help,
Greg
|
|
|
ASPDude
Starting Member
United Kingdom
41 Posts |
Posted - 22 May 2003 : 15:46:27
|
I have another solution that may help out but it's at work at the moment so I'll post it later today....if you can wait that long? |
|
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 22 May 2003 : 16:16:21
|
ASPDude,
Thanks for your reply. I welcome any solutions! This is not an urgent issue, so I can wait. Even though it is on the live site, I haven't made it public, yet. I want to work out some of these minor issues before I truly go live. On this same subject, I had another thought that I would like to run by this forum. Is it possible to parse the M_NAME field into the M_FIRSTNAME and M_LASTNAME fields? This isn't as important as the email, but would be nice.
Thanks,
Greg
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 23 May 2003 : 07:57:48
|
Solution to the email thing. This makes the email non-editable as well. Make a back up of the files before editting them and let me know if it works.
inc_profile.asp
line 72 looks like
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Email"" size=""25"" maxLength=""50"" value=""" make it look like
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input disabled=""true"" name=""Email"" size=""25"" maxLength=""50"" value=""" lines 73-84 look like
if strMode <> "Register" then Response.Write(rs("M_EMAIL"))
Response.Write """>" & vbNewLine & _
" <input type=""hidden"" name=""Email2"" value="""
if strMode <> "Register" then Response.Write(rs("M_EMAIL"))
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
if strMode = "Register" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" width=""10%"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> E-mail Address Again: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Email3"" size=""25"" maxLength=""50"" value=""""></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if make them look like
if strMode <> "Register" then
Response.Write(rs("M_EMAIL"))
else
Response.Write(Session(strCookieURL & "userid") & "@" & strMailServer )
end if
Response.Write """>" & vbNewLine & _
" <input type=""hidden"" name=""Email2"" value="""
if strMode <> "Register" then
Response.Write(rs("M_EMAIL"))
else
Response.Write(Session(strCookieURL & "userid") & "@" & strMailServer )
end if
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
' if strMode = "Register" then
' Response.Write " <tr>" & vbNewLine & _
' " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" width=""10%"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> E-mail Address Again: </font></b></td>" & vbNewLine & _
' " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Email3"" size=""25"" maxLength=""50"" value=""""></font></td>" & vbNewLine & _
' " </tr>" & vbNewLine
' end if
register.asp
lines 282-284 look like
if Request.Form("Email") <> Request.Form("Email3") then
Err_Msg = Err_Msg & "<li>Your E-mail Addresses didn't match.</li>"
end if make them look like
' if Request.Form("Email") <> Request.Form("Email3") then
' Err_Msg = Err_Msg & "<li>Your E-mail Addresses didn't match.</li>"
' end if |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 23 May 2003 : 10:37:27
|
Nikkol,
It isn't working. The email field is still not filling in. If I log in as an administrator and look at an existing user, the email is greyed out. If I click on submit, I get the following errors:
There Was A Problem With The Details
- You Must set an e-mail address
- You Must enter a valid e-mail address
- E-mail Address already in use, Please Choose Another
I noticed that you used the strMailServer variable. In our environment, that is mail.ourdomain.com. I'm not sure that would form the correct email address. I tried substituting "@ourdomain.com" instead, but that didn't work either.
Thanks for you help,
Greg
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 27 May 2003 : 13:24:07
|
I am stepping through the code with a couple of our developers. I will post the results if we figure this out.
Greg
|
|
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 27 May 2003 : 13:27:21
|
One more thing, I was getting the error because I had 'Require Unique Email' set to on. Since the email field wasn't populating, it wouldn't allow two blank emails. So, I turned it off.
Greg
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 27 May 2003 : 14:14:20
|
Around line 1349 of pop_profile.asp you'll see this:
if Request.Form("Email") = "" then
Err_Msg = Err_Msg & "<li>You Must set an e-mail address</li>"
end if
if EmailField(Request.Form("Email")) = 0 then
Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
end if Make it look like this:
' if Request.Form("Email") = "" then
' Err_Msg = Err_Msg & "<li>You Must set an e-mail address</li>"
' end if
' if EmailField(Request.Form("Email")) = 0 then
' Err_Msg = Err_Msg & "<li>You Must enter a valid e-mail address</li>"
' end if
see if that fixes it and let me know. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
GGoodge
Starting Member
USA
7 Posts |
Posted - 27 May 2003 : 15:05:59
|
We found a workaround. We decided to leave the code alone and instead use a SQL trigger. When a new row is inserted into the members table, it updates the M_EMAIL field with M_USERNAME@ourdomain.com. It also parses the lastname, firstname in the M_NAME field into M_LASTNAME and M_FIRSTNAME respectively. I'm sure there are other ways to do this, but this will work for me. I also cleared out the member table. So now when anyone goes to our bulletin board it automatically fills in Username, Account, Email Address, Firstname and Surname. Thanks everyone for point us in the right direction.
Greg
|
|
|
|
Topic |
|