Beispiel #1
0
function modifTitreFil($modo)
{
    $reponse = array('statut' => 'ok');
    $texte = convertDataSent($_REQUEST['titre']);
    $idFil = convertDataSent($_REQUEST['idFil']);
    $intrusion = Securisator::checkIntrusion($texte);
    if ($intrusion) {
        $reponse = array('statut' => 'intrusion');
    } else {
        $arch = new Archiviste();
        $fil = new Fil();
        $fil->set('id', $idFil);
        $fils = $arch->restituer($fil);
        if (count($fils) > 0 && ($fils[0]->get('idUser') == $_SESSION['id'] || $modo)) {
            $newTitre = new Fil();
            $newTitre->set('nom', $texte);
            $arch->modifier($fil, $newTitre);
        } else {
            $reponse = array('statut' => 'nok');
        }
    }
    return $reponse;
}
Beispiel #2
0
function majProfil(&$vueForum)
{
    $auth = new Auth();
    $user = $auth->infoUser();
    if ($user) {
        $traitementOk = true;
        $message = '';
        $arch = new Archiviste();
        $userMAJ = new User();
        //recuperation de la requete
        $urlAvatar = '';
        $signature = '';
        if (isset($_REQUEST['urlAvatar']) && !Securisator::checkIntrusion($_REQUEST['urlAvatar'])) {
            $urlAvatar = $_REQUEST['urlAvatar'];
        }
        if (isset($_REQUEST['signature']) && !Securisator::checkIntrusion($_REQUEST['signature'])) {
            $signature = $_REQUEST['signature'];
        }
        if (isset($_REQUEST['notifMP'])) {
            $userMAJ->set('notifMP', 'x');
        } else {
            $userMAJ->set('notifMP', 'n');
        }
        if ($urlAvatar) {
            $userMAJ->set('avatar', $urlAvatar);
        }
        if ($signature) {
            $userMAJ->set('sign', $signature);
        }
        $arch->modifier($user, $userMAJ);
        $message = '<div class="alert alert-success" role="alert">Mise a jour effectuée.</div>';
        $ariane = '
		<ol class="breadcrumb">
		  <li><a href="./?mod=forum"> Forum </a></li>
		  <li>Profil</li>
		</ol>';
        $vueForum->setBreadCrumb($ariane);
        $user = $auth->infoUser();
        $vueForum->pageProfil($user, $message);
    }
}