Tribiq CMS

Choose your language

7.4 Extranet Modes

7.4.1 Register and Edit User

The registration and editing of user details are almost an identical <form>. Therefore we can reuse most of the code in both cases. It is likely that you will want to create a form with several inputs.

All script within the following conditition will be displayed when in Register and Edit User modes:

<?php
 if ( 'register' == $mode || 'edituser' == $mode ) { ?>

To notify the user whether or not they are in Register or Edit User mode, you should use a snippet that lives within the true status of the above condition:

<?php if ($mode=="register") {
        echo “<h1>You are Editing Details</h1>” ;
     } else {
        echo “<h1>You are Registering</h1>”;
}
?>


You can also use an if statement to include form fields or not - for example, you may not want existing users to be able to modify a username, but of course you will want new users to choose one.


The form itself uses the following value:

<form method="POST" action="?cID=<?php echo $cID;?>&amp;cType=extranet&amp;mode=<?php echo $mode;?>" errorList="inputerrorlist" onSubmit="return validateForm(this);">

You then use an <input> for each of your fields. See Appendix: xHTML Documentation, Inputs.

Tribiq CMS supports both client-side and server-side validation - the “cssErrorClass” is for on-the-fly validation, whereas the last conditional PHP clause provides server side validation. We provide both methods incase a site visitor does not have JavaScript enabled.


7.4.2 Login / Default Extranet Homepage

To decide whether to display the Login or Welcome Page (post login) you should check whether or not the site visitor has been assigned an Extranet Session - if not, show the login form, or any error messages are shown if there has been a failed login attempt.

If the User has successfully logged in, you should show the default Extranet Homepage.

Top of Page