[svn r18050] Minor - Fixed Revision 18020, don't show field password only when it's encrypted - see FS#3547

skala
Cristian Fasanando 17 years ago
parent 78f5598980
commit d480b20603
  1. 21
      main/admin/user_export.php

@ -1,5 +1,5 @@
<?php <?php
// $Id: user_export.php 18020 2009-01-27 00:02:33Z cfasanando $ // $Id: user_export.php 18050 2009-01-28 18:54:19Z cfasanando $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -67,8 +67,10 @@ $form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang
$form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses); $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses);
$form->addElement('submit', 'submit', get_lang('Ok')); $form->addElement('submit', 'submit', get_lang('Ok'));
$form->setDefaults(array('file_type'=>'csv')); $form->setDefaults(array('file_type'=>'csv'));
if ($form->validate()) if ($form->validate())
{ {
global $userPasswordCrypted;
$export = $form->exportValues(); $export = $form->exportValues();
$file_type = $export['file_type']; $file_type = $export['file_type'];
$course_code = $export['course_code']; $course_code = $export['course_code'];
@ -76,7 +78,8 @@ if ($form->validate())
u.lastname AS LastName, u.lastname AS LastName,
u.firstname AS FirstName, u.firstname AS FirstName,
u.email AS Email, u.email AS Email,
u.username AS UserName, u.username AS UserName,
".(($userPasswordCrypted)?" ":"u.password AS Password, ")."
u.auth_source AS AuthSource, u.auth_source AS AuthSource,
u.status AS Status, u.status AS Status,
u.official_code AS OfficialCode, u.official_code AS OfficialCode,
@ -94,14 +97,18 @@ if ($form->validate())
$data = array(); $data = array();
if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') if ($export['addcsvheader']=='1' AND $export['file_type']=='csv')
{ {
$data[] = array('UserId', 'LastName', 'FirstName', 'Email', 'UserName','AuthSource', 'Status', 'OfficialCode', 'Phone'); if($userPasswordCrypted){
$data[] = array('UserId', 'LastName', 'FirstName', 'Email', 'UserName', 'AuthSource', 'Status', 'OfficialCode', 'Phone');
} else {
$data[] = array('UserId', 'LastName', 'FirstName', 'Email', 'UserName','Password', 'AuthSource', 'Status', 'OfficialCode', 'Phone');
}
} }
$res = api_sql_query($sql,__FILE__,__LINE__); $res = api_sql_query($sql,__FILE__,__LINE__);
while($user = mysql_fetch_array($res,MYSQL_ASSOC)) while($user = mysql_fetch_array($res,MYSQL_ASSOC))
{ {
$data[] = $user ; $data[] = $user ;
} }
switch($file_type) switch($file_type)
{ {
case 'xml': case 'xml':

Loading…
Cancel
Save