Index: securepages.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/securepages/Attic/securepages.admin.inc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 securepages.admin.inc
--- securepages.admin.inc	29 Mar 2009 10:49:12 -0000	1.1.2.1
+++ securepages.admin.inc	23 Mar 2010 01:19:13 -0000
@@ -61,7 +61,14 @@
      '#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 '<em>blog</em>' for the blog page and '<em>blog/*</em>' for every personal blog. '<em>&lt;front&gt;</em>' is the front page."),
    );
+   $form['securepages_roles'] = array(
+     '#type' => 'checkboxes',
+     '#title' => 'User roles',
+     '#description' => t('Check all roles that should be forced to always use the site via https.'),
+     '#options' => user_roles(TRUE),
+     '#default_value' => variable_get('securepages_roles', array()),
+   );
    return system_settings_form($form);
  }
  
- 
\ No newline at end of file
+ 
Index: securepages.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/securepages/securepages.module,v
retrieving revision 1.15.2.24
diff -u -r1.15.2.24 securepages.module
--- securepages.module	3 Nov 2009 05:50:58 -0000	1.15.2.24
+++ securepages.module	23 Mar 2010 01:19:14 -0000
@@ -46,6 +46,8 @@
  * Implementation of hook_init().
  */
 function securepages_init() {
+  securepages_redirect();
+
   if (!variable_get('securepages_enable', 0) || basename($_SERVER['PHP_SELF']) != 'index.php') {
     return;
   }
@@ -142,9 +144,10 @@
  * insecure version of the page.
  */
 function securepages_redirect() {
-  global $base_url;
+  global $base_url, $user;
   $path = isset($_GET['q']) ? $_GET['q'] : '';
   $page_match = securepages_match($path);
+  $role_match = securepages_roles($user);
 
   if ($_POST) {
     // If something has been posted to here then ignore the rules.
@@ -152,6 +155,9 @@
   elseif ($page_match && !securepages_is_secure()) {
     securepages_goto(TRUE);
   }
+  elseif ($role_match && !securepages_is_secure()) {
+    securepages_goto(TRUE);
+  }
   elseif ($page_match === 0 && securepages_is_secure() && variable_get('securepages_switch', FALSE)) {
     securepages_goto(FALSE);
   }
@@ -237,6 +243,20 @@
 }
 
 /**
+ * Check if the user is in a role that is always forced onto https.
+ *
+ * @param $account
+ *   A valid user object.
+ *
+ * @return
+ *   The number of roles set on the user that require https enforcing.
+ */
+function securepages_roles($account) {
+  $matches = array_intersect_key($account->roles, variable_get('securepages_roles', array()));
+  return count($matches);
+}
+
+/**
  * Secure Pages SSL Test
  */
 function securepages_test() {
@@ -462,4 +482,4 @@
   }
   
   return TRUE;
-}
\ No newline at end of file
+}
