271 lines
11 KiB
PHP
271 lines
11 KiB
PHP
<?php
|
|
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
|
|
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1;
|
|
|
|
if (!$_SESSION['connected'])
|
|
echo ('Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité');
|
|
elseif ($_SESSION['tabInfo']['profil']<>'Administrateur' && !preg_match('/MONPROFIL/i', $_SESSION['tabInfo']['droits'])) {
|
|
echo ('Vous n\'avez pas les droits nécessaires pour utiliser cette fonctionnalité ('.$_SESSION['tabInfo']['profil'].' '.$_SESSION['tabInfo']['droits'].')');
|
|
}
|
|
else {
|
|
$tabInfo = $_SESSION['tabInfo'];
|
|
$message='';
|
|
|
|
if (isset($_REQUEST['login']) && $_REQUEST['login']<>'' && $_REQUEST['login']<>$_SESSION['tabInfo']['login'] && $_SESSION['tabInfo']['profil']=='Administrateur')
|
|
$loginVu=$_REQUEST['login'];
|
|
elseif ($tabOptions['action']=='new')
|
|
$loginVu=$tabOptions['login'];
|
|
else
|
|
$loginVu=$_SESSION['tabInfo']['login'];
|
|
|
|
if ($tabOptions['action']=='save' || $tabOptions['action']=='new') {
|
|
$message='Erreur lors de la mise à jour du compte !';
|
|
|
|
$tabOptions['nom']=preg_replace('/[^0-9A-Z\'-]/i', ' ', strtoupper(strtr(stripslashes($tabOptions['nom']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
|
|
$tabOptions['prenom']=ucwords(strtolower(preg_replace('/[^0-9A-Z\'-]/i', ' ', strtoupper(strtr(stripslashes($tabOptions['prenom']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')))));
|
|
$tabOptions['reference']=preg_replace('/[^0-9A-Z\'-]/i', ' ', strtoupper(strtr(stripslashes($tabOptions['reference']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
|
|
|
|
try {
|
|
$O = $client->setInfosLogin($loginVu, $tabOptions);
|
|
if ($O['result']==1) $message='Compte mis à jour !';
|
|
} catch (SoapFault $fault) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
$message='Erreur SOAP lors de la mise à jour du compte !';
|
|
}
|
|
|
|
if ($_REQUEST['referer']=='administration') {
|
|
?>
|
|
<script language="javascript">
|
|
alert("Le profil <?=$loginVu?> a été mis à jour !");
|
|
document.location.href='/?page=administration&id=<?=$idEntreprise?>&siret=<?=$siret?>';
|
|
</script>
|
|
<?php
|
|
}
|
|
|
|
if ($_REQUEST['frmOptions']['changepwd']==1 && $loginVu==$_SESSION['tabInfo']['login'] && $tabOptions['action']=='save' ) {
|
|
?>
|
|
<script language="javascript">
|
|
alert("La modification de votre mot de passe nécessite votre déconnexion !");
|
|
document.location.href='/?page=main&action=logout';
|
|
</script>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
/** Utilisation du WS **/
|
|
try {
|
|
if ($_REQUEST['action']<>'new') {
|
|
$O = $client->getInfosLogin($loginVu);
|
|
$login=$O['result'];
|
|
} else {
|
|
$O = $client->getNextLogin($loginVu);
|
|
$loginNew=$O['result']['racine'];
|
|
$idClient=$O['result']['idClient'];
|
|
}
|
|
} catch (SoapFault $fault) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
die();
|
|
}
|
|
|
|
$admin = false;
|
|
if ($_SESSION['tabInfo']['profil']=='Administrateur') $admin = true;
|
|
|
|
?>
|
|
<style type="text/css">
|
|
table {border-collapse:collapse;}
|
|
.bottom td {border-bottom:1px solid;}
|
|
</style>
|
|
<form name="form_moncompte" action="./?page=moncompte" method="POST" enctype="multipart/form-data">
|
|
<? if ($_REQUEST['action']=='new') { ?>
|
|
<input type="hidden" name="frmOptions[action]" value="new"/>
|
|
<? } else { ?>
|
|
<input type="hidden" name="frmOptions[action]" value="save"/>
|
|
<? } ?>
|
|
<input type="hidden" name="siret" value="<?=$siret?>"/>
|
|
<input type="hidden" name="id" value="<?=$idEntreprise?>"/>
|
|
<input type="hidden" name="login" value="<?=$loginVu?>"/>
|
|
<input type="hidden" name="frmOptions[idClient]" value="<?=$idClient?>"/>
|
|
<input type="hidden" name="referer" value="<?=$_REQUEST['referer']?>"/>
|
|
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
|
|
<?
|
|
if ($message<>'') {
|
|
?>
|
|
<tr>
|
|
<td width="30"> </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"> </td>
|
|
<td width="200" class="StyleInfoLib">Identifiant utilisateur</td>
|
|
<? if ($_REQUEST['action']<>'new') { ?>
|
|
<td width="350" class="StyleInfoData"><?=$loginVu?></td>
|
|
<? } else { ?>
|
|
<td width="350" class="StyleInfoData"><input type="text" size="20" maxlength="80" name="frmOptions[login]" value="<?=$loginNew?>"/></td>
|
|
<? } ?>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Identité (NOM/Prénom)</td>
|
|
<? if ($admin) { ?>
|
|
<td width="350" class="StyleInfoData"><input type="text" size="20" maxlength="80" name="frmOptions[nom]" value="<?=$login['nom']?>"/> <input type="text" size="20" maxlength="80" name="frmOptions[prenom]" value="<?=$login['prenom']?>"/></td>
|
|
<? } else { ?>
|
|
<td width="350" class="StyleInfoData"><?=$login['nom'].' '.$login['prenom']?></td>
|
|
<? } ?>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Réf. facturation (service, etc...)</td>
|
|
<? if ($admin) { ?>
|
|
<td width="350" class="StyleInfoData"><input type="text" size="20" maxlength="80" name="frmOptions[reference]" value="<?=$login['reference']?>"/></td>
|
|
<? } else { ?>
|
|
<td width="350" class="StyleInfoData"><?=$login['reference']?></td>
|
|
<? } ?>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Adresse e-mail</td>
|
|
<td width="350" class="StyleInfoData"><input type="text" size="30" maxlength="80" name="frmOptions[email]" value="<?=$login['email']?>"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Numéros de télé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 width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Mot de passe</td>
|
|
<td width="350" class="StyleInfoData"><input type="password" size="15" maxlength="32" name="frmOptions[password]" value="oqsrihgwslglm" onkeypress="document.form_moncompte.changepwd.checked=1"/> <input name="frmOptions[changepwd]" id="changepwd" type="checkbox" value="1"/> Réinitialiser le mot de passe</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><img src="./img/srub_moteur.png" width="576" height="27"></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Ré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>
|
|
<tr>
|
|
<td width="30"> </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és<br/>
|
|
<input type="checkbox" name="frmOptions[rech_limites][]" value="sieges" checked disabled/> les établissements secondaires</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><img src="./img/srub_surveillance.png" width="576" height="27"></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">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>
|
|
<?php
|
|
if ($_SESSION['tabInfo']['login']=='ylenaour') {
|
|
$formatMail=$login['formatMail'];
|
|
?>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Format des emails</td>
|
|
<td width="350" class="StyleInfoData"><select name="frmOptions[formatMail]">
|
|
<optgroup label="Sans pièce jointe">
|
|
<option value="txt1" <?if($formatMail=='txt1') echo 'selected';?>>1 annonce/mail en texte</option>
|
|
<option value="txt2" <?if($formatMail=='txt2') echo 'selected';?>>1 mail/jour en texte</option>
|
|
<!--<option value="htm1" <?if($formatMail=='htm1') echo 'selected';?>>Mail format Html</option>-->
|
|
</optgroup>
|
|
<optgroup label="Avec pièce jointe">
|
|
<!--<option value="pdf" <?if($formatMail=='pdf') echo 'selected';?>>Pdf en pièce jointe</option>-->
|
|
<option value="pdf1" <?if($formatMail=='pdf1') echo 'selected';?>>Pdf (1 annonce/page)</option>
|
|
<!--<option value="csv" <?if($formatMail=='csv') echo 'selected';?>>Pièce jointe CSV</option>-->
|
|
<option value="xls" <?if($formatMail=='xls') echo 'selected';?>>Pièce jointe Excel</option>
|
|
</optgroup>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><img src="./img/srub_droits.png" width="576" height="27"></td>
|
|
</tr>
|
|
<tr class="bottom">
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Type de profil</td>
|
|
<td width="350" class="StyleInfoData"><?=$login['profil']?></td>
|
|
</tr>
|
|
<tr class="bottom">
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Préférences</td>
|
|
<td width="350" class="StyleInfoData">
|
|
<?php
|
|
require_once 'user/user.php';
|
|
print formElementPref($login);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Droits d'accès</td>
|
|
<td width="350" class="StyleInfoData">
|
|
<?php print formElementPerm($login); ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
if(checkModeEdition($loginVu)){?>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="200" class="StyleInfoLib">Mode actuel</td>
|
|
<td width="350" class="StyleInfoData"><?=formElementModeEdition()?></td>
|
|
</tr>
|
|
<?php } ?>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" align="center"><input type="submit" value="Sauver"/></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<?php
|
|
}
|
|
?>
|