21if ( !defined (
'ALLOWED')) die(
'Forbidden');
30echo
'<div class="content" >';
35if ( isset (
$_POST[
"ADD"]) )
39 $pass5=md5(
$_POST[
'PASS']);
40 $new_user=
new Noalyss_user(
$cn,0);
41 $new_user->first_name=
$http->post(
'FNAME');
42 $new_user->last_name=
$http->post(
'LNAME');
43 $login=
$http->post(
'LOGIN');
44 $login=str_replace(
"'",
"",$login);
45 $login=str_replace(
'"',
"",$login);
46 $login=str_replace(
" ",
"",$login);
47 $login=strtolower($login);
48 $new_user->login=$login;
50 $new_user->email=
$http->post(
'EMAIL',
"string",
'');
51 if ( trim($login)==
"" || strlen($login)<5)
53 alert(_(
"Le login ne peut pas être vide et avoir au moins 5 lettres"));
54 }
elseif (count($a_result[
'msg']) > 0){
56 $msg=
'<span class="warning">'._(
"Mot de passe inchangé").
'</span>';
57 foreach ($a_result[
'msg'] as
$result ) {
58 $msg.=
"$result <br/>";
64 $exist_user=
$cn->get_value(
"select count(*) from ac_users where use_login=lower($1)",[$login]);
65 if ( $exist_user == 0 ) {
68 put_global(array([
'key'=>
'use_id',
"value"=>$new_user->id]));
69 Noalyss_user::audit_admin(sprintf(
'ADD USER %s %s',$new_user->id,$login));
72 $uid=
$cn->get_value(
"select use_id from ac_users where use_login=lower($1)",[$login]);
73 $new_user->setId($uid);
74 put_global(array([
'key'=>
'use_id',
"value"=>$new_user->id]));
78 require_once NOALYSS_INCLUDE.
'/user_detail.inc.php';
89 $uid =
$http->post(
"UID");
97 alert(_(
"Cet utilisateur n'existe pas"));
108 die (
'Missing data');
110 if ( trim(
$_POST[
'password'])<>
'')
113 if (count($a_result[
'msg']) > 0){
115 $msg=
'<span class="warning">'._(
"Mot de passe inchangé").
'</span>';
116 foreach ($a_result[
'msg'] as
$result ) {
117 $msg.=
"$result <br/>";
140 $ctl_code=
$http->post(
'ctlcode');
141 $uid =
$http->request(
'use_id');
142 }
catch (Exception
$ex) {
146 if ( DEBUGNOALYSS > 1) {
147 echo
"code [$code] code control [$ctl_code]";
149 if (
$code != $ctl_code) {
150 echo _(
"Code invalide, effacement refusé");
154 $auser=
$cn->get_row(
'select use_login from ac_users where use_id = $1',[$uid]);
155 if ( $auser ==
null)
return;
156 $Res =
$cn->exec_sql(
"delete from jnt_use_dos where use_id=$1", array($uid));
157 $Res =
$cn->exec_sql(
"delete from ac_users where use_id=$1", array($uid));
161 $a_dossier=
$cn->get_array(
'select dos_id from ac_dossier');
162 if ( is_array($a_dossier) ) {
163 $nb=count($a_dossier);
165 Noalyss_user::remove_inexistant_user($a_dossier[
$i][
'dos_id']);
167 Noalyss_user::audit_admin(sprintf(
'DELETE USER %s %s',$uid,$auser[
'use_login']));
168 echo
"<H2 class=\"notice\">";
169 printf (_(
"Utilisateur %s %s est effacé"),
$http->post(
'fname'),
$http->post(
'lname')) ;
175 require_once NOALYSS_INCLUDE.
'/user_detail.inc.php';
181<div
id=
"create_user" style=
"display:none;width:30%;margin-right: 20%" class=
"inner_box">
183 <form action=
"admin-noalyss.php?action=user_mgt" method=
"POST" onsubmit=
"return check_form()">
184 <div
style=
"text-align: center">
185 <
span style=
"position:absolute;font-size:75%" id=
"info_passid"></
span>
186<TABLE
class=
"result" >
187 <TR><TD
style=
"text-align: right"> <?php echo _(
'login')?></TD><TD><INPUT
id=
"input_login" class=
"input_text" TYPE=
"TEXT" NAME=
"LOGIN"></TD></
tr>
188 <TR><TD
style=
"text-align: right"> <?php echo _(
'Prénom')?></TD><TD><INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"FNAME"></TD></
tr>
189 <TR><TD
style=
"text-align: right"> <?php echo _(
'Nom')?></TD><TD><INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"LNAME"></TD></TR>
191 <TD
style=
"text-align: right"> <?php echo _(
'Mot de passe')?>
192 <?=
\Icon_Action::tips(
"Mot de passe : longueur minimale = 8 dont au moins 1 majuscule, 1 minuscule,1 chiffre et 1 car.spécial")?>
195 <TD> <INPUT
id=
"input_password" class=
"input_text" TYPE=
"TEXT" NAME=
"PASS"
196 onkeyup=
"check_password_strength('input_password','info_passid',true)"
200 <TR><TD
style=
"text-align: right"> <?php echo _(
'Email')?></TD><TD> <INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"EMAIL"></TD></TR>
211 function check_form() {
212 if ($F(
'input_login') ==
"") {
213 smoke.alert(
'<?php echo _('Le login ne peut être vide
') ?>');
214 $(
'input_login').setStyle({border:
"red solid 2px"});
217 if ($F(
'input_password') ==
"") {
218 smoke.alert(
'<?php echo _('Le mot de passe ne peut être vide
') ?>');
219 $(
'input_password').setStyle({border:
"red solid 2px"});
222 if ($F(
'input_login').length < 5) {
223 smoke.alert(
'<?php echo _('Le login doit avoir au moins 5 lettres
') ?>');
224 $(
'input_password').setStyle({border:
"red solid 2px"});
247$url=basename($_SERVER[
'PHP_SELF']).
"?action=".
$_REQUEST[
'action'];
248$header->add(_(
"Login"),
$url,
" order by use_login asc",
"order by use_login desc",
"la",
"ld");
249$header->add(_(
"Nom"),
$url,
" order by use_name asc,use_first_name asc",
"order by use_name desc,use_first_name desc",
"na",
"nd");
250$header->add(_(
'Dossier'),
$url,
' order by ag_dossier asc',
'order by ag_dossier desc',
252$header->add(_(
"Actif"),
$url,
" order by use_active asc",
"order by use_active desc",
"aa",
"ad");
253$header->add(_(
"Email"),
$url,
" order by use_email asc,use_name asc,use_first_name asc",
"order by use_email desc,use_name desc,use_first_name desc",
"na",
"nd");
259if ( !empty ($a_user) )
261 echo
'<span style="display:block">';
262 echo _(
'Cherche').Icon_Action::infobulle(22);
265 echo
'<table id="user" class="result">';
267 echo
'<th>'.$header->get_header(0).
'</th>';
268 echo
'<th>'.$header->get_header(1).
'</th>';
269 echo
th(_(
"Prénom"));
270 echo
'<th>'.$header->get_header(4).
'</th>';
271 echo
'<th>'.$header->get_header(3).
'</th>';
272 echo
"<th>"._(
'Type').
"</th>";
273 echo
'<th>'.$header->get_header(2).
'</th>';
276 foreach ( $a_user as $r_user)
279 $class=($compteur%2==0)?
"odd":
"even";
281 echo
"<tr class=\"$class\">";
282 if ( $r_user[
'use_active'] == 0 )
290 $det_url=
$url.
"&det&use_id=".$r_user[
'use_id'];
295 echo
td($r_user[
'use_name']);
296 echo
td($r_user[
'use_first_name']);
297 echo
td($r_user[
'use_email']);
299 $type=($r_user[
'use_admin']==1)?_(
"Administrateur"):_(
"Utilisateur");
300 echo
"<td>".$type.
"</td>";
301 if ( $r_user[
'use_admin'] == 0)
302 echo
td($r_user[
'ag_dossier']);
th($p_string, $p_extra='', $raw='')
put_global($array)
Put in superglobal (get,post,request) the value contained in the parameter field (me_parameter)
span($p_string, $p_extra='')
echo_warning($p_string)
warns
check_password_strength($password)
returns an double array with the error found and code , if the count is 0 then the password is very s...
echo_error($p_log, $p_line="", $p_message="")
log error into the /tmp/noalyss_error.log it doesn't work on windows
tr($p_string, $p_extra='')
td($p_string='', $p_extra='')
surround the string with td
alert($p_msg, $buffer=false)
alert in javascript
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
contains the class for connecting to Noalyss
manage the current dossier, everywhere we need to know to which folder we are connected,...
static tips($p_comment)
Display a info in a bubble, text is given as parameter.
static echo_file($msg, $print=true)
display the file
Description of class_syn_sort_table.
if(count($a_accounting)==0) $header
if( $delta< 0) elseif( $delta==0)
if(isset($_POST["ADD"])) $sbaction
catch(Exception $ex) $UserChange