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