/[drupal]/contributions/modules/profile_csv/profile_csv.module
ViewVC logotype

Diff of /contributions/modules/profile_csv/profile_csv.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.10.2.1, Tue Jul 7 23:43:55 2009 UTC revision 1.10.2.2, Mon Oct 26 15:52:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: profile_csv.module,v 1.10 2008/07/21 00:47:04 kbahey Exp $  // $Id: profile_csv.module,v 1.10.2.1 2009/07/07 23:43:55 kbahey Exp $
3    
4    
5  define('PROFILE_CSV_STATUS',         'profile_csv_status');  define('PROFILE_CSV_STATUS',         'profile_csv_status');
# Line 144  function profile_csv_admin_settings() { Line 144  function profile_csv_admin_settings() {
144  }  }
145    
146  function profile_csv_page() {  function profile_csv_page() {
147    $data = _profile_csv_header();    header("Content-type: text/plain; charset=UTF-8");
148      header("Content-Disposition: attachment; filename=userlist.csv");
149      header("Pragma: no-cache");
150      header("Expires: 0");
151    
152      print _profile_csv_header();
153    $user_status = variable_get(PROFILE_CSV_STATUS, 2);    $user_status = variable_get(PROFILE_CSV_STATUS, 2);
154    if (variable_get(PROFILE_CSV_ROLE .'2', 0)) {    if (variable_get(PROFILE_CSV_ROLE .'2', 0)) {
155      $result = db_query("SELECT u.uid, u.status FROM {users} u  WHERE u.uid > 1");      $result = db_query("SELECT u.uid, u.status FROM {users} u  WHERE u.uid > 1");
156      while ($row = db_fetch_object($result)) {      while ($row = db_fetch_object($result)) {
157        if ($user_status == 2) {        if ($user_status == 2) {
158          $data .= _profile_csv_format_user($row->uid );          print _profile_csv_format_user($row->uid );
159        }        }
160        else{        else{
161          if ($user_status == $row->status) {          if ($user_status == $row->status) {
162            $data .= _profile_csv_format_user($row->uid );            print _profile_csv_format_user($row->uid );
163          }          }
164        }        }
165      }      }
# Line 168  function profile_csv_page() { Line 173  function profile_csv_page() {
173      while ($row = db_fetch_object($result)) {      while ($row = db_fetch_object($result)) {
174        if ((variable_get(PROFILE_CSV_ROLE . $row->rid, 0)) && ($row->uid != $prev_uid)) {        if ((variable_get(PROFILE_CSV_ROLE . $row->rid, 0)) && ($row->uid != $prev_uid)) {
175          if ($user_status == 2) {          if ($user_status == 2) {
176            $data .= _profile_csv_format_user($row->uid );            print  _profile_csv_format_user($row->uid );
177          }          }
178          else{          else{
179            if ($user_status == $row->status) {            if ($user_status == $row->status) {
180              $data .= _profile_csv_format_user($row->uid );              print  _profile_csv_format_user($row->uid );
181            }            }
182          }          }
183         $prev_uid = $row->uid;         $prev_uid = $row->uid;
184        }        }
185      }      }
186    }    }
187    header("Content-type: text/plain; charset=UTF-8");  
   header("Content-Disposition: attachment; filename=userlist.csv");  
   header("Pragma: no-cache");  
   header("Expires: 0");  
   print $data;  
188    exit();    exit();
189  }  }
190    

Legend:
Removed from v.1.10.2.1  
changed lines
  Added in v.1.10.2.2

  ViewVC Help
Powered by ViewVC 1.1.2