public function __construct($registry) { $this->registry = $registry; $this->registry->path = isset($_GET['path']) ? $_GET['path'] : $_POST['path']; $this->registry->sessionId = isset($_GET['session']) ? $_GET['session'] : $_POST['session']; $this->registry->registerPath(); parent::__construct($this->registry); }
/*{END_PHP_INI_PATH}*/ // Set include paths. $ini_path = ini_get('include_path') . PATH_SEPARATOR . __PHP_PATH . PATH_SEPARATOR . __PHP_PATH . '/PEAR' . PATH_SEPARATOR . __PHP_PATH . '/Uthando' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin/FileManager' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/functions' . PATH_SEPARATOR . __SITE_PATH . '/modules' . PATH_SEPARATOR . __SITE_PATH . '/components'; set_include_path($ini_path); // Include functions. require_once 'functions.php'; $registry = new Admin_Registry(true); $registry->setSite(realpath(__SITE_PATH . '/../../uthando/ini/uthandoSites.ini.php')); $registry->loadIniFiles(array('admin_config' => 'uthandoAdmin', 'config' => 'uthando')); $registry->setDefaults(); if (isset($_POST['session'])) { $pwd = $_POST['session'][0]; $iv = $_POST['session'][1]; } $registry->sessionId = Utility::decodeString($pwd, $iv); $uthando = new UthandoAdmin($registry); try { $registry->db = new DB_Admin($registry); $registry->session = new Session($registry); UthandoUser::setUserInfo(); if ($uthando->authorize()) { $ushop = new UShop_Manager($registry); $ushop->fireEvent(!empty($_POST['action']) ? $_POST['action'] : null); } } catch (PDOException $e) { $registry->Error($e->getMessage()); print_rr($e->getMessage()); } $registry->db = null; unset($uthando, $registry); ob_end_flush();
public function array_search_recursive($needle, $haystack, $strict = false, $path = array()) { if (!is_array($haystack)) { return false; } foreach ($haystack as $key => $val) { if (is_array($val) && ($subPath = UthandoAdmin::array_search_recursive($needle, $val, $strict, $path))) { $path = array_merge($path, array($key), $subPath); return $path; } elseif (!$strict && $val == $needle || $strict && $val === $needle) { $path[] = $key; return $path; } } return false; }
$ini_path = ini_get('include_path') . PATH_SEPARATOR . __PHP_PATH . PATH_SEPARATOR . __PHP_PATH . '/PEAR' . PATH_SEPARATOR . __PHP_PATH . '/Uthando' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin/FileManager' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/functions' . PATH_SEPARATOR . __SITE_PATH . '/modules' . PATH_SEPARATOR . __SITE_PATH . '/components'; set_include_path($ini_path); // Include functions. require_once 'functions.php'; $registry = new Admin_Registry(); $registry->setSite(realpath(__SITE_PATH . '/../../uthando/ini/uthandoSites.ini.php')); $registry->loadIniFiles(array('admin_config' => 'uthandoAdmin', 'config' => 'uthando')); $registry->setDefaults(); if (isset($_GET['session'])) { $registry->sessionId = $_GET['session']; } else { if (isset($_POST['session'])) { $registry->sessionId = $_POST['session']; } } $uthando = new UthandoAdmin($registry); try { $registry->db = new DB_Core($registry); $registry->session = new Session($registry); UthandoUser::setUserInfo(); if (isset($_POST['url']) && $uthando->authorize()) { // Load component. $dirs = array('site' => $_SERVER['DOCUMENT_ROOT'] . '/../templates/', 'admin' => $_SERVER['DOCUMENT_ROOT'] . '/templates/'); $opts = explode(':', $_POST['url']); $file = realpath($dirs[$opts[0]] . $opts[1] . '/index.html'); $file = file_get_contents($file); print $file; } } catch (PDOException $e) { $registry->Error($e->getMessage()); }
/*{START_PHP_INI_PATH}*/ define('__PHP_PATH', realpath(__SITE_PATH . '/../../uthando/php')); /*{END_PHP_INI_PATH}*/ // Set include paths. $ini_path = ini_get('include_path') . PATH_SEPARATOR . __PHP_PATH . PATH_SEPARATOR . __PHP_PATH . '/PEAR' . PATH_SEPARATOR . __PHP_PATH . '/Uthando' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/Admin' . PATH_SEPARATOR . __PHP_PATH . '/Uthando/functions' . PATH_SEPARATOR . __SITE_PATH . '/modules' . PATH_SEPARATOR . __SITE_PATH . '/components'; ini_set('include_path', $ini_path); // Include functions. require_once 'functions.php'; require_once 'admin_functions.php'; $timer = new Benchmark_Timer(); $timer->start(); $registry = new Admin_Registry(); $registry->setSite(realpath(__SITE_PATH . '/../../uthando/ini/uthandoSites.ini.php')); $registry->loadIniFiles(array('admin_config' => 'uthandoAdmin', 'config' => 'uthando')); $registry->setDefaults(); $uthando = new UthandoAdmin($registry); $registry->template = new HTML_Template($registry, $registry->get('admin_config.site.template')); require 'Dbug/FirePHP.class.php'; $registry->firephp = FirePHP::getInstance(true); try { $registry->db = new DB_Admin($registry); $registry->session = new Session($registry); UthandoUser::setUserInfo(); if ($uthando->authorize()) { $registry->template->addParameter('login_status', 'You are logged in as: ' . $_SESSION['username']); // Load component. $uthando->loadComponent(); // Get Modules and add them. $uthando->addModules(); } else { // set action and path.