NetTalk Central

Author Topic: Calling browse from other site, check login if not ok then open login url  (Read 3590 times)

sabra

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
I have a default browse which must be called from another site .
http://mysite:88/w_keuringen?Username=walter&Password=1234. In the procedure setup i added this code (by Stu):

Q1: If the login is not ok, how do i load (goto) the default login page? (w_login. login.htm)
Q2; Is there a more sequre way to pass login code ?

Best Regards,

Walter, Sabra Systems.

! Clear Important Session Vars
!----
 l:Username = p_web.GetValue('Username')
 l:Password = p_web.GetValue('Password')
 FailedLogin# = True

 if l:username and l:Password

   p_web.SSV(g_eClearance,_eVisitor)
   p_web.SSV(g_eUsername,'')
   p_web.SSV(g_eUserID,0)

   FailedLogin# = false
 
   do OpenFiles
   !-
   ! Hoofdbes
   !----
   clear(Hfd:Record)
   Hfd:Number = clip(l:Username)
 
   if (Access:Hoofdbes.TryFetch(Hfd:KeyNR) = Level:Benign)
     !-
     ! Password Check
     !----
     if (l:Password = Hfd:WebPassword)
       !-
       ! Current check
       !----
       if (Hfd:WebsitePub = true)
         !-
         ! Set Values
         !----
         p_web.SSV(g_eUserID,Hfd:AutoNR)
         p_web.SSV(g_eUsername,Hfd:Number)
         p_web.SSV(g_eDisplayName,Hfd:Persoon)
         p_web.SSV(g_eClearance,_eUser)
               !
         p_web.SetSessionLevel(50)
         p_web.ValidateLogin()

 
       else
         FailedLogin# = true
         loc:Invalid = 'l:Username'
         p_web.SetValue('retry','index.htm')
         loc:Alert = 'Uw Account is niet (langer) actief. Vraag svp een nieuwe toegangscode aan.'
         return
       end
     else !//pasword
       FailedLogin# = true
     .
   else !//erroget
      FailedLogin# = true
   .

 .


  !-
  ! Login Passed/Failed?
  !----
  if (FailedLogin# = false)
    !-
    ! Continue
    !----
    p_web.ValidateLogin()
    !-
  else
    !-
    ! Bad Login, Set INVALID
    !----
    loc:Invalid = 'l:Username'
    p_web.SetValue('retry','index.htm')
    !loc:Alert = 'Login Failed. Please try again.'
    return
  .