Novell Home

NSL Sample Script - Avoiding a Login Loop

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 8 Feb 2006
 

Problem

A reader asked the following question:

"Can someone give some script on how to fix the following problem? When clicking Logoff in an IE app, NSL re-logs me back into the same IE app I just clicked Logoff for. Is there some redirecting script to stop this loop? I'm attempting to log out of IE apps, but NSL basically won't let me."

And here's the answer from Forum expert Eric:

Solution

Yes that is possible. You need to use a new variable (i.e., ?LoggedIn) that you set to "1" or "YES" when your user has logged in succesfully.

Now in the beginning of the script, you check to see if this variable is already set. If it is, you ask if they would like to log in again. If they choose not to, you redirect them to another page. In a nutshell your script would look something like this:

If ?LoggedIn Eq "1" 
          MessageBox 'Would you like to login again?" -YesNo ?Choice 
          If ?Choice Eq "Yes" 
                     Call Login 
                Else 
                   GotoUrl "www.protocom.com" 
                   EndScript 
          EndIf 
        Else 
          Call Login 
EndIf 

EndScript 

Sub Login 
Type $Username #1 
Type $Password Password 
Set ?LoggedIn "1" 
EndSub 


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell