Esempio n. 1
0
<?php

require_once "auth.php";
require_once "../fonctions/divers.php";
if (!est_autorise("acces_configuration")) {
    exit;
}
$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
$currentProfil = new ProfilAdmin();
$currentProfil->charger_id($request->get("profil", 0));
if (!$currentProfil->id) {
    $currentProfil->chargerPermier(array(ProfilAdmin::ID_PROFIL_SUPERADMINISTRATEUR));
}
$currentProfilDesc = new Profildesc();
$currentProfilDesc->charger($currentProfil->id);
try {
    ActionsAdminProfil::getInstance()->action($request);
} catch (TheliaAdminException $e) {
    $errorCode = $e->getCode();
    if ($errorCode == TheliaAdminException::BAD_PROFILE_FORMULATION) {
        $addError = 1;
    }
}
?>
<!DOCTYPE html>
<html lang="fr">
    <head>
        <?php 
require_once "title.php";
?>
    </head>
 public function create($formulation, $name, $description)
 {
     $this->checkFormulation($formulation);
     $this->nom = $formulation;
     $this->id = $this->add();
     $profileDesc = new Profildesc();
     $profileDesc->profil = $this->id;
     $profileDesc->titre = $name;
     $profileDesc->description = $description;
     $profileDesc->lang = ActionsLang::instance()->get_id_langue_courante();
     $profileDesc->id = $profileDesc->add();
     redirige("droits.php?profil=" . $this->id);
 }