]> git.mjollnir.org Git - s9y.git/commitdiff
* New personal configuration item: "Forbid creating entries" to
authorgarvinhicking <garvinhicking>
Mon, 23 May 2005 12:00:41 +0000 (12:00 +0000)
committergarvinhicking <garvinhicking>
Mon, 23 May 2005 12:00:41 +0000 (12:00 +0000)
      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)

31 files changed:
docs/NEWS
include/admin/category.inc.php
include/admin/comments.inc.php
include/admin/entries.inc.php
include/admin/images.inc.php
include/admin/upgrader.inc.php
include/tpl/config_personal.inc.php
lang/serendipity_lang_bg.inc.php
lang/serendipity_lang_cn.inc.php
lang/serendipity_lang_cs.inc.php
lang/serendipity_lang_cz.inc.php
lang/serendipity_lang_da.inc.php
lang/serendipity_lang_de.inc.php
lang/serendipity_lang_en.inc.php
lang/serendipity_lang_es.inc.php
lang/serendipity_lang_fa.inc.php
lang/serendipity_lang_fi.inc.php
lang/serendipity_lang_fr.inc.php
lang/serendipity_lang_is.inc.php
lang/serendipity_lang_it.inc.php
lang/serendipity_lang_ja.inc.php
lang/serendipity_lang_ko.inc.php
lang/serendipity_lang_nl.inc.php
lang/serendipity_lang_no.inc.php
lang/serendipity_lang_pt.inc.php
lang/serendipity_lang_ro.inc.php
lang/serendipity_lang_ru.inc.php
lang/serendipity_lang_tn.inc.php
lang/serendipity_lang_tw.inc.php
lang/serendipity_lang_zh.inc.php
serendipity_admin.php

index dc38f0650c3bf8857ca5daee35398c8c8bf5330e..da6c33e0af78a8a0a23d5aa12664cda87fd35050 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,12 @@
 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
