Usage:
-See the included example_login.php, process_login.php, example_selfservice.php
-and view_invoice.php files. These files perform a self-service login
-and display a basic landing page. To use, copy them to the wordpress content
-directory (or a subdirectory), and point your browser to example_login.php
+See the included example_login.php, process_login.php, process_login.php,
+example_selfservice.php and view_invoice.php files. These files perform a
+self-service login and display a basic landing page. To use, copy them and
+the elements/ subdirectory to the wordpress content directory (or a
+subdirectory) and point your browser to example_login.php
For full API documentation including all available functions, their arguments
and return data, see
<p><a href="view_invoice.php?invnum=<?php echo $max_invnum ?>">View my Bill</a></p>
<p><a href="change_bill.php">Change Bill Deliver Options</a></p>
+<p><a href="process_logout.php">Logout</a></p>
<h3>Services</h3>
//TODO: remove freeside_server on uninstall
function freeside_init() {
+
+ if ( $GLOBALS['FREESIDE_PROCESS_LOGOUT'] ) {
+ $GLOBALS['FREESIDE_PROCESS_LOGOUT'] = false;
+
+ $freeside = new FreesideSelfService();
+ $response = $freeside->logout( array(
+ 'session_id' => $_COOKIE['freeside_session_id'],
+ ) );
+ setcookie('freeside_session_id', '', time() - 3600);
+ $error = $response['error'];
+ if ( $error ) {
+ error_log("Logout error: $error");
+ }
+ return;
+ }
+
if ( ! $GLOBALS['FREESIDE_PROCESS_LOGIN'] ) {
return;
} else {
)));
$file = file_get_contents($URL, false, $context);
$response = xmlrpc_decode($file);
- if (xmlrpc_is_fault($response)) {
+ if (isset($response) && xmlrpc_is_fault($response)) {
trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])");
} else {
//error_log("[FreesideSelfService] $response");
--- /dev/null
+<?php
+
+$GLOBALS['FREESIDE_PROCESS_LOGOUT'] = true;
+
+require( dirname( __FILE__ ) . '/wp-blog-header.php' );
+
+get_header();
+
+?>
+
+You have been logged out.
+
+<?php get_footer(); ?>