From: Joey Hess Date: Thu, 4 Feb 2010 20:30:41 +0000 (-0500) Subject: Add link to userpage (or creation link) to top of preferences page. X-Git-Tag: 3.20100212~65 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/a2e78ebcf27680eedf30e00f1ee9b86ed1d9e127 Add link to userpage (or creation link) to top of preferences page. --- diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 94c5b0492..b3a798055 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -206,21 +206,35 @@ sub formbuilder_setup (@) { } } } - elsif ($form->title eq "preferences" && - ! IkiWiki::openiduser($session->param("name"))) { - $form->field(name => "name", disabled => 1, - value => $session->param("name"), force => 1, - fieldset => "login"); - $form->field(name => "password", type => "password", - fieldset => "login", - validate => sub { - shift eq $form->field("confirm_password"); - }), - $form->field(name => "confirm_password", type => "password", - fieldset => "login", - validate => sub { - shift eq $form->field("password"); - }), + elsif ($form->title eq "preferences") { + my $user=$session->param("name"); + if (! IkiWiki::openiduser($user)) { + $form->field(name => "name", disabled => 1, + value => $user, force => 1, + fieldset => "login"); + $form->field(name => "password", type => "password", + fieldset => "login", + validate => sub { + shift eq $form->field("confirm_password"); + }); + $form->field(name => "confirm_password", type => "password", + fieldset => "login", + validate => sub { + shift eq $form->field("password"); + }); + + my $userpage=$config{userdir} ? $config{userdir}."/".$user : $user; + if (exists $pagesources{$userpage}) { + $form->text(gettext("Your user page: "). + htmllink("", "", $userpage, + noimageinline => 1)); + } + else { + $form->text(" "edit", page => $userpage). + "\">".gettext("Create your user page").""); + } + } } } diff --git a/debian/changelog b/debian/changelog index 9867cf75a..e07bada28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register * Improve display of openid in preferences page. + * Add link to userpage (or creation link) to top of preferences page. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500