예제 #1
0
function fDesinscription($motdepasse)
{
    require 'source.php';
    $charset = $bdd->query('SET NAMES UTF8');
    if (fConnexion(fUtilisateur("Pseudo"), $motdepasse) > 0) {
        $liste = fAffichersiteutilisateur();
        foreach ($liste as $key => $value) {
            $nom = substr($value['FQDN'], 0, -19);
            $commande = "scripts/script_pwhost.sh 2 " . fUtilisateur("Pseudo") . " " . $nom;
            exec($commande);
        }
        $requete = $bdd->prepare('DELETE FROM postwork.utilisateur WHERE IdUtilisateur =?');
        $requete->execute(array($_SESSION['IdUtilisateur']));
        $commande = "scripts/script_pwuser.sh 2 " . $pseudo . " " . $motdepasse;
        exec($commande);
        session_destroy();
        header("Location: index.php?page=deconnexion");
        return 1;
    } else {
        return $_SESSION['erreur'];
    }
}
예제 #2
0
            if (isset($_POST['ip']) === true) {
                fCreerfqdn($_POST['nom'], $_POST['ip']);
            } else {
                fCreerprojet($_POST['nom'], $globals['ippostwork']);
            }
        } else {
            $_SESSION['erreur'] = "Nom vide.";
        }
        break;
    case 'activation':
        fVhost($_POST['statussite']);
        break;
    case 'bdd':
        fBdd($_POST['statusbdd']);
        break;
    case 'suppression':
        fSupprimersite($_POST['site']);
        break;
}
$mail = fUtilisateur("StatusMail");
$pseudo = fUtilisateur("Pseudo");
$liste = fAffichersiteutilisateur();
foreach ($liste as $key => $value) {
    if ($value['Portfolio'] == 0 and $value['IP'] == $globals['ippostwork']) {
        $projet[] = $value;
    } elseif ($value['Portfolio'] == 1) {
        $portfolio[] = $value;
    } elseif ($value['IP'] != $globals['ippostwork']) {
        $fqdn[] = $value;
    }
}