2.1
PrintShop Web Web Integration Guide | 8
External person access
Where the external_login.php handles both authentication and redirect parameters,
the person_access.php file is solely used for authentication. The return value of the
external_person_access.php file differs form the external_login.php file as it returns an encrypted
password on success or a zero (0) when authentication has failed. The encrypted password is linked to
the username, the domain name of the PSW web site and is only valid for the current date (today).
This method may be used to create a custom login form where the feedback is used to notify the user
in case of an invalid login or password. On success the encrypted password can then we used in the
fcPassword attribute of the external_login.php file.
Custom login form workflow
Example
In the webintegration folder of the PSW Website folder you will find an authentication sample.
The index.php file contains a standard web form, the actual verification is handled by the code
in the process_login.php file. The form uses the POST method and sends the information to the
process_login.php file.
<!-- Index.php -->
<!-- Custom login form, communication with PSW is handled
by the process_login.php file -->
<form method="POST" action="process_login.php">
<div><span class="label">Username: </span><input type="text" name="fcUserName"
value="administrator"/></div>
<div><span class="label">Password: </span><input type="text" name="fcPassword"
value=""/></div>
<div><input type="submit" value="Login"/></div>
</form>
The process_login.php file retrieves the user name and password send by the login form (POST). The
curl library, that comes with PHP, is used to send the information to the external_person_access.php
file. The return value is stored in a local variable which is used by the index.php to show feedback
to the user. In this case the index.php is shown no matter what the outcome is of the authentication
process. One could implement an option to show a different page when the authentication was
successful.










