Hi,

I'm just wondering if this module will get ported to Drupal 7. Please let me know, thank you.

Comments

raveman’s picture

subscribing

damienmckenna’s picture

Subscribing.

Marc Bijl’s picture

Subscribing

Anonymous’s picture

Subscribing

billspreston’s picture

StatusFileSize
new16.83 KB

Hello,

This is a patch for the current master (6.x-1.5) to get it working with D7. It seems fine to me, but it's my first Drupal patch so it probably has any number of things wrong with it. Feedback appreciated, but please be gentle!

billspreston’s picture

StatusFileSize
new16.16 KB

Hello,

Version 2 - I managed to remove something useful with the last one, oops.

dartdev’s picture

Still has some database related issues, almost works.
Also you changed only one "protected_node_perm" to "protected_node_permission", second left as "_perm", check it.

AlexisWilke’s picture

Title: Port for Drupal 7? » Port for Drupal 7? Co-maintainer wanted.

Note that there were many problems since in v6.x which I'm fixing now. This being said, I don't work on D7 at all these days... If you want to become the D7 maintainer, let us know.

Thank you.
Alexis

AlexisWilke’s picture

Okay, now the 6.x-1.x version is up to snuff to be converted to D7. So whoever can create a new D7 package starting from here, it will work bloodly better.

Thank you.
Alexis Wilke

verynic’s picture

+1

ajaysolutions’s picture

Subscribing

enkore’s picture

Subscribing

webankit’s picture

+1

nasi’s picture

+1

pjabode’s picture

+1

rolandk’s picture

+1

Branjawn’s picture

Pleeeeeeeeeeeeeeeeeease. Someone do this. I can't, not smart enough :)

jaxpax’s picture

I would also like this, MULTO

barry_fisher’s picture

Hi Bill,

Thanks for this patch. It's based on version 1.5 of this module which has since been updated to 1.6. I've tried rolling your patch against 1.5 although it doesn't apply. It may have something to do with the CVS tags/git migration.

Anyway- would you be able to post a zipped version of the D7 module files here so I can download it as a starting point for creating a proper D7 branch. If I can get your code as a base then I can offer back any amendments and put it up as a sandbox- or even a dev release on the module's repo- subject to speaking to the maintainer.

I'm happy to put in the work if you'd be kind enough to post your tarball here as a good starting point.

Thanks,

Barry

zilverdistel’s picture

For now: subscribing.

billspreston’s picture

StatusFileSize
new14.19 KB

Hello reallifedesign (and others),

Here's a tarball of the module, such as it is. I noticed the move to D6 v.1.6 and incorporated at least one change, but my work hasn't been particularly thorough.

By and large it works fine, but one major problem is that it ballses up webform submission. Can't work out why. If your webform redirects to another node on submission, that's fine, but if you just have a submission message, it claims that the form's protected and asks for a password. Very strange.

Anyhow, thanks for offering to take this on!

AlexisWilke’s picture

v1.5 had quite many quirks...

I'd push your patch if it were based on v1.6 but I'm not too sure it's a good idea for a new 7.x version to start with 1.5!

Thank you.
Alexis Wilke

nirbhasa’s picture

Version: 6.x-1.5 » 6.x-1.6
Status: Active » Needs review

I ran 1.6 through coder upgrade, and then did quite a bit of munching through bugs (mainly converting to new db api). It works for my use case, which was for a global password. Haven't really tested it for other use cases, and also haven't looked at features like mail. Also didn't touch views or rules integration.

Its in my sandbox here:

http://drupalcode.org/sandbox/nirbhasa/1297466.git/snapshot/1b10df7.tar.gz (youll need to change the folder name back to protected_node)

I added an extra session variable so that if 'Global password only' is selected, and the user enters the password to view one node, he no longer needs to enter it to view the other nodes protected with that password.

I may have need to work on it a bit more, but its fair to say I wont be able to take this all the way home. But what Ive done is probably a good basis to continue on. Also I didnt convert all of the db queries yet - I daresay you could profitably use some of the work done in the 1.5 ports above.

jaxpax’s picture

Hi!
Great to finally see some action regarding the D7 port. I would really like for this to reach a stable release. Here is the outcome of my test installation and some of the most eye-catching errors so far.

1. I installed the module and a couple of errors where raised right away:

