Members only
Username:  
Password:
  > Home
v User Guide
    > Introduction
    > Hello World
    > Flow Control
    > Function Calls
    v Authentication
       o Members only
       o Login
    > Database access
    > Content Management
    > Remote Calling
    > Object-Oriented
    > Other Features
> Reference
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> User Guide >> Authentication >> Members only <=  =>      <  1  >  
Members only

You can use the "access" command to restrict access to web site contents.

access {

   display "Welcome, {sys%auth:username}.<br>\n";

   display "Have a good day, {sys%auth:GivenName} {sys%auth:Surname}.\n";

} else {

   display "Member only page, please login first.\n";

}

 

(sys%auth:username is the logged in username, and sys%auth:GivenName and sys%auth:Surname are arbitrary fields in the authentication table.)

In the above example, visitors logged in will see the first block.  All others will see the second.  The second block is optional.  ("access" is internally implemented as "if", so either "else" or "elseif" can start a second block after the "access" block.)

You can selectively restrict access to a particular level of users:

access (member) {

   // "member" privilege or higher

   // ...

}

 

You can even discriminate on user or realm:

access (@marketing) {

   // All users in the "marketing" realm

   display "Reminder: Please send in 3rd quarter report!\n";

} else access (john@) {

   // User "john" in the blank realm (default realm)

   display "John, please call your wife.\n";

} else access (mary@sales) {

   // User "mary" in the "sales" realm

   display "Mary, November volume was up.  Well done!\n";

} else access (not @service) {

   // All users except those in the "service" realm

   display "Service finally lost their bowling title to Purchasing!\n";

} else {

   // Everybody else

   display "No news is good news\n";

}

 

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd