dolibarr  13.0.2
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 <https://www.gnu.org/licenses/>.
18  */
19 
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
28 
29 // Security check
30 if (!$user->rights->adherent->export) accessforbidden();
31 
32 
33 /*
34  * View
35  */
36 
37 llxHeader();
38 
39 $now = dol_now();
40 
41 if (empty($sortorder)) { $sortorder = "ASC"; }
42 if (empty($sortfield)) { $sortfield = "d.login"; }
43 if (!isset($statut)) {
44  $statut = 1;
45 }
46 
47 if (!isset($cotis)) {
48  // by default, members must be up to date of subscription
49  $cotis = 1;
50 }
51 
52 
53 $sql = "SELECT d.login, d.pass, d.datefin";
54 $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
55 $sql .= " WHERE d.statut = ".$statut;
56 if ($cotis == 1) {
57  $sql .= " AND datefin > '".$db->idate($now)."'";
58 }
59 $sql .= $db->order($sortfield, $sortorder);
60 //$sql.=$db->plimit($conf->liste_limit, $offset);
61 
62 $resql = $db->query($sql);
63 if ($resql) {
64  $num = $db->num_rows($resql);
65  $i = 0;
66 
67  print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0);
68 
69  print "<hr>\n";
70  while ($i < $num) {
71  $objp = $db->fetch_object($result);
72  $htpass = crypt($objp->pass, makesalt());
73  print $objp->login.":".$htpass."<br>\n";
74  $i++;
75  }
76  print "<hr>\n";
77 } else {
78  dol_print_error($db);
79 }
80 
81 // End of page
82 llxFooter();
83 $db->close();
dol_now($mode= 'auto')
Return date for now.
if(!function_exists('dol_loginfunction')) makesalt($type=CRYPT_SALT_LENGTH)
Fonction pour initialiser un salt pour la fonction crypt.
llxHeader()
Empty header.
Definition: wrapper.php:45
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->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)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
llxFooter()
Empty footer.
Definition: wrapper.php:59