Notice: Use of undefined constant FILE_DOWNLOADS_PUBLIC - assumed 'FILE_DOWNLOADS_PUBLIC' in protected_node_requirements() (line 64 of /Applications/MAMP/htdocs/local_environment/sites/all/modules/protected_node/protected_node.install).
Notice: Use of undefined constant FILE_DOWNLOADS_PRIVATE - assumed 'FILE_DOWNLOADS_PRIVATE' in protected_node_requirements() (line 65 of /Applications/MAMP/htdocs/local_environment/sites/all/modules/protected_node/protected_node.install).

2. The link/menu item for the module configuration page were nowhere to be found, but figured that admin/config/protected_node would be the correct url, so I finally found the configuration page. I guess that maybe some of the explanatory texts could use one hour or two, when it comes to describing some of the settings. But this is, of course, my personal reflection/opinion.

3. I couldn't find any specific settings for each separate content type. The module wouldn't let me decide which of my content types I would like to include the node protection functionality. I guess that in addition to the admin/config/protected_node settings page some specific settings, for each of the content types, is supposed to be located somewhere under admin/structure/types/manage/[content-type]??

My environment, a local mamp environment. isn't capable of using any of the email sending functionality shipped with this module, so nothing for me to report from within that area of functionality.

Thanks, for the initiative and all of your work put in to this port, so far.

nirbhasa’s picture

Thanks @jaxpax! A couple of thoughts in response.

  • Interesting re the missing menu item - I had admin_menu item installed and it showed up there straight away. Perhaps it needs to be filed under one of the existing configuration categories (any ideas anyone?) - this is probably a good idea of overall organisational purposes anyway.
  • I too found the wording of the settings a little confusing, and there might possibly be a duplicate permission there too. But for now i was just focused on the port. Id be interested in hearing what Alexis (the maintainer) has to say though.
  • Didn't go near per-content-type settings at all :)

If anyone wants to jump in and start improving things, im happy to give commit access to the sandbox. Then when its in some kind of shape we can present it for release.

This week is 100% out in terms of doing anything more, but id like to help next week.

AlexisWilke’s picture

Hi nirbhasa,

Note that I won't be maintaining the D7 version... 8-)

For permissions, I had a rather hard time to decipher what the intend of the previous author was...

However, my work is documented here:

http://www.m2osw.com/doc-protected-node-permissions

so you should clearly understand what's for what... There is a little bit of overlap, but all permissions are useful. It very much depends on your circumstances.

Thank you.
Alexis Wilke

nirbhasa’s picture

Thanks Alexis, those docs are unbelievably helpful, and now I understand that all the permissions do have distinct value.

@jaxpax - i just realised that access per content type is set through permissions and not through settings. Still probably doesnt work yet though :)

Am thinking about offering to comaintain to push the initial port through and apply bugfix patches until a proper comaintainer can be found. However I dont want to commit to something I cant see through. Ill be in a better position to decide next week.

vegardjo’s picture

sub

nirbhasa’s picture

Unfortunately other projects have taken over completely, and so I wont have time to offer to comaintain this. Apologies, and hopefully someone can use the work done so far and bring it home.

markwk’s picture

@nirbhasa: I'm just starting to go through this module and it's a fair bit code. Can you list any lingering issues?

aaronott’s picture

StatusFileSize
new79.76 KB

@markwk: not sure how far you've gotten into this. I figured I'd take nirbhasa's changes and roll them into a patch that can be applied directly to the d6 version of this module. This way we can keep track of exactly what has been changed and what still needs changes. Of course I could be way off on this one. I understand that there are other bugs that have been reported on these changes, but figured it'd be a good starting point.

nirbhasa’s picture

Apologies @markwk - i never got notified of this somehow

Basically I just tested it for my use case (global password) and it seems to work fine for that. Heres a brief runthrough:

- in hook_menu the protected node menu paths should be filed under one of the configuration subcategories (Administration perhaps?)
- There definitely is unported database code in there which still needs to be changed to use D7 api. If you do a search for 'database api' you can see the places where the coder module flagged warnings.
- in the .install file the protected_node_requirements function is flagging an error, much of that code can be binned in favour of a per-field check as D7 handles public and private files completely differently now
- I didnt go near the mail or fork includes, save for running them through coder. Hope that helps!

Anonymous’s picture

i'm planning to go online at the beginning of 2012 and i really need exactly this module for drupal 7. is anyone able to say when there could be a working release or a patch? unfortunatly i'm to noob to help writing codes...

best regards

konsul

aaronott’s picture

konsul What are you going to be using it for? Are you password protecting at the node level? I've got this running on a D7 site password protecting at the node level using what's already been done in this thread. I rolled the changes so far (including a couple of my own) into the patch in #32

Anonymous’s picture

