Commit Graph

514 Commits (c4ebdd6f467f3361b1f444d9462e10acdbcf9322)

Author SHA1 Message Date
Joey Hess 2df0999e40 revert check_canedit nosubs thing
Abstraction violation. I now think the problem should be treated as a bug
in httpauth.
2010-08-30 18:31:56 -04:00
Joey Hess 8030ecac02 Receive: avoid hiding check_canedit error messages
Avoid the generic "you are not allowed to change" message,
and instead allow check_canedit to propigate out useful error messages.

Went back to calling check_canedit in fatal mode, but added a parameter to
avoid calling the troublesome subs that might cause a login attempt.
2010-08-30 17:58:00 -04:00
Joey Hess 991d01f5b5 optimise single dot detection
Since it already looks for things starting with a dot, I was able to avoid
matching against the string twice.

This also fixes a minor bug; $from may not be defined. Avoid uninitialized
value warnings in this case.
2010-08-30 13:36:00 -04:00
Giuseppe Bilotta c4d4cad3be Single dot in pagespec translates to 'current page' 2010-08-30 13:25:53 -04:00
Joey Hess 5d88146861 Fixes a bug that prevented matching deleted pages when using the page() PageSpec. 2010-08-04 08:25:10 -04:00
Joey Hess c401b6958a Add new disable hook, allowing plugins to perform cleanup after they have been disabled. 2010-07-26 16:33:42 -04:00
Joey Hess 1b0bef6d49 template: Fix dependency tracking. Broken in version 3.20100427.
template_depends was adding a dependency on the source filename,
instead of on the page name when a template is a page. Such a
dependency doesn't work.
2010-07-23 14:14:25 -04:00
Joey Hess b45688e34e Merge remote branch 'intrigeri/po' 2010-07-18 19:35:16 -04:00
Joey Hess eeb8e11d65 remove dead case 2010-07-18 17:47:36 -04:00
Joey Hess e674bb1445 fix other 2 cases of conflicting destdir files
Cleanly fixed case where destdir file failed to be written because there
was a directory with the same name. This can be detected with no extra
system calls, and dealt with by finding all pages that wrote files
inside the directory, and removing them and the directory.

The other, inverse case would be expensive to detect in will_render,
since it would need to check each parent directory of the file to see
if the directory is really a conflicting file. But prep_writefile
already does a similar scan for symlinks in the path, so I added code
there to remove the conflicting file. This fix assumes that the file
is written using writefile, and not some other means (but using other means
would be a security hole too, so hopefully nothing does).
2010-07-18 17:38:35 -04:00
Joey Hess 2bf3a6edbb check oldrenderedfiles too
Handles the case where foo.mdwn is moved too foo/index.html
2010-07-18 16:47:52 -04:00
Joey Hess 773db5a35e avoid error if two source files render the same destination file
There are two sub-caces. If both source files still exist, the winner that
renders the destination file is undefined. If one source file is deleted
and the other added, in a refresh, the new file will take over the
destination file.
2010-07-18 16:28:39 -04:00
intrigeri ff8f6cd6b2 Make the rationale clearer. 2010-07-11 11:35:37 +02:00
intrigeri 4a1cb092ba Revert po vs. template kludges.
This reverts commits dcd57dd5c9,
d4136aea8a and
d877b9644b.
2010-07-11 11:03:41 +02:00
intrigeri c99d26030e Merge remote branch 'upstream/master' into prv/po
Conflicts:
	IkiWiki/Plugin/po.pm
	doc/plugins/po.mdwn
2010-07-11 10:46:18 +02:00
Joey Hess 0eabe6f794 git: Added git_wrapper_background_command option. Can be used to eg, make the git wrapper push to github in the background after ikiwiki runs. 2010-07-01 16:57:20 -04:00
intrigeri dcd57dd5c9 Add a fullpage arg to filter.
Set it to true every time IkiWiki::filter is called on a full page's content.

This is a much nicer solution, for the po plugin, than previous whitelisting
using caller().
2010-06-29 15:17:56 +02:00
intrigeri 9f401d6617 Merge remote branch 'upstream/master' into prv/po
Conflicts:
	IkiWiki/Plugin/po.pm
2010-06-25 14:38:37 +02:00
Joey Hess ecdfd1b864 rcs_commit and rcs_commit_staged api changes
Using named parameters for these is overdue. Passing the session in a
parameter instead of passing username and IP separately will later allow
storing other session info, like username or part of the email.

Note that these functions are not part of the exported API,
and the prototype change will catch (most) skew, so I am not changing
API versions. Any third-party plugins that call them will need updated
though.
2010-06-23 19:04:36 -04:00
Joey Hess 17592a951b websetup: Allow enabling plugins listed in disable_plugins.
The bug here was that disabling a plugin included thru goodstuff, like
htmlscrubber, caused it to be added to disable_plugins, and those plugins
were never loaded, so could not be re-enabled. Fix by allowing them to be
force loaded when appropriate. (Also that allows disabled plugins to still
record their setup options when dumping a setup file.)
2010-06-13 10:21:19 -04:00
Joey Hess e96cf38ecc When editing a page, show that page's sidebar. (Thanks, privat) 2010-06-09 16:00:12 -04:00
Joey Hess cdf4292846 Fix support for globbing in tagged() pagespecs.
The linktype check was being done on the relativised link target,
but %typedlinks uses the same link targets as %links, so that didn't work.

