7.1
Table Of Contents
- Table of Content
- Overview
- Understanding PrintShop Mail Web
- Getting Started
- The PrintShop Mail Web Interface
- Publishing Workflow
- Ordering Workflow
- New Document
- Order Manager
- Checkout
- Companies
- Users
- Publication Types
- Collections
- Settings
- About
- License
- Roles
- Languages
- Web Design
- Maintenance
- Settings
- Currencies
- Tax Rates
- Shipping Rates
- Calendar
- Production Settings
- User Input Field Defaults
- Output Folders
- Job options
- Printers
- E-mail Settings
- E-mail Addressees
- Managing E-mail Templates
- Modules Settings
- Enabling a MIS connector
- Installed modules
- Properties
- Enabling a Print Production connector
- Installed modules
- Properties
- Requirements
- Configuring the module
- The PayPal Sandbox
- Processing orders
- Requirements
- Configuring the Authorize.net module
- Test mode
- AVS and CCV checks
- Payment page
- Requirements
- Requesting a test account
- Configuring the iDEAL test dashboard
- Configuring the iDeal module
- Requirements
- Configuring the Moneris module
- Test mode
- Requesting a live account
- AVS and CVD checks
- Payment page
- Add a new Module
- Configure a module
- Delete a Module
- XML (eXtensible Markup Language)
- Options
- Sample POST receive script
- Interaction With PrintShop Mail Design
- Introduction to Regular Expressions
- Introduction
- Skinning Guide
- Getting started
- Creating your own skin
- The template file
- HMTL Outline
- Styling
- Key Concepts
- Style organization
- Header
- User information
- Menu bar
- Background
- Overview tables
- Edit forms
- Sub menus
- Special variables
- Variables for template files
- Variables for style files
- Creating page exceptions
- Creating a page specific template file
- Modifying a page specific template file
- DOM manipulation using jQuery
- Launching code on Document Ready
- Populating fields with computed values
- Removing elements from the DOM
- Adding information to the DOM
- Customizing the store front
- Storefront class
- Creating a hierarchical tree
- Adding a live search option
- Copyright Information
- Index
<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 suc-
cessful.
<!-- Process_login.php -->
<?
// The process_login.php file (the following process is an example and
// should be handled by your web site or portal)
$hCurl = curl_init(); //Initializes a new session and return a cURL handle
curl_setopt($hCurl, CURLOPT_URL, $_SERVER['HTTP_HOST']."/external_person_access.php");
curl_setopt($hCurl, CURLOPT_POST, 1);
curl_setopt($hCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($hCurl, CURLOPT_TIMEOUT, 10); // times out after 4s
curl_setopt($hCurl, CURLOPT_POSTFIELDS, "fcUserName=".$_REQUEST[fcUserName].
"&fcPassword=".$_REQUEST[fcPassword]); // add POST fields
$cReturn = curl_exec ($hCurl);
curl_close ($hCurl);
if ($cReturn != "0") {
//Success
$cReturn = urlencode($cReturn);
$fcUserName = $_REQUEST[fcUserName];
} else {
//Failed
$fcUserName = $_REQUEST[fcUserName];
$cReturn = false;
}
include_once("index.php");
?>
Important: The PHP urlencode() function is applied to the encrypted password to make sure that it is properly encoded
when using it in a URL (f.e. Href).
In our example a few simple statements are used to show the return value of the authentication process.
<!-- Index.php -->
<!-- Statements to show the return value -->
<?
// Following variables are generated by process_login.php and
// used to show the repsonse of PSW.
if(isset($cReturn)){
if($cReturn == false){
echo "<div class=\"status error\">Invallid user name or password!</div>";
} else {
echo "<div class=\"status success\">Authentication successful,
©2010 Objectif Lune Inc - 202 -