Download & Extend

Adding settings for URL prefix and random URI part

Project:URL Access
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

While using this module I wanted to (1) replace the default URL prefix protected by a free configurable string and (2) use a shorter random URI part because the UUID with 37 characters is too long for sending to customers etc.

May be my patch is useful for the public so I attached it here. It enhances url_access by the following features:

  • Choose how to generate the random part of the URI: using the UUID() function of MySQL or the user_password() function of Drupal.
  • Because the UUID() function is available from MySQL 4.1.2 on only the user_password() function will be used as a fallback if UUID() is not available.
  • The URL path prefix for protected nodes which is by default protected is configurable.
  • You may enter an additional message for the 403 page which unauthorized users will see when viewing the node without using the protected URL.
AttachmentSize
settings.patch5.1 KB

Comments

#1

Status:active» needs review

#2

Thanks for the patch. A few comments:

  • Generating the UUID in 'insert' in the nodeapi hook would be clearer if it simply called the _url_access_uuid() function. It could then handle checking the variable to see what is appropriate.
  • Actually, couldn't the UUID() function be tested during generation of the admin form, and then disable the option if the function isn't available?
  • What happens if you change the URL prefix when existing pages? As far as I can tell from the code (I haven't run it yet) you would have to manually submit every node to update the path alias table.

--Andrew

#3

Status:needs review» needs work

#4

it also looks like there's some white space issues with tabs being used rather than spaces.

#5

Status:needs work» closed (won't fix)

I'm marking as closed to clean up my queue as I'm not maintaining this module any more. Feel free to take over this project if you're still using it.

nobody click here