} if (getRequestVarAtIndex(4) != "") { $optionalredirect .= "/" . getRequestVarAtIndex(4); } if (getRequestVarAtIndex(5) != "") { $optionalredirect .= "/" . getRequestVarAtIndex(5); } if (getRequestVarAtIndex(6) != "") { $optionalredirect .= "/" . getRequestVarAtIndex(6); } $userroles = explode(',', USER_ROLES); //$userroles = array( "admin", "staff" ); if (!(getRequestVarAtIndex(0) == "admin" && getRequestVarAtIndex(1) == "login")) { LoginRequired("/admin/login/" . $optionalredirect, $userroles); } $page = get_content_page(); $area = get_content_area(); $user = Users::GetCurrentUser(); $pagename = getRequestVarAtIndex(1); $pagetitle = $pagename != "" ? ucwords(unslug($pagename)) : "Backend GUI"; $bodyclass = $pagename != "" ? $pagename : "home"; $maintenancemode = MAINTENANCE_MODE ? ' {Maintenance Mode}' : ''; ?> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title><?php echo $pagetitle . " | " . SITE_NAME; ?>
function page_get_content($content, $args = array()) { extract($args); if (!$content_arr) { $page_hash[] = md5($content); $re_info['content'] = rules_get_contents($content, $rules); $re_info['page_url'] = $url; $re_info['page'] = 1; if (!$re_info) { unset($content_arr); return FALSE; } if (intval($re_info) != -1) { $content_arr[md5($url)] = $re_info; } } foreach ((array) $content_page_arr as $k => $v) { if ($v == '#' || !$v || $v == $url || in_array($v, $oldurl)) { continue; } $url_parse_arr = parse_url(strtolower($v)); parse_str($url_parse_arr['query'], $page_temp_arr); if ($page_temp_arr['page'] == 1) { continue; } $content = get_contents($v, array('cookie' => $rules['login_cookie'])); $hash = md5($content); if (in_array($hash, $page_hash)) { continue; } $oldurl[] = $v; $page_hash[] = $hash; $num = count($content_arr) + 1; $re_info['content'] = rules_get_contents($content, $rules); $re_info['page_url'] = $v; $re_info['page'] = $num; $content_arr[md5($v)] = $re_info; if ($rules['content_page_get_mode'] != 1) { //全部列出模式 $content_page_arr = get_content_page($v, $content, $rules); $args = array('oldurl' => $oldurl, 'content_arr' => $content_arr, 'content_page_arr' => $content_page_arr, 'page_hash' => $page_hash, 'rules' => $rules_info, 'url' => $url); return page_get_content($content, $args); } } return $content_arr; }
<?php $adminpages = array("list_paypal", "edit_paypal", "add_user", "edit_user", "list_users", "options"); $thispage = get_content_page(); if (in_array($thispage->name, $adminpages)) { $displayadmin = " opened"; $openorclosed = " menu-close"; } else { $displayadmin = $openorclosed = ""; } $thisuser = Users::GetCurrentUser(); if ($thisuser->has_role()) { ?> <h4><a id="adminbutton" class="openmenu<?php echo $openorclosed; ?> " href="#admincontrols">Admin Controls</a></h4> <div id="admincontrols" class="menudrop<?php echo $displayadmin; ?> "> <?php if (PRODUCT_INSTALL) { ?> <h4>Paypal</h4> <a href="<?php echo get_link("admin/list_paypal"); ?> ">Edit Accounts</a>