Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Existing user database integration + segregation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Existing user database integration + segregation

 Post Reply Post Reply Page  <12
Author
gariputro View Drop Down
Newbie
Newbie
Avatar

Joined: 17 October 2006
Location: United States
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote gariputro Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2006 at 7:59pm

Well, I'm happy to say that after messing around with the code for the past 12 hours or so (my eyes hurt) I have a workable solution.  Is it the best possible solution?  Well, probably not, but I'm open to some guru taking my example, cleaning it up and writing it in as a feature in the future (attn: boRg Smile).  I resorted to using an SQL insert statement to change the database because I was having troubles with writing using rsCommon.

All modifications were done to functions_members_API.asp.  Line markers are estimates and may be off by a few.

Line 90 (insert):
Dim strGroup
Dim oldGroupID
 
Line 98 (insert):
'Get the current user group ID passed in your session; rename Group to whatever you called your session variable
strGroup = Session("Group")
 
Line 109 (replace):
strSQL = "SELECT " & strDbTable & "Author.Password, " & strDbTable & "Author.Salt, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.User_code, " & strDbTable & "Author.Active, " & strDbTable & "Author.Login_attempt, " & strDbTable & "Author.Group_ID " & _
 
Line 139 (insert):
oldGroupID = rsCommon("Group_ID")
 
Line 194 (insert):
'If the Session Group_ID does not match that on record we need to overwrite it in the db
If NOT strGroup = oldGroupID Then 
  
  'Set the forum group ID number for an Existing Member
  'Check tblPermissions for values used below
  '1 = Adminsitrator (reserved for Admin only)
  '2 = Guest (default)
  '3 = Moderator (all User Admins)
  '4 = Newbie
  '5 = Operator
  '6 = Power User
 
  If strGroup = 1 or strGroup = 2 Then
    intForumStartingGroup = 5
  ElseIf strGroup = 3 Then
    intForumStartingGroup = 6
  ElseIf strGroup = 4 Then
    intForumStartingGroup = 3
  ElseIf strGroup = 9 Then
    intForumStartingGroup = 1
  Else
    intForumStartingGroup = 2
  End If
   
  'Setup SQL statement to update tblAUthor db with new Group_ID
  strSQL2 = "UPDATE " & strDbTable & "Author " & strRowLock & _
  " SET Group_ID=" & intForumStartingGroup & _
  " WHERE Author_ID =" & lngUserID & ";" 
   
  'Set error trapping
  On Error Resume Next
   
  'Write SQL query to the db
  adoCon.Execute(strSQL2)
   
  'If an error has occured write an error to the page
  If Err.Number <> 0 Then Call errorMsg("An error has occured while writing to the database.", "existingMemberAPI()_update_pass", "functions_member_API.asp")
      
  'Disable error trapping
  On Error goto 0
  
End If
 
*EDIT* Oops, I lied.  I made one addition to database_connections.asp for the SQL statement I ran.
Line 73 (insert):
Dim strSQL2


Edited by gariputro - 19 October 2006 at 8:02pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2006 at 9:35am
Looks good Clap
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.