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.
CommentFileSizeAuthor
settings.patch5.1 KBfuerst

Comments

fuerst’s picture

Status: Active » Needs review
deviantintegral’s picture

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

deviantintegral’s picture

Status: Needs review » Needs work
drewish’s picture

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

deviantintegral’s picture

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.