[geeklog-cvs] geeklog: Added Links Category default permissions
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Feb 21 09:53:23 EST 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/06568a815aa0
changeset: 6787:06568a815aa0
user: Dirk Haun <dirk at haun-online.de>
date: Sat Feb 21 14:04:25 2009 +0100
description:
Added Links Category default permissions
diffstat:
6 files changed, 34 insertions(+), 11 deletions(-)
plugins/links/functions.inc | 7 +++++++
plugins/links/install_defaults.php | 15 +++++++++++++++
plugins/links/language/english.php | 7 ++++---
plugins/links/language/english_utf-8.php | 7 ++++---
public_html/admin/plugins/links/category.php | 8 +++-----
public_html/docs/history | 1 +
diffs (159 lines):
diff -r 000c9fe7852b -r 06568a815aa0 plugins/links/functions.inc
--- a/plugins/links/functions.inc Sat Feb 21 12:41:05 2009 +0100
+++ b/plugins/links/functions.inc Sat Feb 21 14:04:25 2009 +0100
@@ -647,6 +647,13 @@
if (! isset($_LI_CONF['new_window'])) {
$c = config::get_instance();
$c->add('new_window',false,'select',0,0,1,55,TRUE,'links');
+ }
+
+ if (! isset($_LI_CONF['category_permissions'])) {
+ $c = config::get_instance();
+ $c->add('fs_cpermissions', NULL, 'fieldset', 0, 3, NULL, 0, true, 'links');
+ $c->add('category_permissions', array (3, 2, 2, 2),
+ '@select', 0, 3, 12, 150, true, 'links');
}
DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'links'");
diff -r 000c9fe7852b -r 06568a815aa0 plugins/links/install_defaults.php
--- a/plugins/links/install_defaults.php Sat Feb 21 12:41:05 2009 +0100
+++ b/plugins/links/install_defaults.php Sat Feb 21 14:04:25 2009 +0100
@@ -155,6 +155,17 @@
*/
$_LI_DEFAULT['default_permissions'] = array (3, 2, 2, 2);
+/**
+ * Define default permissions for new link categories.
+ * Permissions are perm_owner, perm_group, perm_members, perm_anon (in that
+ * order). Possible values:<br>
+ * - 3 = read + write permissions (perm_owner and perm_group only)
+ * - 2 = read-only
+ * - 0 = neither read nor write permissions
+ * (a value of 1, ie. write-only, does not make sense and is not allowed)
+ */
+$_LI_DEFAULT['category_permissions'] = array (3, 2, 2, 2);
+
/**
* Initialize Links plugin configuration
@@ -213,6 +224,10 @@
$c->add('default_permissions', $_LI_DEFAULT['default_permissions'],
'@select', 0, 2, 12, 140, true, 'links');
+ $c->add('fs_cpermissions', NULL, 'fieldset', 0, 3, NULL, 0, true, 'links');
+ $c->add('category_permissions', $_LI_DEFAULT['category_permissions'],
+ '@select', 0, 3, 12, 150, true, 'links');
+
}
return true;
diff -r 000c9fe7852b -r 06568a815aa0 plugins/links/language/english.php
--- a/plugins/links/language/english.php Sat Feb 21 12:41:05 2009 +0100
+++ b/plugins/links/language/english.php Sat Feb 21 14:04:25 2009 +0100
@@ -25,7 +25,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
###############################################################################
-# $Id: english.php,v 1.33 2008/09/22 07:53:40 dhaun Exp $
/**
* This is the english language page for the Geeklog links Plug-in!
@@ -276,7 +275,8 @@
'show_category_descriptions' => 'Show Category Description?',
'new_window' => 'Open external links in new window?',
'root' => 'ID of Root Category',
- 'default_permissions' => 'Link Default Permissions'
+ 'default_permissions' => 'Link Default Permissions',
+ 'category_permissions' => 'Category Default Permissions'
);
$LANG_configsubgroups['links'] = array(
@@ -286,7 +286,8 @@
$LANG_fs['links'] = array(
'fs_public' => 'Public Links List Settings',
'fs_admin' => 'Links Admin Settings',
- 'fs_permissions' => 'Default Permissions'
+ 'fs_permissions' => 'Link Permissions',
+ 'fs_cpermissions' => 'Category Permissions'
);
// Note: entries 0, 1, and 12 are the same as in $LANG_configselects['Core']
diff -r 000c9fe7852b -r 06568a815aa0 plugins/links/language/english_utf-8.php
--- a/plugins/links/language/english_utf-8.php Sat Feb 21 12:41:05 2009 +0100
+++ b/plugins/links/language/english_utf-8.php Sat Feb 21 14:04:25 2009 +0100
@@ -25,7 +25,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
###############################################################################
-# $Id: english_utf-8.php,v 1.20 2008/09/22 07:53:40 dhaun Exp $
/**
* This is the english language page for the Geeklog links Plug-in!
@@ -276,7 +275,8 @@
'show_category_descriptions' => 'Show Category Description?',
'new_window' => 'Open external links in new window?',
'root' => 'ID of Root Category',
- 'default_permissions' => 'Link Default Permissions'
+ 'default_permissions' => 'Link Default Permissions',
+ 'category_permissions' => 'Category Default Permissions'
);
$LANG_configsubgroups['links'] = array(
@@ -286,7 +286,8 @@
$LANG_fs['links'] = array(
'fs_public' => 'Public Links List Settings',
'fs_admin' => 'Links Admin Settings',
- 'fs_permissions' => 'Default Permissions'
+ 'fs_permissions' => 'Link Permissions',
+ 'fs_cpermissions' => 'Category Permissions'
);
// Note: entries 0, 1, and 12 are the same as in $LANG_configselects['Core']
diff -r 000c9fe7852b -r 06568a815aa0 public_html/admin/plugins/links/category.php
--- a/public_html/admin/plugins/links/category.php Sat Feb 21 12:41:05 2009 +0100
+++ b/public_html/admin/plugins/links/category.php Sat Feb 21 14:04:25 2009 +0100
@@ -2,13 +2,13 @@
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
-// | Links Plugin 2.0 |
+// | Links Plugin 2.1 |
// +---------------------------------------------------------------------------+
// | category.php |
// | |
// | Geeklog links category administration page. |
// +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2008 by the following authors: |
+// | Copyright (C) 2000-2009 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony AT tonybibbs DOT com |
// | Mark Limburg - mlimburg AT users.sourceforge DOT net |
@@ -32,8 +32,6 @@
// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
// | |
// +---------------------------------------------------------------------------+
-//
-// $Id: category.php,v 1.19 2008/06/22 08:55:01 dhaun Exp $
require_once '../../../lib-common.php';
require_once '../../auth.inc.php';
@@ -179,7 +177,7 @@
// nothing, so making a new top-level category
// get default access rights
$A['group_id'] = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name='Links Admin'");
- SEC_setDefaultPermissions($A, $_LI_CONF['default_permissions']);
+ SEC_setDefaultPermissions($A, $_LI_CONF['category_permissions']);
$A['owner_id'] = $_USER['uid'];
$A['pid'] = $_LI_CONF['root'];
}
diff -r 000c9fe7852b -r 06568a815aa0 public_html/docs/history
--- a/public_html/docs/history Sat Feb 21 12:41:05 2009 +0100
+++ b/public_html/docs/history Sat Feb 21 14:04:25 2009 +0100
@@ -52,6 +52,7 @@
Links plugin
------------
+- Added category default permissions [Dirk]
- Added auto installation support [Dirk]
- Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk]
- Introduced function LINKS_getCategorySQL and fixed visibility of link
More information about the geeklog-cvs
mailing list