--- securepages/securepages.admin.inc 2009-03-29 05:49:12.000000000 -0500 +++ securepages/securepages.admin.inc 2009-10-08 13:55:27.000000000 -0500 @@ -61,7 +61,25 @@ '#rows' => 5, '#description' => t("The pages listed here will be ignored and be either returned in http or https. Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are 'blog' for the blog page and 'blog/*' for every personal blog. '<front>' is the front page."), ); + + $secure_all_roles = variable_get('securepages_secure_all_roles', array()); + $roles = user_roles(); + if (is_array($roles)) { + foreach($roles as $id => $role) { + $role_options[$role] = $role; + } + } + + $form['securepages_secure_all_roles'] = array( + '#type' => 'checkboxes', + '#title' => t('Secure all pages roles'), + '#description' => t("Selected roles will have every page secured, regardless of page specific settings above."), + '#multiple' => TRUE, + '#options' => $role_options, + '#default_value' => $secure_all_roles, + ); + return system_settings_form($form); } - \ No newline at end of file + --- securepages/securepages.module 2009-05-03 18:00:18.000000000 -0500 +++ securepages/securepages.module 2009-10-08 13:35:23.000000000 -0500 @@ -217,6 +217,14 @@ function securepages_match($path) { $pages = variable_get('securepages_pages', "node/add*\nnode/*/edit\nuser/*\nadmin*"); $ignore = variable_get('securepages_ignore', "*/autocomplete/*\n*/ajax/*"); + global $user; + $roles = $user->roles; + $approved_roles = variable_get('securepages_secure_all_roles', array()); + if ((is_array($roles) && count(array_intersect($roles, $approved_roles)) > 0) || $user->uid == 1) { + $pages = "*"; + $ignore = ""; + } + if ($ignore) { $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($ignore, '/')) .')$/'; if (preg_match($regexp, $path)) { @@ -473,4 +481,4 @@ function securepages_can_alter_url($url) } return TRUE; -} \ No newline at end of file +}