--- C:/profile_csv.module.orig	Thu Feb 05 12:57:11 2009
+++ C:/profile_csv.module	Thu Feb 05 13:01:08 2009
@@ -79,6 +79,31 @@
     '#return_value' => 1,
     '#default_value' => variable_get(PROFILE_CSV_PARAM . 'mail', 0),
   );
+  $form[$set][PROFILE_CSV_PARAM . 'status'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('User Status'),
+    '#return_value' => 1,
+    '#default_value' => variable_get(PROFILE_CSV_PARAM . 'status', 0),
+  );
+  $form[$set][PROFILE_CSV_PARAM . 'member_since'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('User Member Since'),
+    '#return_value' => 1,
+    '#default_value' => variable_get(PROFILE_CSV_PARAM . 'member_since', 0),
+  );
+  $form[$set][PROFILE_CSV_PARAM . 'last_access'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('User Last Access'),
+    '#return_value' => 1,
+    '#default_value' => variable_get(PROFILE_CSV_PARAM . 'last_access', 0),
+  );
+  $form[$set][PROFILE_CSV_PARAM . 'roles'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('User Roles'),
+    '#return_value' => 1,
+    '#default_value' => variable_get(PROFILE_CSV_PARAM . 'roles', 0),
+  );
+
   
   $set = 'profile';
   $form[$set] = array(
@@ -220,7 +245,7 @@
 
 function _profile_csv_get_user($uid = 0) {
    $users = array();
-   $result = db_query('SELECT u.uid, u.name, u.mail, u.data FROM {users} u WHERE u.uid = %d', $uid);
+	$result = db_query('SELECT u.uid, u.name, u.mail, u.data, u.status, u.created, u.access FROM {users} u WHERE u.uid = %d', $uid);
    while ($row = db_fetch_object($result)) {
     if (variable_get(PROFILE_CSV_PARAM . 'uid', 0)) 
       $users[] = $row->uid;
@@ -231,7 +256,31 @@
     if (variable_get(PROFILE_CSV_PARAM . 'mail', 0)) 
       $users[] = $row->mail;
       $users['data'] = unserialize($row->data);
+
+    if (variable_get(PROFILE_CSV_PARAM . 'status', 0)) 
+			if ($row->status == 1){
+	      $users[] = 'active';
+			}
+			if ($row->status == 0){
+	      $users[] = 'blocked';
   } 
+
+    if (variable_get(PROFILE_CSV_PARAM . 'member_since', 0)) 
+      $users[] = format_date($row->created, 'small');
+
+    if (variable_get(PROFILE_CSV_PARAM . 'last_access', 0)) 
+      $users[] = format_date($row->access, 'small');
+
+		if (variable_get(PROFILE_CSV_PARAM . 'roles', 0)) 
+			$result_roles = db_query('SELECT r.name FROM {users} u LEFT JOIN {users_roles} ur on ur.uid = u.uid LEFT JOIN {role} r ON r.rid = ur.rid WHERE u.uid = %d', $uid);
+			$users_roles = array();
+			while ($result_row = db_fetch_object($result_roles)) {
+				$uroles[] = $result_row->name;
+			}
+			$users[] = implode(", ",$uroles);
+
+  } 
+		
   return $users;  
 }  
     
@@ -272,6 +321,18 @@
 
   if (variable_get(PROFILE_CSV_PARAM . 'mail', 0)) 
     $row[] = '"mail"';
+
+  if (variable_get(PROFILE_CSV_PARAM . 'status', 0)) 
+    $row[] = '"status"';
+
+  if (variable_get(PROFILE_CSV_PARAM . 'member_since', 0)) 
+    $row[] = '"member_since"';
+
+  if (variable_get(PROFILE_CSV_PARAM . 'last_access', 0)) 
+    $row[] = '"last_access"';
+
+  if (variable_get(PROFILE_CSV_PARAM . 'roles', 0)) 
+    $row[] = '"roles"';
 
   foreach(_profile_csv_get_profile_fields() as $field) {
     $row[] = '"'. $field['title'] .'"';
