// if id looks like 123/weblogname, we need to split it.. if (isset($_GET['id']) && strpos($_GET['id'], "/") > 0) { list($_GET['id'], $_GET['w']) = explode("/", $_GET['id']); } define('__SILENT__', TRUE); define('LIVEPAGE', TRUE); include_once "pv_core.php"; include_once "modules/module_userreg.php"; $direct_output = TRUE; // some global initialisation stuff. It might seem useless to do it here, when it's // also done in pv_core. This is necesary, because the superglobals might have been // modified in archive_dynamic.php. $Pivot_Vars = array_merge($_GET, $_POST, $_SERVER); add_hook("display_entry", "pre"); // convert encoding to UTF-8 i18n_array_to_utf8($Pivot_Vars, $dummy_variable); if (isset($Pivot_Vars['uid'])) { $Pivot_Vars['uid'] = str_replace("standard-", "", $Pivot_Vars['uid']); $Pivot_Vars['id'] = $Pivot_Vars['uid']; } $override_weblog = ""; // check if we need to override the template. if (isset($Pivot_Vars['t'])) { // explicitly defined template is most important. $Pivot_Vars['t'] = basename($Pivot_Vars['t']); $override_template = $Pivot_Vars['t']; } else { if (isset($Pivot_Vars['w']) && $Pivot_Vars['w'] != "") { $override_weblog = weblog_from_para($Pivot_Vars['w']); // Checking if weblog exists if (!isset($Weblogs[$override_weblog])) {
/** * Initialise some things when the pivot interface must be shown: * * - Check if user is trying to register him/herself * - Check if user is logged in * - Load languages * - Convert encoding * - Load allowed functions for 'normal users' and 'admins' * - depending on userlevel, display the screen for normal or admin users * * @see CheckSanity(), CheckLogin(), LoadUserLanguage(), mainFunctions(), adminFunctions(), startAdmin(), startNormal() */ function Load() { global $Pivot_Vars, $Cfg, $Users, $ThisUser; CheckSanity(); if ($Cfg['installed'] == 0) { require_once 'setup.php'; } else { CheckLogin(); // Redirecting to page requested after log in (if needed) if (!empty($Pivot_Vars['login_query_string'])) { SaveSettings(); redirect("index.php?" . urldecode($Pivot_Vars['login_query_string']) . "&session=" . $Pivot_Vars['session']); } LoadUserLanguage(); // convert encoding to UTF-8 i18n_array_to_utf8($Pivot_Vars, $dummy_variable); $ThisUser = $Users[$Pivot_Vars['user']]; require_once 'pv_data.php'; mainFunctions(); if ($Users[$Pivot_Vars['user']]['userlevel'] >= 3) { adminFunctions(); } if (isset($Pivot_Vars['menu']) && $Pivot_Vars['menu'] == 'admin') { require_once 'pv_admin.php'; startAdmin(); } else { startNormal(); } } SaveSettings(); }
/** * Returns info about user. * * @todo Fetch more info (if possible) from global $Users array. * * @param string $uid * @return array */ function pivot_user_info($uid) { $info = array('userid' => $uid, 'firstname' => '', 'lastname' => '', 'nickname' => $uid, 'email' => '', 'url' => ''); i18n_array_to_utf8($info, $dummy, true); return $info; }
ob_start(); define('LIVEPAGE', TRUE); include_once 'pv_core.php'; include_once 'modules/module_userreg.php'; LoadDefLanguage(); $override_weblog = find_current_weblog_request(); if (empty($override_weblog)) { $override_weblog = find_current_weblog_referer(); } set_current_weblog($override_weblog); LoadWeblogLanguage($Weblogs[$Current_weblog]['language']); ob_start(); // Add lang('commentuser','title') to title? $input = array_merge($_POST, $_GET); // convert encoding to UTF-8 i18n_array_to_utf8($input, $dummy_variable); foreach ($input as $key => $value) { $input[$key] = trim($value); } $message = ""; if (isset($_COOKIE['piv_reguser'])) { list($c_user, $c_hash) = explode("|", $_COOKIE['piv_reguser']); if (check_user_hash($c_user, $c_hash)) { $user = load_user($c_user); if (!isset($input['func'])) { $input['func'] = "options"; } //} else { // echo "No"; } }