I think the bug only appeared when tagbase was not set.

This bugfix also let me factor out the common typedlink checking code.
2010-06-09 14:39:17 -04:00
Joey Hess 1b6aa2276e creation_day() etc use local time, not gmtime.
To match calendars, which use local time. Particularly important at
the end of the month.

I checked the history, and there seemed no good rationalle for the
pagespecs to use gmtime.
2010-05-31 20:46:12 -04:00
Joey Hess 7aa209f1ce Fix a bug that prevented matching deleted comments, and so did not update pages that had contained them.
Problem is that by the time rendering calls render_dependent, %pagesources
has had deleted files removed from it. So match_comment's lookup of
files in there to see if they had the _comment extension failed.

I had to introduce a hash that temporarily holds filenames of deleted pages
to fix this.

Note that unlike comment(), internal() had avoided this pitfall by being
defined to match both internal and non-internal pages.
2010-05-18 13:32:28 -04:00
Joey Hess c8b34aa31c allow misctemplate callers to pass params to suppress actions etc
Suppress disiplay of small search for on search results page, and of
Prefrences link on prefs page.
2010-05-14 21:45:54 -04:00
Joey Hess bbe971881a refactor template actions 2010-05-14 20:20:41 -04:00
Joey Hess 5a4c95cc35 enable action bar on misctemplates
So RecentChanges shows on the action bar there,
convert recentchanges to use new pageactions hook,
with compatability code to avoid breaking old templates.
2010-05-14 20:04:02 -04:00
Joey Hess bc0aa4d40e Use xhtml friendly pubdate setting. 2010-05-08 19:45:02 -04:00
Joey Hess b01a2274c3 fix undef warning when page() tests a deleted file 2010-05-07 13:25:32 -04:00
Joey Hess 2e86b8df98 fix param passing to match_glob 2010-05-06 20:46:58 -04:00
Joey Hess 71b8d2ad41 move meat of type checking to match_page where it belongs 2010-05-06 19:04:56 -04:00
Joey Hess cb2025af45 refactor 2010-05-05 22:41:23 -04:00
Joey Hess ee9a4e06fc rename ispage variable 2010-05-05 22:36:50 -04:00
Joey Hess 1193759568 remove unused indexlink function and template variable 2010-05-05 20:42:56 -04:00
Joey Hess 83b907c35e remove misc.tmpl checking
Turns out that users with a modified page.tmpl need to modify it on
upgrade, at least to add the FORCEBASEURL (so edit preview works),
so there is no point in trying to retain compatability.
2010-05-05 18:46:35 -04:00
Joey Hess 5971a731e9 allow search form visibility to be controlled on the template
hide extrafooter from misctemplate display per default
2010-05-05 18:42:18 -04:00
Joey Hess 66cc23a591 no more misc.tmpl
* Removed misc.tmpl. Now to theme ikiwiki, you only need to customise
  a single template, page.tmpl.
* misc.tmpl will, however, still be read if a locally modified version
  exists. This is to avoid forcing users to update page.tmpl right now.
2010-05-05 18:22:47 -04:00
Joey Hess 970373548f Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. 2010-05-02 13:44:13 -04:00
Joey Hess 0ec1fe1944 set html5 option as advanced for now 2010-05-01 21:04:14 -04:00
Joey Hess a547d26858 html5 option
* Ikiwiki can be configured to generate html5 instead of the default xhtml
  1.0. The html5 output mode is experimental, not yet fully standards
  compliant, and will be subject to rapid change.
2010-05-01 20:49:18 -04:00
Joey Hess 6293c62cac no need to use HTML::Entities
That module is unused now. Long long ago, it used to be used to encode data in
the index. Checked all modules, and every module that uses it imports it.
2010-04-30 17:26:41 -04:00
Joey Hess a6e6f604bd TMPL_INCLUDE re-enabled for templates read from the templatedir. (But not in-wiki templates.) 2010-04-28 12:39:13 -04:00
Joey Hess 3ac2ae1f14 Add page() PageSpec, which is like glob() but matches only pages, not other files. 2010-04-26 18:47:17 -04:00
Joey Hess 97b0c6e455 Fix removal of rendered files in rebuild mode.
Needed to handle the move of the .js files into ikiwiki/, but also this is
a longstanding bug.

Old pagemtime is not remembered in rebuild mode, and changing that would
need a lot of changes. So instead, loop on pagectime, which is remembered.

Change to remembering old pagesources info in rebuild mode. This seems safe
enough.
2010-04-26 17:14:03 -04:00
Joey Hess ca9c17db57 reword templatedir description 2010-04-24 21:38:22 -04:00
Joey Hess ca9c6cc254 add support for mass dependencies
Registered by passing "" as page name to add_depends.
2010-04-24 20:22:20 -04:00
Joey Hess 0d8fc55d33 bugfix 2010-04-24 19:50:23 -04:00
Joey Hess c2656f08f3 template() - return params in list context
I forgot CGI::Formbuilder's horrible interface that needs template
parameters instead of a constructed object.
2010-04-24 16:15:47 -04:00
Joey Hess 7099978b72 bugfix 2010-04-24 16:00:18 -04:00
Joey Hess 96c9c8aa92 fix return of tpage 2010-04-23 16:20:02 -04:00