ported this module to D6, cleaned up the coding style (trailing spaces mostly) while I was at it

u can find it at http://www.seutje.be/mine/title_perms-6.x-1.x-dev.tar.gz

I'll try and make a patch to head, but something tells me this module is abandoned

CommentFileSizeAuthor
#7 title_perms.zip7.83 KBpverrier
#1 title_perms.d6.patch22.97 KBspiderman

Comments

spiderman’s picture

Assigned: Unassigned » spiderman
Issue tags: +D6 patch port
StatusFileSize
new22.97 KB

Found a use for this module, and decided to roll a patch against the DRUPAL-5 release, even though (as noted above) it appears to be abandoned.

It should be noted that the title editing restrictions fails if you are using the content_profile module, but a small tweak to the logic in the hook_form_alter fixes this nicely:

--- title_perms.module  (revision 396)
+++ title_perms.module  (working copy)
@@ -35,6 +35,8 @@
   //we want to make sure we are editing not adding a node
   if (arg(0) == 'node' && is_numeric(arg(1))) {
     $nodeid = arg(1);
+  } else if (arg(0) == 'user' && arg(3) == 'profile') {
+    $nodeid = arg(1);
   }
   if ($perms != NULL && substr_count($form_id, '_node_form') > 0 && $nodeid != NULL) {
     $key = trim(str_replace('_node_form', "", $form_id));
spiderman’s picture

Issue tags: -D6 patch port +port to D6
not_Dries_Buytaert’s picture

This topic is also being discussed and a workaround proposed here: http://drupal.org/node/264767#comment-2359690

seutje’s picture

some1 pointed out to me that there are a few security issues in the port I posted (although I think they were already in the D5 version)

I'll try fix them and post a new version when I can

reinis.berzins’s picture

I installed your file: http://www.seutje.be/mine/title_perms-6.x-1.x-dev.tar.gz, but from the main site administration page (admin/by-module) there is only one link to the "Permissions page" (admin/user/permissions#module-title_perms) where you can't find any title editing permissions at all, because you haven't yet enabled them on the missing link page: admin/settings/title_perms.

joachim’s picture

Status: Active » Needs work

Quite a few problems in the D5 version that should be addressed for the D6 port:

+++ title_perms.module	(.../6.x/modules/title_perms)	(working copy)
@@ -1,122 +1,121 @@
+define("EDT_TYPES", 'types');
+define("EDT_PERMS", 'perms');
...
+  $types = variable_get(EDT_TYPES, NULL);

These variable names aren't namespace-safe.

+++ title_perms.module	(.../6.x/modules/title_perms)	(working copy)
@@ -1,122 +1,121 @@
+  $perms = variable_get(EDT_PERMS, NULL);

I don't even know what this variable is for!

+++ title_perms.module	(.../6.x/modules/title_perms)	(working copy)
@@ -1,122 +1,121 @@
+  //we want to make sure we are editing not adding a node
+  if (arg(0) == 'node' && is_numeric(arg(1))) {

On D6 we can check the form for presence of the node which is much cleaner than digging in arg().

I've requested to take over this module so I can get a D6 version finished :)

pverrier’s picture

Assigned: spiderman » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.83 KB

I had the same need for Drupal 6. I started with seutje version (thanks!) and made some changes.
Here's the result. Hope it helps someone with the same needs.