Creating Custom Pages to Use in Vivaldi

Previous Managing Security in Vivaldi


Creating Your Own Pages

Typically you will use pages you design with Vivaldi's Designer.  But in some cases you may have your own web page you want to display within Vivalidi.  You can create your page with any other design interface in any language, and then make that page a menu target using the Manage Menus function.

Securing Your Own Pages with Vivalid

In some cases you may want to create your own PHP page, but still use Vivalidi's security configuration to check whether the logged in user has permissions to use that page.  Here are the steps to use Vivaldi's security configuration with your page:

  1. Navigate to Security>Custom Form Permissions.
  2. Select the 'Add' button.
  3. Specify a unique name for your form.  It can be any name, and doesn't have to strictly match the actual file name of your form.
  4. Select a role, and the permissions that role should be allowed.
  5. Repeat these steps for any other roles, keeping your form name the same.
  6. In your PHP page code, include the following at the top of your page:
    global $noauth;
    $noauth = 0;
    global $subdir;
    $subdir = 1;
    include '../library.php';
    include ('../authenticator.php');

  7. Next, you will be able to check whether the logged in user has access to view, insert, edit, and delete by using the $formpermissions array like the example below:
    if (isset($formpermisions['view'])==false or $formpermisions['view']==0) {
      echo 'Unable to load form. You may need to contact your administrator to get access.';
      fLogEvent("Form access denied 'newaccount'", $_SESSION['username'], false, "auth");

Note: If needed, the page /ogs/newaccount.php has a working example of how to implement custom security in your own pages.