[geeklog-hg] geeklog: Staticpage can now use another staticpage as a template...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Apr 27 14:27:22 EDT 2013
changeset 9055:8a1404599dcd
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/8a1404599dcd
user: Tom <websitemaster at cogeco.net>
date: Sat Apr 27 14:26:43 2013 -0400
description:
Staticpage can now use another staticpage as a template but a staticpage template cannot be viewed by itself unless the user has edit permissions. This is a fix for bug #0001468 (Changeset 9bf970e89f0b)
diffstat:
plugins/staticpages/services.inc.php | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r f8238762d987 -r 8a1404599dcd plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php Sat Apr 20 17:52:14 2013 +0200
+++ b/plugins/staticpages/services.inc.php Sat Apr 27 14:26:43 2013 -0400
@@ -656,7 +656,13 @@
if (! empty($perms)) {
$perms .= ' AND';
}
- $perms .= '(draft_flag = 0) AND (template_flag = 0)';
+ if (isset($args['template'])) {
+ // Allow the viewing of a template since it is being retrieved by another staticpage
+ $perms .= '(draft_flag = 0)';
+ } else {
+ // Usually normal user cannot view staticpage that is a draft or template
+ $perms .= '(draft_flag = 0) AND (template_flag = 0)';
+ }
}
if (! empty($perms)) {
$perms = ' AND ' . $perms;
@@ -738,6 +744,7 @@
$args = array(
'sp_id' => $output['template_id'],
'mode' => $mode,
+ 'template' => true, // tells service that it is okay to retrieve a template staticpage since requested by another staticpage
'gl_svc' => ''
);
$svc_msg = array();
More information about the geeklog-cvs
mailing list