index 172ddfbe31a912a73eeb04c86c0f0b119e180090..5b926250cdb3264837dc7027820c1d1fd4bcfed9 100644 (file)
@@ -6,6 +6,10 @@ if (IN_serendipity !== true) {
     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 */
index d71545d9436ad4b5b75e2506e2ebeecc42e57b2d..32154a289a57e47e706202cb10dfa7da6d4b103d 100644 (file)
@@ -6,6 +6,10 @@ if (IN_serendipity !== true) {
     die ("Don't hack!");
 }
 
+if ($serendipity['no_create']) {
+    return;
+}
+
 $commentsPerPage = (!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
 $summaryLength = 200;
 
index 01b8f9081ac1713d4d259d3f33de049838fc22fb..bb98e4ea51551ef7935c87044af8848dd47ba9fc 100644 (file)
@@ -6,6 +6,10 @@ if (IN_serendipity !== true) {
     die ("Don't hack!");
 }
 
+if ($serendipity['no_create']) {
+    return;
+}
+
 $sort_order = array('timestamp'     => DATE,
                     'isdraft'       => PUBLISH . '/' . DRAFT,
                     'a.realname'    => AUTHOR,
index 36523cded01bde09b98edc680efc8fdaf38102b8..e22f6e83c667d96ea1c0d595c26aaf0ad295355f 100644 (file)
@@ -6,6 +6,10 @@ if (IN_serendipity !== true) {
     die ("Don't hack!");
 }
 
+if ($serendipity['no_create']) {
+    return;
+}
+
 switch ($serendipity['GET']['adminAction']) {
     case 'sync':
         set_time_limit(0);
index 76e2d4f5d75d46accfe142c7f3bc154aff48c2ba..406f44a6bb6bb9b3651010c799852a8409b0515b 100644 (file)
@@ -2,6 +2,10 @@
 # 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');
 
index 26f4f15a930b2fcdbcd24ba761c6756fa09389a2..fb59d708605732a707acd7d4f5c7ccaf31fcaefb 100644 (file)
                                           '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,
index e9e6af3db1f850601dc3f0b304d399ffdbb8fa5e..cd026b816f79eb3d5eb69c46bc528e7206cc60df 100644 (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 : */
 ?>
index afc1037157820e694c9f4384cce3f4b46905052d..078c6074af98254b3438d48711283551e263ae61 100644 (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 : */
 ?>
index 4590b8b3d884aa083257cd5791b49309bae6d0c2..9d118f505c3561398e73c76141e4b03709cbd95a 100644 (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
index 6231ad0a0acdd58fc0ff91fed1e1327d79114906..49b4e6f3737d86c52642171a52bec8030df1bce8 100644 (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
index 71b98e9758c8a52ce1acca3ed441999e84016369..c5e613dc2dcc42db628d2975c219fcf79000a6a2 100644 (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 : */
 ?>
index 83f8b8a9da755677670cca041adb9bcb48e433b2..825c0f4fd353adf0361715abd8f37bfbe48e3a4f 100644 (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 : */
 ?>
index cc46ad989e3c35f02bae0d549e2756264a545a18..c90aef574a7afd366970347aa0903c63e0c1d3c6 100644 (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 : */
 ?>
index 00cc76934d4c5d651eea8a4acabcfe8b05ce2e1e..eb703dd1512bc25b1cf222cf36f96ea75ffcb2f8 100644 (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
index 2bb4b6ff575d01bb55a70df5ca724e7986e0a6c9..e5478c270a1d24ad7d2971234e9e98db3bec9c9e 100644 (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 : */
 ?>
index 12a6c6e77242e7c114d7a61301c9b98d2b120327..43629c5e8451f1a166302a3b89cbc6ae9dcee086 100644 (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 : */
 ?>
index 098ba95dbb231364fa46cb2b6fe83fa3907e0983..258c5ef0fbbefaec26b467e7e428695c20df0f05 100644 (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
index 25c0adb4ea312b3ed7ba74c9edcdfe0cc2d2c570..fb3d4371f44166521e0df8387d59852281b59cc0 100644 (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 : */
 ?>
index 4737900da15e9626ff75ce8c0941814035f95855..b71b54508801b8db1fea3c122fe5e234e5e35f06 100644 (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 : */
 ?>
index 563b84ebd3031f2d2d4dcc670a6e28a1ca6083d6..830175005875ba57d018adb281e703e3e3a77d21 100644 (file)
@@ -691,6 +691,8 @@ Serendipity のアップグレードステージを無視しました。正し
 @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 : */
 ?>
index 2bd8a0bce8d17fe048811ce07ac92a4162fb72f6..9252390b7a07a091a7a50f2d36355ea0b7eb34c8 100644 (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 : */
 ?>
index 5cd4f57b6b76580784641441b818ec3b52e1e5e4..849f6b4876b0ccd56cd8f797348a587a59b5e67e 100644 (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 : */
 ?>
index d6d72cf4d62419b81876b2e14d44d13ed4dd104d..c92f593c629b3627fb6c5d2d28d2d50b1d88dbf0 100644 (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');
 
 ?>
index 8e7dfa747b7616a6d4be7d4e61122cb995e4f02f..3d35ca5fd654d681e3c165320f0e11890a5c2324 100644 (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 : */
 ?>
index 80a3f13b76b84f099920acf1a3212f78b33813c0..85273a1215cbeaf999197cb7bdcce3d8b5408344 100644 (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 : */
 ?>
index 27da55b576aa06de6f8703277beacbe15b475f18..4dd99c902e2ea94f92162964b184a78cf0c8a72d 100644 (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 : */
 ?>
index cdb97629ed34703522cb5e61373929127ee1ff12..1b819a328713ddf3e8635d4f778598406d88bcf9 100644 (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 : */
 ?>
index da5921202a48ab9abccd02e2d7aff5c5a7507f9e..4276827520f3f0d5449c4ba08cb05eafd857036e 100644 (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 : */
 ?>
index 3b95c73c1d0bcc9390462056a878cdd3126b45f6..57718995357e06054f30ddb0009bd5d56e44700c 100644 (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 : */
 ?>
index 6ed3f47dba4bf0c449e0444f9da1884708303a24..bd2e6c0602102f624ca4ec8e5ce9f88460637f96 100644 (file)
@@ -135,6 +135,7 @@ if (!isset($serendipity['serendipityPath']) || IS_installed === false || IS_up2d
                         <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&amp;serendipity[adminAction]=new"><?php echo NEW_ENTRY; ?></a></li>
@@ -143,7 +144,8 @@ if (!isset($serendipity['serendipityPath']) || IS_installed === false || IS_up2d
                         <li><a href="serendipity_admin.php?serendipity[adminModule]=category&amp;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&amp;serendipity[adminAction]=addSelect"><?php echo ADD_MEDIA; ?></a></li>
@@ -154,7 +156,7 @@ if (!isset($serendipity['serendipityPath']) || IS_installed === false || IS_up2d
                         <li><a href="serendipity_admin.php?serendipity[adminModule]=media&amp;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>
@@ -171,8 +173,10 @@ if (!isset($serendipity['serendipityPath']) || IS_installed === false || IS_up2d
                         <?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 />