Maybe allow user to enter directories separated by a comma, or multiple text input fields?

This module is what I have been looking for! Thanks!

 * Administration form
 */
function contentprotector_admin_form() {
  $form = array();
  
  $form['contentprotector_directory'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Directory to protect'),
    '#description'   => t('The path of the directory to protect, relative to the root of your Drupal installation.'),
    '#default_value' => variable_get('contentprotector_directory', ''),
  );
  
  $form['contentprotector_submit'] = array(
    '#type'          => 'submit',
    '#value'         => t('Save'),
  );

  return $form;
}

Comments

aidanlis’s picture

Hi,

At the moment it only supports a single directory.

What I plan to do is change the module to allow different permissions, roles or users to be assigned to different directories.

For the moment, to protect multiple directories you'll have to create a duplicate of the module and rename it to contentprotector2.

Cheers,

vacilando’s picture

Subscribing

aidanlis’s picture

Title: Can i use this module to protect more than one directory? » Protect more than one directory
aidanlis’s picture

Status: Active » Postponed

I don't have time to implement this at the moment. The way I'd want it to work is a set of rules:

this directory ____ needs these rules ____ to view the files.