Exemplo n.º 1
0
function printOutput($output)
{
    if ($GLOBALS['pie']['context'] == 'edit') {
        print "<div class=\"output\">\n{$output}</div>\n";
    } else {
        print $output;
    }
    pieTail();
    exit;
}
Exemplo n.º 2
0
pieHead("edit");
if (@$_REQUEST['user']) {
    // A user has been specified.
    $_REQUEST['user'] = pieGetOption($_REQUEST['user']);
    $user = new User();
    if (!$user->isValidName($_REQUEST['user'])) {
        pieError("BadUser");
    }
    if (!$user->exists($_REQUEST['user'])) {
        pieError("BadUser");
    }
} elseif ($_SESSION['user']) {
    // No user has been specified:
    // display information about myself.
    $_REQUEST['user'] = $_SESSION['user'];
}
if (!@$_REQUEST['user']) {
    pieError("NoUser");
}
$map = new MapFile();
$data = array('user' => htmlspecialchars($_REQUEST['user']), 'realname' => "&mdash;", 'lastlogin' => date($GLOBALS['pie']['time_format'], $map->read($GLOBALS['pie']['run_path'] . "/user/login.map", $_REQUEST['user'])));
$pref = new UserPref();
if (($val = $pref->read(@$_REQUEST['user'], 'realname')) !== false) {
    $data['realname'] = $val;
}
if (($val = $pref->read(@$_REQUEST['user'], 'registered')) !== false) {
    $data['registered'] = date($GLOBALS['pie']['time_format'], $val);
}
pieNotice("UserData", $data);
pieTail();
Exemplo n.º 3
0
        if (!($dump = file_get_contents("{$path}/{$file}"))) {
            pieError("NoTemplates");
        }
        $meta = pieExplodePage($dump);
        $list[$file] = $meta['title'];
    }
    closedir($dh);
    asort($list);
    // Present available templates.
    $l = "";
    foreach ($list as $file => $info) {
        $l .= "<option value=\"{$file}\">" . htmlspecialchars($info) . "</option>\n";
    }
    pieError("TemplateList", array('templates' => $l));
} else {
    // Create a new, empty page.
    $_REQUEST['source'] = '';
}
// Initialize and print editing form.
if (empty($_REQUEST['source'])) {
    if ($GLOBALS['pie']['page_header']) {
        $_REQUEST['title'] = str_replace('_', ' ', $_REQUEST['page']);
    }
    $_REQUEST['comment'] = $GLOBALS['pie']['locale']->key('InitialVersion');
}
pieNotice("EditScript");
pieNotice("CharacterPanel");
pieNotice("EditPanel");
pieNotice("PageEdit");
pieTail("edit");
Exemplo n.º 4
0
function pieError($message, $data = array())
{
    pieNotice($message, $data);
    pieTail();
    exit;
}