dolibarr  7.0.0-beta
htpasswd.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
4  * Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
27 require '../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
29 
30 // Security check
31 if (! $user->rights->adherent->export) accessforbidden();
32 
33 
34 /*
35  * View
36  */
37 
38 llxHeader();
39 
40 $now=dol_now();
41 
42 if (empty($sortorder)) { $sortorder="ASC"; }
43 if (empty($sortfield)) { $sortfield="d.login"; }
44 if (! isset($statut))
45 {
46  $statut = 1 ;
47 }
48 
49 if (! isset($cotis))
50 {
51  // by default, members must be up to date of subscription
52  $cotis=1;
53 }
54 
55 
56 $sql = "SELECT d.login, d.pass, d.datefin";
57 $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
58 $sql .= " WHERE d.statut = $statut ";
59 if ($cotis==1)
60 {
61  $sql .= " AND datefin > '".$db->idate($now)."'";
62 }
63 $sql.= $db->order($sortfield,$sortorder);
64 //$sql.=$db->plimit($conf->liste_limit, $offset);
65 
66 $resql = $db->query($sql);
67 if ($resql)
68 {
69  $num = $db->num_rows($resql);
70  $i = 0;
71 
72  print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',0);
73 
74  print "<hr>\n";
75  while ($i < $num)
76  {
77  $objp = $db->fetch_object($result);
78  $htpass=crypt($objp->pass,makesalt());
79  print $objp->login.":".$htpass."<br>\n";
80  $i++;
81  }
82  print "<hr>\n";
83 }
84 else
85 {
86  dol_print_error($db);
87 }
88 
89 
90 llxFooter();
91 
92 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
if(!function_exists('dol_loginfunction')) makesalt($type=CRYPT_SALT_LENGTH)
Show Dolibarr default login page.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
llxHeader()
Empty header.
Definition: wrapper.php:46
dol_now($mode='gmt')
Return date for now.
print
Draft customers invoices.
Definition: index.php:91
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013