the aim is to provide absolutely anonymity and security to all of my users. they should post very private stuff and right now i'm able to see all posts from each user in the admin conent menu. i have access to them, but i want to let users protect their nodes, even from me as the admin. i want to restrict myself...

my first thought about total privacy and securizty was to build userfolders via token and set a password for them, but i can't realize that with the available modules, or i didn't find one right now.

so setting one password for all nodes and entering it one time per session is a good base for me. if your patch provides that i will test it, but i'm a fan of official releases anyway.

thanks for the quick response

best regards

konsul

aaronott’s picture

konsul

I too am a fan of official releases though there is quite a bit of code to be converted in this module and only a limited number of hours. I've only had the time to skim through the code, create a couple quick fixes and roll the patch above. Others here have done much more but it appears that they too have gotten pretty busy with other things.

I'm not sure what kind of progress has been made on the views or rules portions but I can say that I am currently using the node portion which allows for a user set a password on each node they create, there isn't currently a way to, as a user, protect all your own nodes with one password (this must be done individually). As for blocking the administrator user out, there is a built in 'Panic' button that will allow the administrator to reset everything, so blocking the admin out isn't a possibility at this point.

AlexisWilke’s picture

konsul,

Note that this won't really work. The data is available unencrypted in your database... If only the password let you see the data, then it would need to be encrypted.

Also, the access system in Drupal is not that prohibitive to the admin (although in D7, that may have changed...)

Thank you.
Alexis Wilke

Anonymous’s picture

i thought so that it is nearly impossible to block myself. it seems that everyone must live with the possibility, that each admin from any website is able to see everything...right now. maybe there is a module to fix this bug in future :)

thanks guys

regards

konsul

pjabode’s picture

I tried the patch and was able to install (7.9), but after configuring the module under Configuration, no options appeared when I created a new page to password protect that page.

tried the original module supplied by nirbhasa; with it the field do show up as a content field. If the correct password is used it works, but if no password or an incorrect password is entered, then there is a block of error messages, so not quite there. When I replaced the narbhasa module with the patched version, the password field does not appear in the editing or creating content.

Marat’s picture

Subscribing, I am waiting for this module to upgrade my website!

j_ten_man’s picture

StatusFileSize
new72.89 KB

I couldn't get #32 to apply. I rerolled the patch against the latest release (6.x-1.7).

sw3b’s picture

Is it possible to have a DEV version so community could a least start working on a version ?!?

zilverdistel’s picture

Status: Needs review » Needs work

I tested the patch in #42.

the configuration settings page works fine (I couldn't test the "PROTECTED NODE STATISTICS" part though)
the configuration form on node/?/edit works

If I go to a protected node page, I get an "Access denied" page. No form to enter a password ...

And .. yes please, can we have a 7.x brach to work on? Drupal 7 is out one year now, it's about time for contrib modules to catch up!

-- EDIT
After setting the permission "access protected content", the password screen pops up, so basically, the patch seems to work.

AlexisWilke’s picture

Hi guys,

So far no one said they would maintain this module for Drupal 7.x. Once someone says he/she will, then you probably will quickly get a 7.x-1.x-dev version.

Thank you.
Alexis Wilke

zilverdistel’s picture

Status: Needs work » Needs review

I could probably co-maintain the drupal 7 version. Basically the port is working now.

Did some more testing:

  • views (with teasers): ok (title shown, the content is not)
  • views (with fields): the body of protected nodes is shown, not sure if that is ok
  • search results: ok (title shown, the content is not)
  • global password: ok

We could probably implement a views filter handler that hides protected nodes.

AlexisWilke’s picture

zilverdistel,

Okay, I made you a maintainer.

Feel free to check in your existing version and create a 7.x-1.x-dev. Wait for a little while to see whether you get issues, then create a 1.0.

Note that the current 6.x version of views implements a field that shows whether a node is protected. The same could be offered in a filter.

Thank you.
Alexis Wilke

zilverdistel’s picture

All right. I created a 7.x-1.x branch, a dev release should be available tomorrow.

zilverdistel’s picture

Title: Port for Drupal 7? Co-maintainer wanted. » Port for Drupal 7
amariotti’s picture

This module is perfect for a project that I'm working on. Looking forward to the 7.x-1.0 release. I can provide testing feedback.

zilverdistel’s picture

Version: 6.x-1.6 » 7.x-1.x-dev
Category: support » task
AlexisWilke’s picture

Maybe we could close this issue? And have users who find a problem create new issues?

Thank you.
Alexis

zilverdistel’s picture

Status: Needs review » Closed (fixed)