Project:Title Permissions
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:spiderman
Status:needs work
Issue tags:port to D6

Issue Summary

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

Comments

#1

Assigned to:Anonymous» spiderman

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:

<?php
--- 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));
?>
AttachmentSize
title_perms.d6.patch 22.97 KB

#2

#3

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

#4

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

#5

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.

#6

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 :)