| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
# $Id: user_new.php 2653 2018-11-04 02:05:54Z tom.houdayer $
|
2 |
# $Id: user_new.php 2698 2019-02-05 10:25:12Z tom.houdayer $
|
| 3 |
|
3 |
|
| 4 |
//gestion de la langue
|
4 |
//gestion de la langue
|
| 5 |
if (is_file("../lib/langues.php"))
|
5 |
if (is_file("../lib/langues.php"))
|
| 6 |
include("../lib/langues.php");
|
6 |
include("../lib/langues.php");
|
| 7 |
|
7 |
|
| Line 97... |
Line 97... |
| 97 |
</td></tr>
|
97 |
</td></tr>
|
| 98 |
<tr bgcolor="black" valign="top"><td colspan="2">
|
98 |
<tr bgcolor="black" valign="top"><td colspan="2">
|
| 99 |
<table border="0" width="100%" cellpadding="12" cellspacing="0" bgcolor="#ffffd0" valign="top">
|
99 |
<table border="0" width="100%" cellpadding="12" cellspacing="0" bgcolor="#ffffd0" valign="top">
|
| 100 |
<tr><td>
|
100 |
<tr><td>
|
| 101 |
<?php
|
101 |
<?php
|
| 102 |
function sec_imp($time)
|
- |
|
| 103 |
/*Formatage des secondes avant l'impression */
|
- |
|
| 104 |
{
|
- |
|
| 105 |
$result = '';
|
- |
|
| 106 |
$jour = 0;$heure = 0;$minute = 0;$seconde = 0;
|
- |
|
| 107 |
$jour = floor($time/86400);
|
- |
|
| 108 |
$reste = $time%86400;
|
- |
|
| 109 |
if ($jour!=0) $result = $jour.' J ';
|
- |
|
| 110 |
$heure = floor($reste/3600);
|
- |
|
| 111 |
$reste = $reste%3600;
|
- |
|
| 112 |
if ($heure!=0) $result = $result.$heure.' H ';
|
- |
|
| 113 |
$minute = floor($reste/60);
|
- |
|
| 114 |
if ($minute!=0) $result = $result.$minute.' min ';
|
- |
|
| 115 |
$seconde = $reste%60;
|
- |
|
| 116 |
if ($seconde!=0) $result = $result.$seconde.' s ';
|
- |
|
| 117 |
return $result;
|
- |
|
| 118 |
}
|
- |
|
| 119 |
|
- |
|
| 120 |
if ($create == 1){
|
102 |
if ($create == 1){
|
| 121 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
103 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
| 122 |
include("../lib/$config[general_lib_type]/user_info.php");
|
104 |
include("../lib/$config[general_lib_type]/user_info.php");
|
| 123 |
if ($user_exists != "no"){
|
105 |
if ($user_exists != "no"){
|
| 124 |
echo <<<EOM
|
- |
|
| 125 |
<b><i>$login</i> $l_user_exists</b>
|
106 |
echo "<b><i>$login</i> $l_user_exists</b>";
|
| 126 |
EOM;
|
- |
|
| 127 |
}
|
107 |
}
|
| 128 |
else{
|
108 |
else{
|
| 129 |
/*création de l'utilisateur*/
|
109 |
/*création de l'utilisateur*/
|
| 130 |
if (is_file("../lib/$config[general_lib_type]/create_user.php"))
|
110 |
if (is_file("../lib/$config[general_lib_type]/create_user.php"))
|
| 131 |
include("../lib/$config[general_lib_type]/create_user.php");
|
111 |
include("../lib/$config[general_lib_type]/create_user.php");
|
| 132 |
/* Petit traitement pré-impression pour la lisibilité */
|
- |
|
| 133 |
/* Récupération des attributs du groupe le cas échéant */
|
- |
|
| 134 |
if (isset($group) && $group!=''){
|
- |
|
| 135 |
$saved_login = $login;
|
- |
|
| 136 |
$login = $group;
|
- |
|
| 137 |
if (is_file("../lib/sql/group_info.php"))
|
- |
|
| 138 |
include("../lib/sql/group_info.php");
|
- |
|
| 139 |
$login = $saved_login;}
|
- |
|
| 140 |
/* Si les valeurs de durée sont vide remplissage avec la valeur 'Illimitée'*/
|
- |
|
| 141 |
/* et formatage des secondes sous le format Heure min ses*/
|
- |
|
| 142 |
if ($sto_imp==''){ $sto_imp='-';}
|
- |
|
| 143 |
else { $sto_imp=sec_imp($sto_imp);}
|
- |
|
| 144 |
if ($mas_imp==''){ $mas_imp='-';}
|
- |
|
| 145 |
else { $mas_imp=sec_imp($mas_imp);}
|
- |
|
| 146 |
if ($mds_imp==''){ $mds_imp='-';}
|
- |
|
| 147 |
else { $mds_imp=sec_imp($mds_imp);}
|
- |
|
| 148 |
if ($mms_imp==''){ $mms_imp='-';}
|
- |
|
| 149 |
else { $mms_imp=sec_imp($mms_imp);}
|
- |
|
| 150 |
/*Formatage de la date afin d'être lisible dans toute les langues 'jj mm yyyy'*/
|
- |
|
| 151 |
if ($Expiration!=''){ $Expiration=date("d - m - Y",strtotime($Expiration));}
|
- |
|
| 152 |
else { $Expiration='-';}
|
- |
|
| 153 |
if ($show != 3) //utilisateur normal
|
112 |
if ($show != 3) //utilisateur normal
|
| 154 |
{
|
113 |
{
|
| 155 |
//Appel du ticket d'impression , passage en paramètres des valeurs à afficher
|
114 |
//Appel du ticket d'impression , passage en paramètres des valeurs à afficher
|
| 156 |
echo' <form name="impression" method="post" action="ticket_user.php" target="_blank">
|
115 |
echo' <form name="impression" method="post" action="ticket_user.php" target="_blank">
|
| 157 |
<input type="hidden" name="langue_imp" value="'.$langue_imp.'">
|
116 |
<input type="hidden" name="langue_imp" value="'.$langue_imp.'">
|
| 158 |
<input type="hidden" name="log_imp" value="'.$login.'">
|
117 |
<input type="hidden" name="username" value="'.$login.'">
|
| 159 |
<input type="hidden" name="passwd_imp" value="'.$passwd_imp.'">
|
118 |
<input type="hidden" name="password" value="'.$_POST['passwd'].'">
|
| 160 |
<input type="hidden" name="sto_imp" value="'.$sto_imp.'">
|
- |
|
| 161 |
<input type="hidden" name="mas_imp" value="'.$mas_imp.'">
|
- |
|
| 162 |
<input type="hidden" name="mds_imp" value="'.$mds_imp.'">
|
- |
|
| 163 |
<input type="hidden" name="mms_imp" value="'.$mms_imp.'">
|
- |
|
| 164 |
<input type="hidden" name="exp_imp" value="'.$Expiration.'">
|
- |
|
| 165 |
</form>';
|
119 |
</form>';
|
| 166 |
echo' <a href="#" onclick="document.forms[\'impression\'].submit();">'.$l_create_ticket.'</a>';
|
120 |
echo' <a href="#" onclick="document.forms[\'impression\'].submit();">'.$l_create_ticket.'</a>';
|
| 167 |
//fin ticket impression
|
121 |
//fin ticket impression
|
| 168 |
}
|
122 |
}
|
| 169 |
else //utilisateur = adresse mac
|
123 |
else //utilisateur = adresse mac
|