NetTalk Central

Author Topic: WebApp + SecWin + SQL  (Read 5255 times)

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
WebApp + SecWin + SQL
« on: May 02, 2012, 11:26:34 PM »
Hi all!

I have some problem with SecWin in my Web app. There are few issues that i can't solv.
SecWin security tables in SQL

1. In SecWinRefreshTables method ds_GetUsers(pAppnum,UserQueue,ds_GetUserGroupsToo) don't returm groups.

2. If i add ds_UsersEx(pAppNum,UserGroupQ) in same procedure i can see groups, but without Level and DefaultAccess (the value of both parameters is 0) even if i do:
ds_ope:Level = ds_GetUserProperty(pAppnum,UserGroupQ.Login,ds_ope:SiteLimiter,'Level')
ds_ope:InitialAccess = ds_GetUserProperty(pAppnum,UserGroupQ.Login,ds_ope:SiteLimiter,'DefaultAccess')

3. Manualy add group not work to. I try change the ds_UpdateUser(AppNum,UserDetails,CurrentAction) to:
    case CurrentAction
    of InsertRecord
        x# = ds_InsertUserEx(AppNum,ds_ope:FirstName,' '&ds_ope:FirstName,'',Secwin_UGInitialAccess,0,Secwin_UGLevel,-1)
    of ChangeRecord
        x# = ds_ChangeUser(AppNum,ds_ope:FirstName,' '&ds_ope:FirstName,ds_ope:Login,0,Secwin_UGLevel,-1)
    End
and has no effect.
In SecWinUserGroupForm -- PreInsert, PreUpdate p_web._Trace('Group name 'ds_ope:FirstName&' Access '&Secwin_UGInitialAccess&'  Level '&Secwin_UGLevel) all fine.

Please help solv this proplems.
« Last Edit: May 02, 2012, 11:28:28 PM by estadok »
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #1 on: November 20, 2012, 03:23:04 AM »
Hi
Did you find a solution?
I have exactly the same problems. Works great with tps, but when I switch to SQL can not I create groups.

Regards Niels

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #2 on: November 20, 2012, 04:31:52 AM »
I have taken Example 51 (attached) and switched to MSSQL. Still the same problem.
I must do something wrong. It should be quite simple but I just can't figure out what I'm doing wrong.

Please.....

[attachment deleted by admin]

GeoffThomson

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #3 on: November 20, 2012, 05:17:00 AM »
Please try with the latest Secwin 6.14 and let me konw if this is still an issue.

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #4 on: November 20, 2012, 05:34:28 AM »
Hi Geoff

My test is with SecWin 6.14 and NT 6.51

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
Re: WebApp + SecWin + SQL
« Reply #5 on: November 20, 2012, 09:17:48 AM »
Hi Niels!

I load a group separate from the user

Code: [Select]
   if ds_GetUsers(pAppnum,UserQueue,ds_GetUserGroupsToo) .  ! This method does not return UserGroups in MSSQL!!!!!
    loop x = 1 to records(UserQueue)
        get(UserQueue,x)
        if UserQueue.Details.ExtraString <> 'WEB' then CYCLE.
!        if UserQueue.Details.WorkGroup <> 1 THEN CYCLE.
        ds_ope:SiteLimiter = UserQueue.Details.Site
        ds_ope:Login = UserQueue.Details.Login
        ds_ope:FirstName = UserQueue.Details.FirstName
        ds_ope:Surname = UserQueue.Details.Surname
        ds_ope:Number = UserQueue.Details.Number
        ds_ope:UserGroup = UserQueue.Details.UserGroup
        ds_ope:WorkGroup = UserQueue.Details.WorkGroup
        ds_ope:LastPasswordChangeDate = UserQueue.Details.LastPasswordChangeDate
        ds_ope:Hook1 = UserQueue.Details.Hook1
        ds_ope:Level = UserQueue.Details.Level
        ds_ope:InitialAccess = UserQueue.Details.InitialAccess
        ds_ope:EmailAddress = UserQueue.Details.EmailAddress
        ds_ope:FingerPrint1 = UserQueue.Details.FingerPrint1
        ds_ope:FingerPrint2 = UserQueue.Details.FingerPrint2
        ds_ope:SiteLow = UserQueue.Details.SiteLow
        ds_ope:SiteHi = UserQueue.Details.SiteHi
        ds_ope:ExtraLong = UserQueue.Details.ExtraLong
        ds_ope:ExtraString = UserQueue.Details.ExtraString
        ds_ope:UsingTempPassword = ds_GetUserProperty(pAppnum,ds_ope:Login,ds_ope:SiteLimiter,'USETEMPPASSWORD')
        ds_ope:Question1Picked = ds_GetUserProperty(pAppnum,ds_ope:Login,ds_ope:SiteLimiter,'QUESTION1PICKED')
        ds_ope:Question2Picked = ds_GetUserProperty(pAppnum,ds_ope:Login,ds_ope:SiteLimiter,'QUESTION2PICKED')
        if not omitted(2)
           .
        access:Secwin_Operators.primerecord(1)
        access:Secwin_Operators.tryinsert()
   .
    ds_UsersEx(pAppNum,UserGroupQ)
    loop y = 1 to records(UserGroupQ)
        get(UserGroupQ,y)
        if UserGroupQ.UserGroup <> -1 then CYCLE.
        if UserGroupQ.Surname <> 'WEB' THEN CYCLE.
        ds_ope:SiteLimiter = UserGroupQ.UserSite
        ds_ope:Login = UserGroupQ.Login
        ds_ope:FirstName = UserGroupQ.Name
        ds_ope:Surname = UserGroupQ.Surname
        ds_ope:Number = UserGroupQ.Number
        ds_ope:UserGroup = UserGroupQ.UserGroup
        ds_ope:LastPasswordChangeDate = UserGroupQ.LastPasswordChangeDate
        ds_ope:Level = ds_GetAccessEx(pAppnum,'Level',UserGroupq.Number)
        ds_ope:InitialAccess = ds_GetProperty(pAppnum,UserGroupq.Number,,'DefaultAccess')
        access:Secwin_Operators.tryinsert()
    .
    access:Secwin_Operators.close()
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #6 on: November 20, 2012, 11:04:00 PM »
Hi

Thanks!!
Unfortunately your proposal didn't solve my problem.
Now I put my trust in that Geoff will help me find a solution.

/Niels

GeoffThomson

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: WebApp + SecWin + SQL
« Reply #7 on: November 21, 2012, 03:53:01 AM »
I'm getting a release out today with this and a couple of other fixes.

Keep an eye out for 6.15