Page 1 of 1

Usage of lgaDialog plugin

PostPosted: Mon Oct 10, 2005 10:03 pm
by eliaskho
I am trying to use lgaDialog plugin. I want to use the lgaDialogLogin to access a certain page in the pub. For example, I need the user to enter username and password to access one or certailn page in the in the pub otherwise he is not entitled to access it.
Anybody has any idea of the usage of this function?


PostPosted: Tue Oct 11, 2005 5:49 am
by Gaev

The owner of this plug-in has stopped supporting it. But you can accomplish your objectives using native NeoBook facilities ... try using the PageChange section (Book>>Book Properties>>Actions>>Page Change) ... from the Help file ...
Code: Select all
Page Change: These actions are executed whenever the reader attempts to navigate to another page. Optionally, the page change can be redirected or canceled by altering the value of the global [PageChangeName] variable. To redirect the reader to a different page, insert the new page’s title into the variable. For example:

SetVar "[PageChangeName]" "ErrorPage"

You can also cancel the page change by setting the variable to any empty title. For example:

If "[PageChangeName]" "=" "Goodies"

  If "[User]" "<>" "Register User"

    AlertBox "Sorry" "Only registered users can view that page."

    SetVar "[PageChangeName]" ""


... in your case, you can first check if the user is trying to go to a page in your "authorized list" e.g.
Code: Select all
SearchStr "{[PageChangeName]}" "[myAuthorizedPageList]" "[result]"
If "[result]" ">" "0"
  If "[UserType]" "<>" "Authorized"
    AlertBox "Sorry" "Only registered users can view that page."
    SetVar "[PageChangeName]" ""
... and in your Startup section you can ...

a) prompt user for name and password ... either using the InputBox command (once for each item) or the CustomWindow command that has both items (each with a TextEntry Box and a Text Box as its label) in a Container object ... then evaluate the entered values to SetVar "[UserType]" to "Authorized" or "NotAuthorized"

b) Something like ...
Code: Select all
SetVar "[myAuthorizedPageList]" "{Secret}{EvenMoreSecret}{Do Not Enter}"
... where the text between the { and } are names of your restricted pages"

If required, the same techniques can be enhanced to support "different sets of authorized pages" for "different users".

PostPosted: Tue Oct 11, 2005 6:05 am
by HPW
>Anybody has any idea of the usage of this function?

Gaev is right that you can do it with neobook.
(Make a custom window for the dialog)

But the demo-pub of lgaDialog is pretty clear about the usage.
See the page 'password' and have a look into the 2 demo buttons actions.
The result is the the vars [pwdboxuser] and [pwdboxpwd].
Then your code has to check [pwdboxpwd] and go the right page.

PostPosted: Tue Oct 11, 2005 8:38 am
by eliaskho

Thank you guys for your help and support.