safe => 0, # executed
rebuild => 0,
},
+ allowed_attachments => {
+ type => "string",
+ example => "mimetype(image/*) and maxsize(50kb)",
+ description => "enhanced PageSpec specifying what attachments are allowed",
+ description_html => htmllink("", "",
+ "ikiwiki/PageSpec/attachment",
+ noimageinline => 1,
+ linktext => "enhanced PageSpec",
+ )." specifying what attachments are allowed",
+ safe => 1,
+ rebuild => 0,
+ },
} #}}}
sub check_canattach ($$;$) { #{{{
# Use a special pagespec to test that the attachment is valid.
my $allowed=1;
- foreach my $admin (@{$config{adminuser}}) {
- my $allowed_attachments=IkiWiki::userinfo_get($admin, "allowed_attachments");
- if (defined $allowed_attachments &&
- length $allowed_attachments) {
- $allowed=pagespec_match($dest,
- $allowed_attachments,
- file => $file,
- user => $session->param("name"),
- ip => $ENV{REMOTE_ADDR},
- );
- last if $allowed;
+ if (defined $config{allowed_attachments} &&
+ length $config{allowed_attachments}) {
+ $allowed=pagespec_match($dest,
+ $config{allowed_attachments},
+ file => $file,
+ user => $session->param("name"),
+ ip => $ENV{REMOTE_ADDR},
+ );
+ }
+
+ # XXX deprecated, should be removed eventually
+ if ($allowed) {
+ foreach my $admin (@{$config{adminuser}}) {
+ my $allowed_attachments=IkiWiki::userinfo_get($admin, "allowed_attachments");
+ if (defined $allowed_attachments &&
+ length $allowed_attachments) {
+ $allowed=pagespec_match($dest,
+ $allowed_attachments,
+ file => $file,
+ user => $session->param("name"),
+ ip => $ENV{REMOTE_ADDR},
+ );
+ last if $allowed;
+ }
}
}
+
if (! $allowed) {
error(gettext("prohibited by allowed_attachments")." ($allowed)");
}
}
}
elsif ($form->title eq "preferences") {
+ # XXX deprecated, should remove eventually
my $session=$params{session};
my $user_name=$session->param("name");
$form->field(name => "allowed_attachments", size => 50,
fieldset => "admin",
- comment => "(".
- htmllink("", "",
- "ikiwiki/PageSpec/attachment",
- noimageinline => 1,
- linktext => "Enhanced PageSpec",
- ).")"
+ comment => "deprecated; please move to allowed_attachments in setup file",
);
if (! IkiWiki::is_admin($user_name)) {
$form->field(name => "allowed_attachments", type => "hidden");
}
if (! $form->submitted) {
- $form->field(name => "allowed_attachments", force => 1,
- value => IkiWiki::userinfo_get($user_name, "allowed_attachments"));
+ my $value=IkiWiki::userinfo_get($user_name, "allowed_attachments");
+ if (length $value) {
+ $form->field(name => "allowed_attachments", force => 1,
+ value => IkiWiki::userinfo_get($user_name, "allowed_attachments"));
+ }
+ else {
+ $form->field(name => "allowed_attachments", type => "hidden");
+ }
}
if ($form->submitted && $form->submitted eq 'Save Preferences') {
if (defined $form->field("allowed_attachments")) {
use IkiWiki 2.00;
sub import { #{{{
+ hook(type => "getsetup", id => "lockedit", call => \&getsetup);
hook(type => "canedit", id => "lockedit", call => \&canedit);
hook(type => "formbuilder_setup", id => "lockedit",
call => \&formbuilder_setup);
} # }}}
+sub getsetup () { #{{{
+ return
+ locked_pages => {
+ type => "string",
+ example => "!*/Discussion",
+ description => "PageSpec controlling which pages are locked",
+ description_html => htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).
+ " controlling which pages are locked",
+ safe => 1,
+ rebuild => 0,
+ },
+} #}}}
+
sub canedit ($$) { #{{{
my $page=shift;
my $cgi=shift;
my $user=$session->param("name");
return undef if defined $user && IkiWiki::is_admin($user);
+ if (defined $config{locked_pages} && length $config{locked_pages} &&
+ pagespec_match($page, $config{locked_pages})) {
+ if (! defined $user ||
+ ! IkiWiki::userinfo_get($session->param("name"), "regdate")) {
+ return sub { IkiWiki::needsignin($cgi, $session) };
+ }
+ else {
+ return sprintf(gettext("%s is locked and cannot be edited"),
+ htmllink("", "", $page, noimageinline => 1));
+
+ }
+ }
+
+ # XXX deprecated, should be removed eventually
foreach my $admin (@{$config{adminuser}}) {
if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"))) {
if (! defined $user ||
return sub { IkiWiki::needsignin($cgi, $session) };
}
else {
- return sprintf(gettext("%s is locked by %s and cannot be edited"),
- htmllink("", "", $page, noimageinline => 1),
- IkiWiki::userlink($admin));
+ return sprintf(gettext("%s is locked and cannot be edited"),
+ htmllink("", "", $page, noimageinline => 1));
}
}
}
sub formbuilder_setup (@) { #{{{
my %params=@_;
-
+
+ # XXX deprecated, should be removed eventually
my $form=$params{form};
if ($form->title eq "preferences") {
my $session=$params{session};
$form->field(name => "locked_pages", size => 50,
fieldset => "admin",
- comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")");
+ comment => "deprecated; please move to locked_pages in setup file"
+ );
if (! IkiWiki::is_admin($user_name)) {
$form->field(name => "locked_pages", type => "hidden");
}
if (! $form->submitted) {
- $form->field(name => "locked_pages", force => 1,
- value => IkiWiki::userinfo_get($user_name, "locked_pages"));
+ my $value=IkiWiki::userinfo_get($user_name, "locked_pages");
+ if (length $value) {
+ $form->field(name => "locked_pages", force => 1, value => $value);
+ }
+ else {
+ $form->field(name => "locked_pages", type => "hidden");
+ }
}
if ($form->submitted && $form->submitted eq 'Save Preferences') {
if (defined $form->field("locked_pages")) {
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-31 19:25-0400\n"
+"POT-Creation-Date: 2008-08-01 15:43-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"
msgstr ""
#: ../IkiWiki/CGI.pm:437 ../IkiWiki/Plugin/brokenlinks.pm:24
-#: ../IkiWiki/Plugin/inline.pm:261 ../IkiWiki/Plugin/opendiscussion.pm:17
+#: ../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"
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:785
+#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:1086
msgid "Error"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:57
+#: ../IkiWiki/Plugin/aggregate.pm:76
msgid "Aggregation triggered via web."
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:66
+#: ../IkiWiki/Plugin/aggregate.pm:85
msgid "Nothing to do right now, all feeds are up-to-date!"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:193
+#: ../IkiWiki/Plugin/aggregate.pm:212
#, perl-format
msgid "missing %s parameter"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:227
+#: ../IkiWiki/Plugin/aggregate.pm:246
msgid "new feed"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:241
+#: ../IkiWiki/Plugin/aggregate.pm:260
msgid "posts"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:243
+#: ../IkiWiki/Plugin/aggregate.pm:262
msgid "new"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:406
+#: ../IkiWiki/Plugin/aggregate.pm:425
#, perl-format
msgid "expiring %s (%s days old)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:413
+#: ../IkiWiki/Plugin/aggregate.pm:432
#, perl-format
msgid "expiring %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:440
+#: ../IkiWiki/Plugin/aggregate.pm:459
#, perl-format
msgid "processed ok at %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:444
+#: ../IkiWiki/Plugin/aggregate.pm:463
#, perl-format
msgid "checking feed %s ..."
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:449
+#: ../IkiWiki/Plugin/aggregate.pm:468
#, perl-format
msgid "could not find feed at %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:464
+#: ../IkiWiki/Plugin/aggregate.pm:483
msgid "feed not found"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:475
+#: ../IkiWiki/Plugin/aggregate.pm:494
#, perl-format
msgid "(invalid UTF-8 stripped from feed)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:481
+#: ../IkiWiki/Plugin/aggregate.pm:500
#, perl-format
msgid "(feed entities escaped)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:487
+#: ../IkiWiki/Plugin/aggregate.pm:506
msgid "feed crashed XML::Feed!"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:561
+#: ../IkiWiki/Plugin/aggregate.pm:580
#, perl-format
msgid "creating new page %s"
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:30
+#: ../IkiWiki/Plugin/amazon_s3.pm:31
msgid "deleting bucket.."
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:37 ../IkiWiki/Setup.pm:117
+#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:193
msgid "done"
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:46
+#: ../IkiWiki/Plugin/amazon_s3.pm:93
#, perl-format
msgid "Must specify %s"
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:85
+#: ../IkiWiki/Plugin/amazon_s3.pm:132
msgid "Failed to create bucket in S3: "
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:170
+#: ../IkiWiki/Plugin/amazon_s3.pm:217
msgid "Failed to save file to S3: "
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:192
+#: ../IkiWiki/Plugin/amazon_s3.pm:239
msgid "Failed to delete file from S3: "
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:22
+#: ../IkiWiki/Plugin/attachment.pm:46
#, perl-format
msgid "there is already a page named %s"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:41
+#: ../IkiWiki/Plugin/attachment.pm:79
msgid "prohibited by allowed_attachments"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:144
+#: ../IkiWiki/Plugin/attachment.pm:184
msgid "bad attachment filename"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:186
+#: ../IkiWiki/Plugin/attachment.pm:226
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 "failed to determine size of image %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:47
+#: ../IkiWiki/Plugin/inline.pm:89
msgid "Must specify url to wiki with --url when using --rss or --atom"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:101
+#: ../IkiWiki/Plugin/inline.pm:146
msgid "missing pages parameter"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:149
+#: ../IkiWiki/Plugin/inline.pm:194
#, perl-format
msgid "unknown sort type %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:220
+#: ../IkiWiki/Plugin/inline.pm:265
msgid "Add a new post titled:"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:236
+#: ../IkiWiki/Plugin/inline.pm:281
#, perl-format
msgid "nonexistant template %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:269 ../IkiWiki/Render.pm:82
+#: ../IkiWiki/Plugin/inline.pm:314 ../IkiWiki/Render.pm:82
msgid "Discussion"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:506
+#: ../IkiWiki/Plugin/inline.pm:551
msgid "RPC::XML::Client not found, not pinging"
msgstr ""
msgid "failed to run dot"
msgstr ""
-#: ../IkiWiki/Plugin/lockedit.pm:29
+#: ../IkiWiki/Plugin/lockedit.pm:43 ../IkiWiki/Plugin/lockedit.pm:57
#, perl-format
-msgid "%s is locked by %s and cannot be edited"
+msgid "%s is locked and cannot be edited"
msgstr ""
-#: ../IkiWiki/Plugin/mdwn.pm:28
+#: ../IkiWiki/Plugin/mdwn.pm:40
msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed"
msgstr ""
-#: ../IkiWiki/Plugin/mdwn.pm:51
+#: ../IkiWiki/Plugin/mdwn.pm:63
#, perl-format
msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"
msgstr ""
msgid "redir cycle is not allowed"
msgstr ""
-#: ../IkiWiki/Plugin/mirrorlist.pm:23
+#: ../IkiWiki/Plugin/mirrorlist.pm:35
msgid "Mirrors"
msgstr ""
-#: ../IkiWiki/Plugin/mirrorlist.pm:23
+#: ../IkiWiki/Plugin/mirrorlist.pm:35
msgid "Mirror"
msgstr ""
msgid "more"
msgstr ""
-#: ../IkiWiki/Plugin/openid.pm:45
+#: ../IkiWiki/Plugin/norcs.pm:55
+msgid "getctime not implemented"
+msgstr ""
+
+#: ../IkiWiki/Plugin/openid.pm:57
msgid "Log in with"
msgstr ""
-#: ../IkiWiki/Plugin/openid.pm:48
+#: ../IkiWiki/Plugin/openid.pm:60
msgid "Get an OpenID"
msgstr ""
msgid "bad or missing template"
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:223
+#: ../IkiWiki/Plugin/passwordauth.pm:243
msgid "Account creation successful. Now you can Login."
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:226
+#: ../IkiWiki/Plugin/passwordauth.pm:246
msgid "Error creating account."
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:233
+#: ../IkiWiki/Plugin/passwordauth.pm:253
msgid "No email address, so cannot email password reset instructions."
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:265
+#: ../IkiWiki/Plugin/passwordauth.pm:287
msgid "Failed to send mail"
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:267
+#: ../IkiWiki/Plugin/passwordauth.pm:289
msgid "You have been mailed password reset instructions."
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:302
+#: ../IkiWiki/Plugin/passwordauth.pm:324
msgid "incorrect password reset url"
msgstr ""
-#: ../IkiWiki/Plugin/passwordauth.pm:305
+#: ../IkiWiki/Plugin/passwordauth.pm:327
msgid "password reset denied"
msgstr ""
msgid "Ping received."
msgstr ""
-#: ../IkiWiki/Plugin/pinger.pm:37
+#: ../IkiWiki/Plugin/pinger.pm:49
msgid "requires 'from' and 'to' parameters"
msgstr ""
-#: ../IkiWiki/Plugin/pinger.pm:42
+#: ../IkiWiki/Plugin/pinger.pm:54
#, perl-format
msgid "Will ping %s"
msgstr ""
-#: ../IkiWiki/Plugin/pinger.pm:45
+#: ../IkiWiki/Plugin/pinger.pm:57
#, perl-format
msgid "Ignoring ping directive for wiki %s (this wiki is %s)"
msgstr ""
-#: ../IkiWiki/Plugin/pinger.pm:61
+#: ../IkiWiki/Plugin/pinger.pm:73
msgid "LWP not found, not pinging"
msgstr ""
msgid "%A night"
msgstr ""
-#: ../IkiWiki/Plugin/prettydate.pm:78
+#: ../IkiWiki/Plugin/prettydate.pm:96
msgid "at teatime on %A"
msgstr ""
-#: ../IkiWiki/Plugin/prettydate.pm:82
+#: ../IkiWiki/Plugin/prettydate.pm:100
msgid "at midnight"
msgstr ""
-#: ../IkiWiki/Plugin/prettydate.pm:85
+#: ../IkiWiki/Plugin/prettydate.pm:103
msgid "at noon on %A"
msgstr ""
-#: ../IkiWiki/Plugin/recentchanges.pm:76
+#: ../IkiWiki/Plugin/recentchanges.pm:95
msgid "missing page"
msgstr ""
-#: ../IkiWiki/Plugin/recentchanges.pm:78
+#: ../IkiWiki/Plugin/recentchanges.pm:97
#, perl-format
msgid "The page %s does not exist."
msgstr ""
msgid "update for rename of %s to %s"
msgstr ""
-#: ../IkiWiki/Plugin/search.pm:20
+#: ../IkiWiki/Plugin/search.pm:32
#, perl-format
msgid "Must specify %s when using the search plugin"
msgstr ""
-#: ../IkiWiki/Plugin/search.pm:166
+#: ../IkiWiki/Plugin/search.pm:178
#, perl-format
msgid "need Digest::SHA1 to index %s"
msgstr ""
-#: ../IkiWiki/Plugin/search.pm:201
+#: ../IkiWiki/Plugin/search.pm:213
msgid "search"
msgstr ""
msgid "failed to generate image from code"
msgstr ""
-#: ../IkiWiki/Rcs/Stub.pm:96
-msgid "getctime not implemented"
-msgstr ""
-
#: ../IkiWiki/Render.pm:276 ../IkiWiki/Render.pm:297
#, perl-format
msgid "skipping bad filename %s"
#. translators: The first parameter is a filename, and the second
#. translators: is a (probably not translated) error message.
-#: ../IkiWiki/Setup.pm:25
+#: ../IkiWiki/Setup.pm:17
#, perl-format
msgid "cannot read %s: %s"
msgstr ""
-#: ../IkiWiki/Setup.pm:58
-msgid "generating wrappers.."
-msgstr ""
-
-#: ../IkiWiki/Setup.pm:107
-msgid "rebuilding wiki.."
-msgstr ""
-
-#: ../IkiWiki/Setup.pm:110
-msgid "refreshing wiki.."
-msgstr ""
-
#: ../IkiWiki/Wrapper.pm:16
#, perl-format
msgid "%s doesn't seem to be executable"
msgid "usage: ikiwiki [options] source dest"
msgstr ""
-#: ../ikiwiki.in:82
+#: ../ikiwiki.in:79
msgid "usage: --set var=value"
msgstr ""
-#: ../IkiWiki.pm:126
+#: ../ikiwiki.in:126
+msgid "generating wrappers.."
+msgstr ""
+
+#: ../ikiwiki.in:182
+msgid "rebuilding wiki.."
+msgstr ""
+
+#: ../ikiwiki.in:185
+msgid "refreshing wiki.."
+msgstr ""
+
+#: ../IkiWiki.pm:410
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
-#: ../IkiWiki.pm:768
+#: ../IkiWiki.pm:1069
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1216
+#: ../IkiWiki.pm:1557
msgid "yes"
msgstr ""