name = $_POST['name'];
$page->slug = $newSlug;
$page->role = $_POST['role'];
$page->password = $_POST['password'];
$page->content = $_POST['content'];
} else {
// This is modification of an existing page
$page = new Page($originalSlug);
$page->title = $_POST['title'];
$page->mDate = time();
$page->content = $_POST['content'];
if ($originalSlug !== $newSlug) {
// The page needs to be moved
$page->slug = $originalSlug;
$page->rename($newSlug);
}
}
$page->write();
header('Location: /admin/pages');
exit();
} else if (isset($_GET['slug'])) {
$user = new User($_GET['slug']);
if ($user->slug) {
echo "
Editing $user->slug
";
} else {
echo "Creating a new user
";
}
echo "
";
}
?>