Version 0.9 ()
------------------------------------------------------------------------
+ * New personal configuration item: "Forbid creating entries" to
+ allow authors to be logged in, but not create any entries. Meant
+ to be used in conjunction with serendipity_plugin_adduser for
+ user self-registration where you want to allow posting comments
+ to registered users only. (garvinhicking)
+
* Added Custom Permalink URL days, months, years, etc. to the
Serendipity Configuration ("Paths") panel.
If you use the external plugin serendipity_plugin_authors or
die ("Don't hack!");
}
+if ($serendipity['no_create']) {
+ return;
+}
+
$admin_category = ($serendipity['serendipityUserlevel'] < USERLEVEL_CHIEF ? "AND (authorid = 0 OR authorid = " . (int)$serendipity['authorid'] . ")" : '');
/* Add a new category */
die ("Don't hack!");
}
+if ($serendipity['no_create']) {
+ return;
+}
+
$commentsPerPage = (!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
$summaryLength = 200;
die ("Don't hack!");
}
+if ($serendipity['no_create']) {
+ return;
+}
+
$sort_order = array('timestamp' => DATE,
'isdraft' => PUBLISH . '/' . DRAFT,
'a.realname' => AUTHOR,
die ("Don't hack!");
}
+if ($serendipity['no_create']) {
+ return;
+}
+
switch ($serendipity['GET']['adminAction']) {
case 'sync':
set_time_limit(0);
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (IN_serendipity !== true) {
+ die ('Don\'t hack!');
+}
+
require_once(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php');
require_once(S9Y_INCLUDE_PATH . 'include/functions_upgrader.inc.php');
'default' => true,
'userlevel' => USERLEVEL_EDITOR),
+ array('var' => 'no_create',
+ 'title' => USERCONF_CREATE,
+ 'description' => USERCONF_CREATE_DESC,
+ 'type' => 'bool',
+ 'default' => false,
+ 'userlevel' => USERLEVEL_CHIEF,
+ 'flags' => array('config')),
+
array('var' => 'right_publish',
'title' => USERCONF_ALLOWPUBLISH,
'description' => USERCONF_ALLOWPUBLISH_DESC,
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
\ No newline at end of file
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
\ No newline at end of file
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
\ No newline at end of file
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
\ No newline at end of file
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
-/* vim: set sts=4 ts=4 expandtab : */
?>
@define('INSTALL_PERMALINK_PLUGINPATH', 'Path to single plugin');
@define('INSTALL_PERMALINK_ADMINPATH', 'Path to admin');
@define('INSTALL_PERMALINK_SEARCHPATH', 'Path to search');
+@define('USERCONF_CREATE', 'Forbid creating entries?');
+@define('USERCONF_CREATE_DESC', 'If selected, the user may not create new entries');
/* vim: set sts=4 ts=4 expandtab : */
?>
<li><a href="serendipity_admin.php?serendipity[adminModule]=personal"><?php echo PERSONAL_SETTINGS; ?></a></li>
</ul>
<br />
+<?php if (!$serendipity['no_create']) { ?>
<ul class="serendipitySideBarMenu">
<li class="serendipitySideBarMenuHead"><?php echo ADMIN_ENTRIES ?></li>
<li><a href="serendipity_admin.php?serendipity[adminModule]=entries&serendipity[adminAction]=new"><?php echo NEW_ENTRY; ?></a></li>
<li><a href="serendipity_admin.php?serendipity[adminModule]=category&serendipity[adminAction]=view"><?php echo CATEGORIES; ?></a></li>
<?php serendipity_plugin_api::hook_event('backend_sidebar_entries', $serendipity); ?>
</ul>
-
+<?php } ?>
+<?php if (!$serendipity['no_create']) { ?>
<ul class="serendipitySideBarMenu">
<li class="serendipitySideBarMenuHead"><?php echo MEDIA; ?></li>
<li><a href="serendipity_admin.php?serendipity[adminModule]=media&serendipity[adminAction]=addSelect"><?php echo ADD_MEDIA; ?></a></li>
<li><a href="serendipity_admin.php?serendipity[adminModule]=media&serendipity[adminAction]=sync" onclick="return confirm('<?php echo WARNING_THIS_BLAHBLAH; ?>');"><?php echo CREATE_THUMBS; ?></a></li>
<?php serendipity_plugin_api::hook_event('backend_sidebar_entries_images', $serendipity); ?>
</ul>
-
+<?php } ?>
<?php if ($serendipity['serendipityUserlevel'] >= USERLEVEL_CHIEF) { ?>
<ul class="serendipitySideBarMenu">
<li class="serendipitySideBarMenuHead"><?php echo APPEARANCE; ?></li>
<?php if ($serendipity['serendipityUserlevel'] >= USERLEVEL_CHIEF) { ?>
<li><a href="serendipity_admin.php?serendipity[adminModule]=users"><?php echo MANAGE_USERS; ?></a></li>
<?php } ?>
+ <?php if (!$serendipity['no_create']) { ?>
<li><a href="serendipity_admin.php?serendipity[adminModule]=import"><?php echo IMPORT_ENTRIES; ?></a></li>
<li><a href="serendipity_admin.php?serendipity[adminModule]=export"><?php echo EXPORT_ENTRIES; ?></a></li>
+ <?php } ?>
<?php serendipity_plugin_api::hook_event('backend_sidebar_admin', $serendipity); ?>
</ul>
<br />