HTML Executable Wiki : CmdLinePassword

HomePage :: Site News :: HTML Executable Homepage :: Glossary :: RecentChanges :: Login/Register

Revision [44]

The oldest known version of this page was edited on 2006-12-01 00:25:36 by GdgAdmin

How to pass a password to the ebook with the command line?



With security profiles and a single HEScript custom function, you can achieve this goal.

First you need to write the HEScript function that checks your password:
function CheckPassword: Boolean;
begin
 // Returns True if the password of the command line is incorrect.
 Result := ParamStr(0) <> "MYPASSWORD";
end;

Be sure to change the MYPASSWORD text to the password you want. In this script version, passwords will be case-sensitive.

Secondly we need to modify the Default security profile; go to the Security tab and select Security Profiles. Highlight "Profile: Default"; click on Add and choose Add New Condition.
The "Add a condition" dialog box is shown; choose "If the following boolean script function returns true". HTML Executable asks you to select the boolean function: it's the "CheckPassword" one you created previously. Close all the dialog boxes.

Finally, select the new condition and click on "Configure". Select the "Locking Pages" tab and enable "Pages are locked and cannot be viewed".
If you want to display a "registration page", just select it using the "Select" button.

Compile your publication and that's all.

Note: it is also possible to a new security profile that will only forbid a given set of HTML pages, and much more.
If you need help or more samples, feel free to ask in the user forum.
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1376 seconds