Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Open)
 V33(all) BUG+FIX: register.asp (NT Authentication)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

yaak
Starting Member

USA
12 Posts

Posted - 13 June 2002 :  10:05:52  Show Profile
Looking for some assis on using the NT authentication method. I am using the latest snitz forum, and would like to try to use our exsisting NT authentication method if posible.

When I set the forum for NT authentication, and a user tries to creat a new account, I get:

Error Type
Microsoft OLE DB Privider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Field
'FORUM_MEMBERS.MPASSWORD' cannot be a zero-lenth string,
/help/snitz30/register.asp, line 295

When trying to register after activating the NT authentication methon, there is no option for a password, wich I can understand, but what coding and how, do I change to allow for this.

We are on an intranet, and arent connected to the outside world, so this would be a preferable method over having users have to create a seperate account for the forum.

Thank you

Edited by - ruirib on 13 June 2002 10:10:04

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 June 2002 :  10:21:48  Show Profile  Send ruirib a Yahoo! Message
You need to change the settings for the M_PASSWORD field in the FORUM_MEMBERS table, so that this field does allow zero length strings. This should be a way to fix. You need to download the database, change the field/table and upload it again.

I believe you could also change register.asp, because the M_PASSWORD field is being added even for NT authentication, which could cause this problem:

Around line 166 in register.asp, change this:


if strAuthType = "nt" then
strSql = strSql & ", M_USERNAME"
end if

strSql = strSql & ", M_PASSWORD"
strSql = strSql & ", M_EMAIL"

...


to this:


if strAuthType = "nt" then
strSql = strSql & ", M_USERNAME"
end if


if strAuthType = "db" then
strSql = strSql & ", M_PASSWORD"
end If


strSql = strSql & ", M_EMAIL"

...


Maybe try the code change first. Backup you current file, insert the changes, try to register. If it goes OK, you're done. If not, change the database as I explained.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs


Edited by - ruirib on 13 June 2002 10:26:54
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 June 2002 :  10:47:00  Show Profile  Send ruirib a Yahoo! Message
Ok, I forgot a needed additional change:

Around line 206, find:

if strAuthType = "nt" then
strSql = strSql & ", " & "'" & strDBNTUserName & "'"
end if


strSql = strSql & ", " & "'" & chkString(Request.Form"Password"),"password") & "'"
strSql = strSql & ", " & "'" & chkString(Request.Form("Email"),"SQLString") & "'"


Change it to :


if strAuthType = "nt" then
strSql = strSql & ", " & "'" & strDBNTUserName & "'"
end if


if strAuthType = "db" then
strSql = strSql & ", " & "'" & chkString(Request.Form("Password"),"password") & "'"
end If


strSql = strSql & ", " & "'" & chkString(Request.Form("Email"),"SQLString") & "'"


This change and the previous one should fix it, then.


-------------------------------------------------
Installation Guide | Do's and Dont's | MODs


Edited by - ruirib on 13 June 2002 10:53:56
Go to Top of Page

yaak
Starting Member

USA
12 Posts

Posted - 13 June 2002 :  11:15:04  Show Profile
Ah, i see.

should have thought of that, but wasnt thinking too clearly. what i did was changed the settings on the database. the fileds were default to allow zero lenth, no, so i had to set it to yes on several besides the password. it got stuck on a few others such as occupation...

thank you for the info, it saved me quite a headache.



quote:

You need to change the settings for the M_PASSWORD field in the FORUM_MEMBERS table, so that this field does allow zero length strings. This should be a way to fix. You need to download the database, change the field/table and upload it again.

I believe you could also change register.asp, because the M_PASSWORD field is being added even for NT authentication, which could cause this problem:

Around line 166 in register.asp, change this:


if strAuthType = "nt" then
strSql = strSql & ", M_USERNAME"
end if

strSql = strSql & ", M_PASSWORD"
strSql = strSql & ", M_EMAIL"

...


to this:


if strAuthType = "nt" then
strSql = strSql & ", M_USERNAME"
end if


if strAuthType = "db" then
strSql = strSql & ", M_PASSWORD"
end If


strSql = strSql & ", M_EMAIL"

...


Maybe try the code change first. Backup you current file, insert the changes, try to register. If it goes OK, you're done. If not, change the database as I explained.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs


Edited by - ruirib on 13 June 2002 10:26:54



Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 June 2002 :  15:14:33  Show Profile
you could also do this:

                if strAuthType = "nt" then
strSql = strSql & ", '" & strDBNTUserName & "'"
else
strSql = strSql & ", '" & chkString(Request.Form("Password"),"password") & "'"
end If
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 June 2002 :  15:18:07  Show Profile  Send ruirib a Yahoo! Message
quote:

you could also do this:

                if strAuthType = "nt" then
strSql = strSql & ", '" & strDBNTUserName & "'"
else
strSql = strSql & ", '" & chkString(Request.Form("Password"),"password") & "'"
end If



Looks like the obvious is not so obvious, sometimes ...

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 June 2002 :  16:42:49  Show Profile  Send ruirib a Yahoo! Message
I've got and additional question on this issue. Yaak complained there were additional similar problems with other fields.
That seems to result from the fact that the values are read from the form, whether they have been filled or not. Shouldn't a test be done on the values read from the forms, for all fields defined in the database as not allowing zero-length strings and only if they were different from "" add the column to the SQL statement.

I know it will give a bit of work, but looks like the best thing to do. What do you think?

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 June 2002 :  16:52:22  Show Profile
What we did for v3.4 is make sure that a default value is assigned to each field in the database. That way, if we add a record and a certain field isn't assigned a value when the record is inserted, it will get the default value. Of course, existing databases won't have these default values set, but if they go through and set a default value for each field, then it will solve this problem.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 June 2002 :  17:11:40  Show Profile  Send ruirib a Yahoo! Message
Ok.

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.55 seconds. Powered By: Snitz Forums 2000 Version 3.4.07