dolibarr  17.0.4
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 // Load Dolibarr environment
27 require '../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
29 
30 $status = GETPOST('status', 'int');
31 $cotis = GETPOST('cotis', 'int');
32 
33 $sortfield = GETPOST('sortfield', 'alphanohtml');
34 $sortorder = GETPOST('sortorder', 'aZ09');
35 
36 // Security check
37 if (!isModEnabled('adherent')) {
39 }
40 if (empty($user->rights->adherent->export)) {
42 }
43 
44 
45 /*
46  * View
47  */
48 
49 llxHeader();
50 
51 $now = dol_now();
52 
53 if (empty($sortorder)) {
54  $sortorder = "ASC";
55 }
56 if (empty($sortfield)) {
57  $sortfield = "d.login";
58 }
59 
60 $sql = "SELECT d.login, d.pass, d.datefin";
61 $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
62 $sql .= " WHERE d.statut = ".((int) $status);
63 if ($cotis == 1) {
64  $sql .= " AND datefin > '".$db->idate($now)."'";
65 }
66 $sql .= $db->order($sortfield, $sortorder);
67 //$sql.=$db->plimit($conf->liste_limit, $offset);
68 
69 $resql = $db->query($sql);
70 if ($resql) {
71  $num = $db->num_rows($resql);
72  $i = 0;
73 
74  $param = '';
75  print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0);
76 
77  print "<hr>\n";
78  while ($i < $num) {
79  $objp = $db->fetch_object($result);
80  $htpass = crypt($objp->pass, makesalt());
81  print $objp->login.":".$htpass."<br>\n";
82  $i++;
83  }
84  print "<hr>\n";
85 } else {
86  dol_print_error($db);
87 }
88 
89 // End of page
90 llxFooter();
91 $db->close();
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
isModEnabled($module)
Is Dolibarr module enabled.
if(!function_exists('dol_loginfunction')) makesalt($type=CRYPT_SALT_LENGTH)
Fonction pour initialiser un salt pour la fonction crypt.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.