summaryrefslogtreecommitdiff
path: root/ng_selfservice/elements
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-10-10 12:53:53 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-10-10 12:53:53 -0400
commit2a82381a976c22f2c0d85645e8b327713ddcbd88 (patch)
tree43fd5de23281639139b6b705490b04595f0bb1ac /ng_selfservice/elements
parent29445ff3f69c32ba0f836f3c5bbaf946c154b360 (diff)
RT# 39340 - created access to payment only via ip address, fixes security by creating a seperate session
Diffstat (limited to 'ng_selfservice/elements')
-rw-r--r--ng_selfservice/elements/payment_only_menu.php101
1 files changed, 101 insertions, 0 deletions
diff --git a/ng_selfservice/elements/payment_only_menu.php b/ng_selfservice/elements/payment_only_menu.php
new file mode 100644
index 0000000..8fb9331
--- /dev/null
+++ b/ng_selfservice/elements/payment_only_menu.php
@@ -0,0 +1,101 @@
+<?
+
+require_once('session.php');
+
+$skin_info = $freeside->payment_only_skin_info( array(
+ 'session_id' => $_COOKIE['session_id'],
+) );
+
+
+if ( isset($skin_info['error']) && $skin_info['error'] ) {
+ $error = $skin_info['error'];
+ header('Location:payment_only_error.php?error='. urlencode($error));
+ die();
+}
+
+extract($skin_info);
+
+?>
+<style type="text/css">
+#menu_ul ul li {
+ display: inline;
+ width: 100%;
+}
+</style>
+
+<ul id="menu_ul">
+
+<?
+
+ $menu_array = explode("\n", $menu);
+ $submenu = array();
+
+ foreach ($menu_array AS $menu_item) {
+ if ( preg_match('/^\s*$/', $menu_item) ) {
+ print_menu($submenu, $current_menu, $menu_disable);
+ $submenu = array();
+ } else {
+ $submenu[] = $menu_item;
+ }
+ }
+ print_menu($submenu, $current_menu, $menu_disable);
+
+ function print_menu($submenu_array, $current_menu, $menu_disable) {
+ if ( count($submenu_array) == 0 ) { return; }
+
+ $links = array();
+ $labels = array();
+ foreach ($submenu_array AS $submenu_item) {
+ $pieces = preg_split('/\s+/', $submenu_item, 2, PREG_SPLIT_NO_EMPTY);
+ $links[] = $pieces[0];
+ $labels[] = $pieces[1];
+ }
+
+ print_link($links[0], $labels[0], $current_menu, $links);
+
+ if ( count($links) > 1 ) {
+ if ( in_array( $current_menu, $links ) ) {
+ echo '<img src="images/dropdown_arrow_white.gif">';
+ } else {
+ echo '<img src="images/dropdown_arrow_white.gif" style="display:none;">';
+ echo '<img src="images/dropdown_arrow_grey.gif">';
+ }
+ }
+
+ array_shift($links);
+ array_shift($labels);
+
+ echo '</a>';
+
+ if ( count($links) > 0 ) {
+ echo '<ul>';
+ foreach ($links AS $link) {
+ $label = array_shift($labels);
+ if ( in_array($label, $menu_disable) == 0) {
+ print_link($link, $label, $current_menu, array($link) );
+ echo '</a></li>';
+ }
+ }
+ echo '</ul>';
+ }
+
+ echo '</li>';
+
+ }
+
+ function print_link($link, $label, $current_menu, $search_array) {
+ echo '<li><a href="'. $link. '"';
+ if ( in_array( $current_menu, $search_array ) ) {
+ echo ' class="current_menu"';
+ }
+ echo '>'. _($label);
+ }
+
+?>
+
+</ul>
+
+<div style="clear:both;"></div>
+<table cellpadding="0" cellspacing="0" border="0" style="min-width:666px">
+<tr>
+<td class="page"> \ No newline at end of file