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 ) {
66 $new_user->setPassword($pass5);
69 put_global(array([
'key'=>
'use_id',
"value"=>$new_user->id]));
70 Noalyss_user::audit_admin(sprintf(
'ADD USER %s %s',$new_user->id,$login));
73 $uid=
$cn->get_value(
"select use_id from ac_users where use_login=lower($1)",[$login]);
74 $new_user->setId($uid);
75 put_global(array([
'key'=>
'use_id',
"value"=>$new_user->id]));
79 require_once NOALYSS_INCLUDE.
'/user_detail.inc.php';
90 $uid =
$http->post(
"UID");
98 alert(
_(
"Cet utilisateur n'existe pas"));
109 die (
'Missing data');
111 if ( trim(
$_POST[
'password'])<>
'')
114 if (count($a_result[
'msg']) > 0){
116 $msg=
'<span class="warning">'._(
"Mot de passe inchangé").
'</span>';
117 foreach ($a_result[
'msg'] as
$result ) {
118 $msg.=
"$result <br/>";
141 $ctl_code=
$http->post(
'ctlcode');
142 $uid =
$http->request(
'use_id');
143 }
catch (Exception
$ex) {
147 if ( DEBUGNOALYSS > 1) {
148 echo
"code [$code] code control [$ctl_code]";
150 if (
$code != $ctl_code) {
155 $auser=
$cn->get_row(
'select use_login from ac_users where use_id = $1',[$uid]);
156 if ( $auser ==
null)
return;
157 $Res =
$cn->exec_sql(
"delete from jnt_use_dos where use_id=$1", array($uid));
158 $Res =
$cn->exec_sql(
"delete from ac_users where use_id=$1", array($uid));
162 $a_dossier=
$cn->get_array(
'select dos_id from ac_dossier');
163 if ( is_array($a_dossier) ) {
164 $nb=count($a_dossier);
166 Noalyss_user::remove_inexistant_user($a_dossier[
$i][
'dos_id']);
168 Noalyss_user::audit_admin(sprintf(
'DELETE USER %s %s',$uid,$auser[
'use_login']));
169 echo
"<H2 class=\"notice\">";
170 printf (
_(
"Utilisateur %s %s est effacé"),
$http->post(
'fname'),
$http->post(
'lname')) ;
176 require_once NOALYSS_INCLUDE.
'/user_detail.inc.php';
182<div
id=
"create_user" style=
"display:none;width:30%;margin-right: 20%" class=
"inner_box">
184 <form action=
"admin-noalyss.php?action=user_mgt" method=
"POST" onsubmit=
"return check_form()">
185 <div
style=
"text-align: center">
186 <
span style=
"position:absolute;font-size:75%" id=
"info_passid"></
span>
187<TABLE
class=
"result" >
188 <TR><TD
style=
"text-align: right"> <?php echo
_(
'login')?></TD><TD><INPUT
id=
"input_login" class=
"input_text" TYPE=
"TEXT" NAME=
"LOGIN"></TD></
tr>
189 <TR><TD
style=
"text-align: right"> <?php echo
_(
'Prénom')?></TD><TD><INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"FNAME"></TD></
tr>
190 <TR><TD
style=
"text-align: right"> <?php echo
_(
'Nom')?></TD><TD><INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"LNAME"></TD></TR>
192 <TD
style=
"text-align: right"> <?php echo
_(
'Mot de passe')?>
193 <?=
\Icon_Action::tips(
"Mot de passe : longueur minimale = 8 dont au moins 1 majuscule, 1 minuscule,1 chiffre et 1 car.spécial")?>
196 <TD> <INPUT
id=
"input_password" class=
"input_text" TYPE=
"TEXT" NAME=
"PASS"
197 onkeyup=
"check_password_strength('input_password','info_passid',true)"
201 <TR><TD
style=
"text-align: right"> <?php echo
_(
'Email')?></TD><TD> <INPUT
class=
"input_text" TYPE=
"TEXT" NAME=
"EMAIL"></TD></TR>
212 function check_form() {
213 if ($F(
'input_login') ==
"") {
214 smoke.alert(
'<?php echo _('Le login ne peut être vide
') ?>');
215 $(
'input_login').setStyle({border:
"red solid 2px"});
218 if ($F(
'input_password') ==
"") {
219 smoke.alert(
'<?php echo _('Le mot de passe ne peut être vide
') ?>');
220 $(
'input_password').setStyle({border:
"red solid 2px"});
223 if ($F(
'input_login').length < 5) {
224 smoke.alert(
'<?php echo _('Le login doit avoir au moins 5 lettres
') ?>');
225 $(
'input_password').setStyle({border:
"red solid 2px"});
248$url=basename($_SERVER[
'PHP_SELF']).
"?action=".
$_REQUEST[
'action'];
249$header->add(
_(
"Login"),
$url,
" order by use_login asc",
"order by use_login desc",
"la",
"ld");
250$header->add(
_(
"Nom"),
$url,
" order by use_name asc,use_first_name asc",
"order by use_name desc,use_first_name desc",
"na",
"nd");
251$header->add(
_(
'Dossier'),
$url,
' order by ag_dossier asc',
'order by ag_dossier desc',
253$header->add(
_(
"Actif"),
$url,
" order by use_active asc",
"order by use_active desc",
"aa",
"ad");
254$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");
260if ( !empty ($a_user) )
262 echo
'<span style="display:block">';
263 echo
_(
'Cherche').Icon_Action::infobulle(22);
266 echo
'<table id="user" class="result">';
268 echo
'<th>'.$header->get_header(0).
'</th>';
269 echo
'<th>'.$header->get_header(1).
'</th>';
270 echo
th(
_(
"Prénom"));
271 echo
'<th>'.$header->get_header(4).
'</th>';
272 echo
'<th>'.$header->get_header(3).
'</th>';
273 echo
"<th>"._(
'Type').
"</th>";
274 echo
'<th>'.$header->get_header(2).
'</th>';
277 foreach ( $a_user as $r_user)
280 $class=($compteur%2==0)?
"odd":
"even";
282 echo
"<tr class=\"$class\">";
283 if ( $r_user[
'use_active'] == 0 )
291 $det_url=
$url.
"&det&use_id=".$r_user[
'use_id'];
296 echo
td($r_user[
'use_name']);
297 echo
td($r_user[
'use_first_name']);
298 echo
td($r_user[
'use_email']);
300 $type=($r_user[
'use_admin']==1)?
_(
"Administrateur"):
_(
"Utilisateur");
301 echo
"<td>".$type.
"</td>";
302 if ( $r_user[
'use_admin'] == 0)
303 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
_("actif, passif,charge,...")
contains the class for connecting to Noalyss
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