2004-10-19 20:58:50 +02:00
|
|
|
<?php
|
2003-09-03 18:02:43 +02:00
|
|
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2006-11-26 19:24:53 +01:00
|
|
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
2008-04-09 20:13:45 +02:00
|
|
|
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
2003-09-03 18:02:43 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-09-03 18:02:43 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 00:21:57 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-09-03 18:02:43 +02:00
|
|
|
*/
|
2004-08-14 14:37:59 +02:00
|
|
|
|
2006-11-26 19:24:53 +01:00
|
|
|
/**
|
2010-03-01 09:55:43 +01:00
|
|
|
* \file htdocs/adherents/htpasswd.php
|
|
|
|
|
* \ingroup member
|
|
|
|
|
* \brief Page d'export htpasswd du fichier des adherents
|
|
|
|
|
* \author Rodolphe Quiedeville
|
|
|
|
|
*/
|
2004-08-14 14:37:59 +02:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
2012-02-13 01:43:35 +01:00
|
|
|
|
|
|
|
|
// Security check
|
|
|
|
|
if (! $user->rights->adherent->export) accessforbidden();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
2003-09-03 18:02:43 +02:00
|
|
|
|
|
|
|
|
llxHeader();
|
|
|
|
|
|
2012-04-30 15:01:25 +02:00
|
|
|
$now=dol_now();
|
|
|
|
|
|
2003-09-03 18:02:43 +02:00
|
|
|
if ($sortorder == "") { $sortorder="ASC"; }
|
|
|
|
|
if ($sortfield == "") { $sortfield="d.login"; }
|
|
|
|
|
if (! isset($statut))
|
|
|
|
|
{
|
|
|
|
|
$statut = 1 ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (! isset($cotis))
|
|
|
|
|
{
|
|
|
|
|
// par defaut les adherents doivent etre a jour de cotisation
|
|
|
|
|
$cotis=1;
|
|
|
|
|
}
|
2006-11-26 19:24:53 +01:00
|
|
|
|
|
|
|
|
|
2010-04-20 21:00:17 +02:00
|
|
|
$sql = "SELECT d.login, d.pass, d.datefin";
|
2004-02-01 01:42:23 +01:00
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
|
2003-09-03 18:02:43 +02:00
|
|
|
$sql .= " WHERE d.statut = $statut ";
|
2006-11-26 19:24:53 +01:00
|
|
|
if ($cotis==1)
|
|
|
|
|
{
|
2012-04-30 15:01:25 +02:00
|
|
|
$sql .= " AND datefin > '".$db->idate($now)."'";
|
2003-09-03 18:02:43 +02:00
|
|
|
}
|
2010-04-20 21:00:17 +02:00
|
|
|
$sql.= $db->order($sortfield,$sortorder);
|
2006-11-26 19:24:53 +01:00
|
|
|
//$sql.=$db->plimit($conf->liste_limit, $offset);
|
2003-09-03 18:02:43 +02:00
|
|
|
|
2006-11-26 19:24:53 +01:00
|
|
|
$resql = $db->query($sql);
|
|
|
|
|
if ($resql)
|
2003-09-03 18:02:43 +02:00
|
|
|
{
|
2006-11-26 19:24:53 +01:00
|
|
|
$num = $db->num_rows($resql);
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
|
|
print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',0);
|
|
|
|
|
|
|
|
|
|
print "<hr>\n";
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$objp = $db->fetch_object($result);
|
|
|
|
|
$htpass=crypt($objp->pass,makesalt());
|
|
|
|
|
print $objp->login.":".$htpass."<br>\n";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
print "<hr>\n";
|
2003-09-03 18:02:43 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
dol_print_error($db);
|
2003-09-03 18:02:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-02-13 01:43:35 +01:00
|
|
|
|
|
|
|
|
$db->close();
|
2003-09-03 18:02:43 +02:00
|
|
|
?>
|