This commit is contained in:
Shish 2021-02-26 23:55:00 +00:00
parent e88ca1fb05
commit 253d75ae82
2 changed files with 8 additions and 9 deletions

View file

@ -14,22 +14,21 @@ class Biography extends Extension
if ($user->id == $duser->id) {
$this->theme->display_composer($page, $bio);
}
else {
} else {
$this->theme->display_biography($page, $bio);
}
}
}
public function onPageRequest(PageRequestEvent $event)
{
global $cache, $database, $page, $user, $user_config;
if ($event->page_matches("biography")) {
if ($user->check_auth_token()) {
if ($user->check_auth_token()) {
$user_config->set_string("biography", $_POST['biography']);
$page->flash("Bio Updated");
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(referer_or(make_link()));
}
$page->flash("Bio Updated");
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(referer_or(make_link()));
}
}
}
}

View file

@ -3,7 +3,7 @@ class BiographyTest extends ShimmiePHPUnitTestCase
{
public function testBio()
{
global $database;
global $database;
$this->log_in_as_user();
$this->post_page("biography", ["biography"=>"My bio goes here"]);
$this->get_page("user/" . self::$user_name);