2009-02-17 13:14:53 +00:00
< ?
$siret = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'siret' ]));
2009-03-11 07:51:18 +00:00
$idEntreprise = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'idEntreprise' ])) * 1 ;
2009-03-25 14:38:22 +00:00
2009-02-17 13:14:53 +00:00
if ( ! $_SESSION [ 'connected' ])
echo ( 'Vous devez <20> tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69> ' );
elseif ( $_SESSION [ 'tabInfo' ][ 'profil' ] <> 'Administrateur' ) {
echo ( 'Vous n\'avez pas les droits n<> cessaires pour utiliser cette fonctionnalit<69> (' . $_SESSION [ 'tabInfo' ][ 'profil' ] . ')' );
$siret = $_REQUEST [ 'siret' ];
}
else {
if ( $_REQUEST [ 'action' ] == 'delete' ) {
$message = 'Erreur lors de la suppression du compte utilisateur !' ;
try {
$tabOptions = array ( 'delete' => true );
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
//action=delete&login=bpanaccione&idUti=3
if ( $O [ 'result' ] == 1 ) $message = 'Compte "' . $_REQUEST [ 'login' ] . '" supprim<69> !' ;
} catch ( SoapFault $fault ) {
$message = 'Erreur SOAP lors de la suppression du compte utilisateur !' ;
}
} elseif ( $_REQUEST [ 'action' ] == 'activate' ) {
$message = 'Erreur lors de l\'activation du compte utilisateur !' ;
try {
$tabOptions = array ( 'actif' => true );
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
if ( $O [ 'result' ] == 1 ) $message = 'Compte "' . $_REQUEST [ 'login' ] . '" activ<69> !' ;
} catch ( SoapFault $fault ) {
$message = 'Erreur SOAP lors de l\'activation du compte utilisateur !' ;
}
} elseif ( $_REQUEST [ 'action' ] == 'unactivate' ) {
$message = 'Erreur lors de la d<> sactivation du compte utilisateur !' ;
try {
$tabOptions = array ( 'actif' => false );
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
if ( $O [ 'result' ] == 1 ) $message = 'Compte "' . $_REQUEST [ 'login' ] . '" d<> sactiv<69> !' ;
} catch ( SoapFault $fault ) {
$message = 'Erreur SOAP lors de la d<> sactivation du compte utilisateur !' ;
}
}
/** Utilisation du WS **/
try {
$O = $client -> getListeUtilisateurs ( $_SESSION [ 'tabInfo' ][ 'login' ]);
$utilisateurs = $O [ 'results' ];
} catch ( SoapFault $fault ) {
2009-02-26 17:16:11 +00:00
include_once ( realpath ( dirname ( __FILE__ ) . '/../../' ) . '/includes/soaperror.php' );
processSoapFault ( $client , $fault , $tabInfo );
2009-02-17 13:14:53 +00:00
die ();
}
//print_r($O);//utilisateurs);
?>
< table width = " 580 " border = " 0 " align = " left " bgcolor = " #FFFFFF " >
< tr >
< td colspan = " 7 " >< img src = " ./img/rub_admin.png " width = " 577 " height = " 36 " ></ td >
</ tr >
< ?
if ( $message <> '' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 500 " colspan = " 2 " class = " StyleInfoData " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
< ?
}
?>
< tr >
< td colspan = " 7 " >& nbsp ; </ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 6 " class = " StyleInfoLib " align = " center " >< h3 > Liste des profils utilisateurs </ h3 ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 100 " class = " StyleInfoLib " > Login </ td >
< td width = " 100 " class = " StyleInfoLib " > Nom </ td >
< td width = " 100 " class = " StyleInfoLib " > Pr & eacute ; nom </ td >
< td width = " 30 " class = " StyleInfoLib " > Actif </ td >
< td width = " 200 " class = " StyleInfoLib " > E - mail </ td >
< td width = " 20 " class = " StyleInfoLib " >& nbsp ; </ td >
</ tr >
< ?
foreach ( $utilisateurs as $uti ) {
?>
< tr >
2009-03-11 07:51:18 +00:00
< td width = " 30 " align = " center " valign = " middle " >< a href = " /?page=moncompte&idEntreprise=<?= $idEntreprise ?>&siret=<?= $siret ?>&login=<?= $uti['login'] ?>&idUti=<?= $uti['idUti'] ?>&referer=administration " >< img src = " /img/edit0.gif " title = " Editer le profil utilisateur " width = " 16 " height = " 16 " /></ a ></ td >
2009-02-17 13:14:53 +00:00
< td width = " 100 " class = " StyleInfoData " >< ? = $uti [ 'login' ] ?> </td>
< td width = " 100 " class = " StyleInfoData " >< ? = $uti [ 'nom' ] ?> </td>
< td width = " 100 " class = " StyleInfoData " >< ? = $uti [ 'prenom' ] ?> </td>
< td width = " 30 " class = " StyleInfoLib " >< ?
2009-03-11 07:51:18 +00:00
if ( $uti [ 'actif' ] == 1 ) { ?> <a href="Javascript:if (confirm('Voulez-vous d<> sactiver le compte de <?=$uti['login']?>')){document.location.href='/?page=administration&idEntreprise=<?=$idEntreprise?>&siret=<?=$siret?>&action=unactivate&login=<?=$uti['login']?>&idUti=<?=$uti['idUti']?>'}" title="D<> sactiver le profil utilisateur"><u><font color="green">Oui</font></u></a><? }
else { ?> <a href="Javascript:if (confirm('Voulez-vous activer le compte de <?=$uti['login']?>')) {document.location.href='/?page=administration&idEntreprise=<?=$idEntreprise?>&siret=<?=$siret?>&action=activate&login=<?=$uti['login']?>&idUti=<?=$uti['idUti']?>'}" title="Activer le profil utilisateur"><u><font color="red" >Non</font></u></a><? } ?></td>
2009-02-17 13:14:53 +00:00
< td width = " 200 " class = " StyleInfoData " >< a href = " mailto:<?= $uti['email'] ?> " >< ? = str_replace ( ';' , '<br/>' , $uti [ 'email' ]) ?> </a></td>
2009-03-11 07:51:18 +00:00
< td width = " 20 " align = " center " valign = " middle " >< a href = " Javascript:if (confirm('Voulez-vous supprimer le compte de <?= $uti['login'] ?>')) { document.location.href='/?page=administration&idEntreprise=<?= $idEntreprise ?>&siret=<?= $siret ?>&action=delete&login=<?= $uti['login'] ?>&idUti=<?= $uti['idUti'] ?>'} " >< img src = " /img/delete.gif " title = " Supprimer le profil utilisateur " width = " 11 " height = " 11 " /></ a ></ td >
2009-02-17 13:14:53 +00:00
</ tr >
< ?
}
?>
< tr >
< td colspan = " 7 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 7 " align = " center " >
< form name = " form_admin " action = " ./?page=moncompte&action=new&referer=administration " method = " POST " enctype = " multipart/form-data " >< input type = " submit " value = " Cr<EFBFBD> er un profil utilisateur " /></ form ></ td >
</ tr >
</ table >
< ?
/*
?>
< form name = " form_moncompte " action = " ./?page=moncompte " method = " POST " enctype = " multipart/form-data " >
< input type = " hidden " name = " frmOptions[action] " value = " sauver " />
< input type = " hidden " name = " siret " value = " <?= $siret ?> " />
< input type = " hidden " name = " id " value = " <?= $id ?> " />
< table width = " 580 " border = " 0 " align = " left " bgcolor = " #FFFFFF " >
< ?
if ( $message <> '' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 500 " colspan = " 2 " class = " StyleInfoData " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
< ?
}
?>
< tr >
< td colspan = " 3 " >< img src = " ./img/rub_profil.png " width = " 577 " height = " 36 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mon code identifiant </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $_SESSION [ 'tabInfo' ][ 'login' ] ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mon identit & eacute ; </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $login [ 'prenom' ] . ' ' . $login [ 'nom' ] ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mon adresse email </ td >
< td width = " 350 " class = " StyleInfoData " >< input type = " text " size = " 30 " maxlength = " 80 " name = " frmOptions[mon_email] " value = " <?= $login['email'] ?> " /></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mes num & eacute ; ros de t & eacute ; l & eacute ; phone < br />< i > ( Fixe , Fax , Mobile ) </ i ></ td >
< td width = " 350 " class = " StyleInfoData " >< input type = " text " size = " 10 " maxlength = " 15 " name = " frmOptions[tel_fix] " value = " <?= $login['tel'] ?> " />< input type = " text " size = " 10 " maxlength = " 15 " name = " frmOptions[tel_fax] " value = " <?= $login['fax'] ?> " />< input type = " text " size = " 10 " maxlength = " 15 " name = " frmOptions[tel_mob] " value = " <?= $login['mobile'] ?> " /><!--< br />< input type = " checkbox " name = " frmOptions[copie_sms] " value = " <?= $_SESSION['tabInfo'] ['copieParSms']?> " /> Recevoir une copie de mes messages de surveillance par SMS --></ td >
</ tr >
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_moteur.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > R & eacute ; sultats par page </ td >
< td width = " 350 " class = " StyleInfoData " >< select name = " frmOptions[rech_nbrep] " >
< ?
$opt [ 10 ] = $opt [ 20 ] = $opt [ 30 ] = $opt [ 50 ] = $opt [ 100 ] = $opt [ 150 ] = $opt [ 200 ] = '' ;
if ( $login [ 'nbReponses' ] == 10 ) $opt [ 10 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 20 ) $opt [ 20 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 30 ) $opt [ 30 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 50 ) $opt [ 50 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 100 ) $opt [ 100 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 150 ) $opt [ 150 ] = 'selected' ;
elseif ( $login [ 'nbReponses' ] == 200 ) $opt [ 200 ] = 'selected' ;
?> <option value="10" <?=$opt[10]?>>10</option>
< option value = " 20 " < ? = $opt [ 20 ] ?> >20</option>
< option value = " 30 " < ? = $opt [ 30 ] ?> >30</option>
< option value = " 50 " < ? = $opt [ 50 ] ?> >50</option>
< option value = " 100 " < ? = $opt [ 100 ] ?> >100</option>
< option value = " 150 " < ? = $opt [ 150 ] ?> >150</option>
< option value = " 200 " < ? = $opt [ 200 ] ?> >200</option>
</ select ></ td ></ tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Inclure </ td >
< td width = " 350 " class = " StyleInfoData " >
< input type = " checkbox " name = " frmOptions[rech_limites][] " value = " assocs " checked disabled /> les associations < br />
< input type = " checkbox " name = " frmOptions[rech_limites][] " value = " actifs " checked disabled /> les actifs < br />
< input type = " checkbox " name = " frmOptions[rech_limites][] " value = " radies " checked disabled /> les radi & eacute ; s < br />
< input type = " checkbox " name = " frmOptions[rech_limites][] " value = " sieges " checked disabled /> les & eacute ; tablissements secondaires </ td >
</ tr >
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_surveillance.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mes supports pour les alertes </ td >
< td width = " 350 " class = " StyleInfoData " >< input type = " checkbox " name = " frmOptions[alertes][] " value = " sms " disabled /> SMS < br />
< input type = " checkbox " name = " frmOptions[alertes][] " value = " fax " disabled /> Fax < br />
< input type = " checkbox " name = " frmOptions[alertes][] " value = " mail " checked disabled /> Mail < br /></ td >
</ tr >
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_droits.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mon profil </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $login [ 'profil' ] ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Pr & eacute ; f & eacute ; rences </ td >
< ?
$tabPref = array ( 'naf4' => '' ,
'news' => '' ,
'mappy' => ''
);
if ( preg_match ( '/NAF4/i' , $login [ 'pref' ])) $tabPref [ 'naf4' ] = 'checked' ;
if ( preg_match ( '/MAPPY/i' , $login [ 'pref' ])) $tabPref [ 'mappy' ] = 'checked' ;
if ( preg_match ( '/NEWS/i' , $login [ 'pref' ])) $tabPref [ 'news' ] = 'checked' ;
?>
< td width = " 350 " class = " StyleInfoData " >< input type = " checkbox " name = " frmOptions[pref][] " value = " naf4 " < ? = $tabPref [ 'naf4' ] ?> /> Afficher les anciens NAF<br/>
< input type = " checkbox " name = " frmOptions[pref][] " value = " mappy " < ? = $tabPref [ 'mappy' ] ?> /> Afficher les façades d'immeubles<br/>
< input type = " checkbox " name = " frmOptions[pref][] " value = " news " < ? = $tabPref [ 'news' ] ?> /> Afficher les news Google©<br/>
</ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mes droits </ td >
< ?
/* $init = 'disabled ' ;
if ( $_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mheitz' ) *
$init = '' ;
$tabDroits = array ( 'kbis' => $init ,
'actes' => $init ,
'marques' => $init ,
'indiscore' => $init ,
'scorecsf' => $init ,
'monprofil' => $init ,
);
if ( preg_match ( '/KBIS/i' , $login [ 'droits' ])) $tabDroits [ 'kbis' ] .= 'checked' ;
if ( preg_match ( '/ACTES/i' , $login [ 'droits' ])) $tabDroits [ 'actes' ] .= 'checked' ;
if ( preg_match ( '/MARQUES/i' , $login [ 'droits' ])) $tabDroits [ 'marques' ] .= 'checked' ;
if ( preg_match ( '/INDISCORE/i' , $login [ 'droits' ])) $tabDroits [ 'indiscore' ] .= 'checked' ;
if ( preg_match ( '/SCORECSF/i' , $login [ 'droits' ])) $tabDroits [ 'scorecsf' ] .= 'checked' ;
if ( preg_match ( '/MONPROFIL/i' , $login [ 'droits' ])) $tabDroits [ 'monprofil' ] .= 'checked' ;
?>
< td width = " 350 " class = " StyleInfoData " >
< ?
if ( $_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' || $_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mheitz' ) {
?>
< input type = " checkbox " name = " frmOptions[droits][] " value = " kbis " < ? = $tabDroits [ 'kbis' ] ?> <?if (!$admin) echo 'disabled';?> /> Extrait RCS<br/>
< ?
}
?>
< input type = " checkbox " name = " frmOptions[droits][] " value = " actes " < ? = $tabDroits [ 'actes' ] ?> <?if (!$admin) echo 'disabled';?> /> Pièces officielles<br/>
< input type = " checkbox " name = " frmOptions[droits][] " value = " marques " < ? = $tabDroits [ 'marques' ] ?> <?if (!$admin) echo 'disabled';?> /> Marques déposées<br/>
< input type = " checkbox " name = " frmOptions[droits][] " value = " indiscore " < ? = $tabDroits [ 'indiscore' ] ?> <?if (!$admin) echo 'disabled';?> /> indiScore©<br/>
< input type = " checkbox " name = " frmOptions[droits][] " value = " scorecsf " < ? = $tabDroits [ 'scorecsf' ] ?> <?if (!$admin) echo 'disabled';?> /> score CSF<br/>
< input type = " checkbox " name = " frmOptions[droits][] " value = " monprofil " < ? = $tabDroits [ 'monprofil' ] ?> <?if (!$admin) echo 'disabled';?> /> Mon profil</td>
</ tr >
< ? php
if ( $_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' || $_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mheitz' ) {
if ( $_SESSION [ 'tabInfo' ][ 'mode_edition' ] == 1 ) $strMode = 'checked' ; else $strMode = '' ;
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Mon mode actuel </ td >
< td width = " 350 " class = " StyleInfoData " >< input type = " checkbox " name = " frmOptions[mode_edition] " value = " 1 " < ? = $strMode ?> /> Edition</td>
</ tr >
< ? php
}
?>
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " align = " center " >< input type = " submit " value = " Sauver " /></ td >
</ tr >
</ form >
< ?
// print_r($_REQUEST['frmOptions']);echo '</pre>';
*/
}
?>