safe => 0, # regexp
rebuild => 1,
},
+ banned_users => {
+ type => "string",
+ default => [],
+ description => "users who cannot use the wiki",
+ safe => 1,
+ rebuild => 0,
+ },
wiki_file_prune_regexps => {
type => "internal",
default => [qr/(^|\/)\.\.(\/|$)/, qr/^\./, qr/\/\./,
} else {
print $session->header(-charset => 'utf-8');
}
-
} #}}}
sub showform ($$$$;@) { #{{{
fieldset => "admin");
my $user_name=$session->param("name");
+
+ # XXX deprecated, should be removed eventually
if (! is_admin($user_name)) {
$form->field(name => "banned_users", type => "hidden");
}
-
if (! $form->submitted) {
$form->field(name => "email", force => 1,
value => userinfo_get($user_name, "email"));
if (is_admin($user_name)) {
- $form->field(name => "banned_users", force => 1,
- value => join(" ", get_banned_users()));
+ my $value=join(" ", get_banned_users());
+ if (length $value) {
+ $form->field(name => "banned_users", force => 1,
+ value => join(" ", get_banned_users()),
+ comment => "deprecated; please move to banned_users in setup file");
+ }
+ else {
+ $form->field(name => "banned_users", type => "hidden");
+ }
}
}
userinfo_set($user_name, 'email', $form->field('email')) ||
error("failed to set email");
}
+
+ # XXX deprecated, should be removed eventually
if (is_admin($user_name)) {
set_banned_users(grep { ! is_admin($_) }
split(' ',
$form->field("banned_users"))) ||
error("failed saving changes");
+ if (! length $form->field("banned_users")) {
+ $form->field(name => "banned_users", type => "hidden");
+ }
}
+
$form->text(gettext("Preferences saved."));
}
}
}
} #}}}
+
+sub check_banned ($$) { #{{{
+ my $q=shift;
+ my $session=shift;
+
+ my $name=$session->param("name");
+ if (defined $name) {
+ # XXX banned in userinfo is deprecated, should be removed
+ # eventually, and only banned_users be checked.
+ if (userinfo_get($session->param("name"), "banned") ||
+ grep { $name eq $_ } @{$config{banned_users}}) {
+ print $q->header(-status => "403 Forbidden");
+ $session->delete();
+ print gettext("You are banned.");
+ cgi_savesession($session);
+ exit;
+ }
+ }
+}
sub cgi_getsession ($) { #{{{
my $q=shift;
}
}
- if (defined $session->param("name") &&
- userinfo_get($session->param("name"), "banned")) {
- print $q->header(-status => "403 Forbidden");
- $session->delete();
- print gettext("You are banned.");
- cgi_savesession($session);
- }
-
+ check_banned($q, $session);
+
run_hooks(sessioncgi => sub { shift->($q, $session) });
if ($do eq 'signin') {
return grep { $_ eq $user_name } @{$config{adminuser}};
} #}}}
+# XXX deprecated, should be removed eventually
sub get_banned_users () { #{{{
my @ret;
my $userinfo=userinfo_retrieve();
return @ret;
} #}}}
+# XXX deprecated, should be removed eventually
sub set_banned_users (@) { #{{{
my %banned=map { $_ => 1 } @_;
my $userinfo=userinfo_retrieve();
+ikiwiki (2.60) unstable; urgency=low
+
+ Admin preferences are moving from the web interface to the setup file.
+ There are three new options in the setup file: locked_pages, banned_users,
+ and allowed_attachments. The admin prefs page can still be used, but
+ that's deprecated, and the prefs will be hidden if a value is not already
+ set. If a value is set in the web interface, you're encouraged to move that
+ setting to your setup file now, since version 3.0 will remove the deprecated
+ web interface.
+
+ -- Joey Hess <joeyh@debian.org> Fri, 01 Aug 2008 17:02:14 -0400
+
ikiwiki (2.52) unstable; urgency=low
All wikis need to be rebuilt on upgrade to this version. If you listed your
* Version control backends promoted to first-class plugins.
* ikiwiki-update-wikilist: Add -r switch to remove. Default behavior is now
always to add.
- * The locked pages configuration is moving to a locked_pages option in the
- setup file, and the allowed attachments configuration to
- allowed_attachments. The admin prefs page can still be used for these, but
- that's depreacted and will only be shown if there's currently a value.
+ * Start moving admin preferences from the web interface to the setup file.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400
-Wiki admins can ban users via their Preferences.
-
-The list of banned users is space delimited.
+Banned users can be configured in the setup file.
If a banned user attempts to use the ikiwiki CGI, they will receive a 403
Forbidden webpage indicating they are banned.
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-01 15:43-0400\n"
+"POT-Creation-Date: 2008-08-01 17:10-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../IkiWiki/CGI.pm:140
+#: ../IkiWiki/CGI.pm:139
msgid "You need to log in first."
msgstr ""
-#: ../IkiWiki/CGI.pm:172
+#: ../IkiWiki/CGI.pm:171
msgid "login failed, perhaps you need to turn on cookies?"
msgstr ""
-#: ../IkiWiki/CGI.pm:190 ../IkiWiki/CGI.pm:526
+#: ../IkiWiki/CGI.pm:189 ../IkiWiki/CGI.pm:539
msgid "Your login session has expired."
msgstr ""
-#: ../IkiWiki/CGI.pm:211
+#: ../IkiWiki/CGI.pm:210
msgid "Login"
msgstr ""
-#: ../IkiWiki/CGI.pm:212
+#: ../IkiWiki/CGI.pm:211
msgid "Preferences"
msgstr ""
-#: ../IkiWiki/CGI.pm:213
+#: ../IkiWiki/CGI.pm:212
msgid "Admin"
msgstr ""
-#: ../IkiWiki/CGI.pm:267
+#: ../IkiWiki/CGI.pm:280
msgid "Preferences saved."
msgstr ""
-#: ../IkiWiki/CGI.pm:326
+#: ../IkiWiki/CGI.pm:339
#, perl-format
msgid "%s is not an editable page"
msgstr ""
-#: ../IkiWiki/CGI.pm:437 ../IkiWiki/Plugin/brokenlinks.pm:24
+#: ../IkiWiki/CGI.pm:450 ../IkiWiki/Plugin/brokenlinks.pm:24
#: ../IkiWiki/Plugin/inline.pm:306 ../IkiWiki/Plugin/opendiscussion.pm:17
#: ../IkiWiki/Plugin/orphans.pm:28 ../IkiWiki/Render.pm:78
#: ../IkiWiki/Render.pm:148
msgid "discussion"
msgstr ""
-#: ../IkiWiki/CGI.pm:493
+#: ../IkiWiki/CGI.pm:506
#, perl-format
msgid "creating %s"
msgstr ""
-#: ../IkiWiki/CGI.pm:511 ../IkiWiki/CGI.pm:539 ../IkiWiki/CGI.pm:549
-#: ../IkiWiki/CGI.pm:584 ../IkiWiki/CGI.pm:629
+#: ../IkiWiki/CGI.pm:524 ../IkiWiki/CGI.pm:552 ../IkiWiki/CGI.pm:562
+#: ../IkiWiki/CGI.pm:597 ../IkiWiki/CGI.pm:642
#, perl-format
msgid "editing %s"
msgstr ""
-#: ../IkiWiki/CGI.pm:729
+#: ../IkiWiki/CGI.pm:667
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:1086
+#: ../IkiWiki/CGI.pm:784 ../IkiWiki/CGI.pm:785 ../IkiWiki.pm:1096
msgid "Error"
msgstr ""
msgid "prohibited by allowed_attachments"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:184
+#: ../IkiWiki/Plugin/attachment.pm:187
msgid "bad attachment filename"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:226
+#: ../IkiWiki/Plugin/attachment.pm:229
msgid "attachment upload"
msgstr ""
msgid "There are no broken links!"
msgstr ""
-#: ../IkiWiki/Plugin/bzr.pm:12 ../IkiWiki/Plugin/git.pm:15
-#: ../IkiWiki/Plugin/mercurial.pm:12 ../IkiWiki/Plugin/monotone.pm:15
-#: ../IkiWiki/Plugin/svn.pm:11 ../IkiWiki/Plugin/tla.pm:10
-msgid "cannot use multiple rcs plugins"
-msgstr ""
-
#: ../IkiWiki/Plugin/conditional.pm:18 ../IkiWiki/Plugin/cutpaste.pm:22
#: ../IkiWiki/Plugin/cutpaste.pm:37 ../IkiWiki/Plugin/cutpaste.pm:53
#: ../IkiWiki/Plugin/testpagespec.pm:17
msgid "refreshing wiki.."
msgstr ""
-#: ../IkiWiki.pm:410
+#: ../IkiWiki.pm:417
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
-#: ../IkiWiki.pm:1069
+#: ../IkiWiki.pm:461
+msgid "cannot use multiple rcs plugins"
+msgstr ""
+
+#: ../IkiWiki.pm:1079
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1557
+#: ../IkiWiki.pm:1567
msgid "yes"
msgstr ""