diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-04-19 10:53:49 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-04-19 10:53:49 -0700 |
commit | 5cfe4a2d5a299af5af44b249e12f114c9c886850 (patch) | |
tree | bac9c8456706658f89fba32c79fb24b02b0b91ee /fs_selfservice | |
parent | f630d74ba5579f18e4c65733b13081f5afed9229 (diff) |
wordpress plugin, RT#75279
Diffstat (limited to 'fs_selfservice')
-rw-r--r-- | fs_selfservice/wordpress/README.txt | 8 | ||||
-rw-r--r-- | fs_selfservice/wordpress/example_selfservice.php | 20 | ||||
-rw-r--r-- | fs_selfservice/wordpress/freeside_selfservice.php | 4 | ||||
-rw-r--r-- | fs_selfservice/wordpress/view_invoice.php | 30 |
4 files changed, 43 insertions, 19 deletions
diff --git a/fs_selfservice/wordpress/README.txt b/fs_selfservice/wordpress/README.txt index 7e4dbcdc1..759f83963 100644 --- a/fs_selfservice/wordpress/README.txt +++ b/fs_selfservice/wordpress/README.txt @@ -18,8 +18,8 @@ self-service" plugin, and click "Activate". Configuration: -In Wordpress, go to Settings -> General and set "Freeside self-service URL" -to the +In Wordpress, go to Settings -> General and set "Freeside server" +to your Freeside server name or IP address. Freeside configuration: @@ -38,8 +38,8 @@ VPN or tunnel. Usage: -See the included example_login.php, process_login.php and -example_selfservice.php files. These files perform a self-service login +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 diff --git a/fs_selfservice/wordpress/example_selfservice.php b/fs_selfservice/wordpress/example_selfservice.php index ae588bf28..2bfb5b35c 100644 --- a/fs_selfservice/wordpress/example_selfservice.php +++ b/fs_selfservice/wordpress/example_selfservice.php @@ -4,9 +4,6 @@ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); $freeside = new FreesideSelfService(); -error_log( "COOKIE: ". $_COOKIE['freeside_session_id'] ); -error_log( "COOKIE: ". $GLOBALS['FREESIDE_SESSION_ID'] ); - $customer_info = $freeside->customer_info_short( array( 'session_id' => $_COOKIE['freeside_session_id'], ) ); @@ -22,8 +19,6 @@ extract($customer_info); get_header(); -error_log( "COOKIE: ". $_COOKIE['freeside_session_id'] ); - ?> <h3>Billing</h3> @@ -37,19 +32,21 @@ error_log( "COOKIE: ". $_COOKIE['freeside_session_id'] ); <?php } ?> <p><big><strong>Username</strong></big></p> -<p>me@gmail.com</p> +<p><?php echo htmlspecialchars($svc_label) ?></p> <p><big><strong>Account Number</strong></big></p> <p><?php echo $display_custnum ?></p> <p><big><strong>Address</strong></big></p> <address> -Box 564, Disneyland<br> -USA +<?php echo htmlspecialchars($address1); ?><br> +<?php echo strlen($address2) ? htmlspecialchars($address2).'<br>' : '' ?> +<?php echo $city ?>, <?php echo $state ?> <?php echo $zip ?><br> +<?php echo $country ?> </address> <p><big><strong>Email Address</strong></big></p> -<p>me@gmail.com</p> +<p><?php echo htmlspecialchars($invoicing_list) ?></p> <br> <br> @@ -60,8 +57,8 @@ USA <br> <br> <br> -<p><big><strong> <font color=" #4682B4">View my Bill</strong></big></font></p> -<p><big><strong> <font color="#4682B4">Change Bill Deliver Options</strong></big></font></p> +<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> @@ -70,7 +67,6 @@ USA <h4><font color="#4682B4"> <i class="fa fa-laptop"> </i> </font> Internet </h4> <h4><font color="#4682B4"> <i class="fa fa-volume-control-phone"> </i> </font> Voice </h4> - <?php echo $announcement ?> <!-- diff --git a/fs_selfservice/wordpress/freeside_selfservice.php b/fs_selfservice/wordpress/freeside_selfservice.php index 5fe7aa789..f619e8177 100644 --- a/fs_selfservice/wordpress/freeside_selfservice.php +++ b/fs_selfservice/wordpress/freeside_selfservice.php @@ -50,8 +50,6 @@ function freeside_init() { //error_log($GLOBALS['$FREESIDE_PROCESS_LOGIN']); if ( ! $GLOBALS['FREESIDE_PROCESS_LOGIN'] ) { -error_log("DACOOKIE: ". $_COOKIE['freeside_session_id']); - $GLOBALS['FREESIDE_SESSION_ID'] = $_COOKIE['freeside_session_id']; return; } else { $GLOBALS['FREESIDE_PROCESS_LOGIN'] = false; @@ -90,7 +88,7 @@ error_log("DACOOKIE: ". $_COOKIE['freeside_session_id']); $session_id = $response['session_id']; - error_log("[login] logged into freeside with session_id=$freeside_session_id, setting cookie"); + //error_log("[login] logged into freeside with session_id=$freeside_session_id, setting cookie"); // now what? for now, always redirect to the main page (or the select a // customer diversion). diff --git a/fs_selfservice/wordpress/view_invoice.php b/fs_selfservice/wordpress/view_invoice.php new file mode 100644 index 000000000..a1e1680c9 --- /dev/null +++ b/fs_selfservice/wordpress/view_invoice.php @@ -0,0 +1,30 @@ +<?php + +require( dirname( __FILE__ ) . '/wp-blog-header.php' ); + +$freeside = new FreesideSelfService(); + +$invoice_info = $freeside->invoice( array( + 'session_id' => $_COOKIE['freeside_session_id'], + 'invnum' => $_REQUEST['invnum'], +) ); + + +if ( isset($invoice_info['error']) && $invoice_info['error'] ) { + $error = $invoice_info['error']; + wp_redirect('example_login.php?freeside_error='. urlencode($error)); + die(); +} + +extract($invoice_info); + +get_header(); + +?> + +<h3>Invoice</h3> + +<?php echo $invoice_html ?> + +<?php get_footer(); ?> + |