Ver código fonte

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

Cristian Fasanando 16 anos atrás
pai
commit
d480b20603
1 arquivos alterados com 14 adições e 7 exclusões
  1. 14 7
      main/admin/user_export.php

+ 14 - 7
main/admin/user_export.php

@@ -1,5 +1,5 @@
 <?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
@@ -67,8 +67,10 @@ $form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang
 $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses);
 $form->addElement('submit', 'submit', get_lang('Ok'));
 $form->setDefaults(array('file_type'=>'csv'));
+
 if ($form->validate())
 {
+	global $userPasswordCrypted;
 	$export = $form->exportValues();
 	$file_type = $export['file_type'];
 	$course_code = $export['course_code'];
@@ -76,7 +78,8 @@ if ($form->validate())
 					u.lastname 	AS LastName,
 					u.firstname 	AS FirstName,
 					u.email 		AS Email,
-					u.username	AS UserName,					
+					u.username	AS UserName,
+					".(($userPasswordCrypted)?" ":"u.password AS Password, ")."
 					u.auth_source	AS AuthSource,
 					u.status		AS Status,
 					u.official_code	AS OfficialCode,
@@ -94,14 +97,18 @@ if ($form->validate())
 	$data = array();
 	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))
-	{
-		$data[] = $user	;
+	{		
+		$data[] = $user	;							
 	}
+	
 	switch($file_type)
 	{
 		case 'xml':