コード例 #1
0
ファイル: domaine.php プロジェクト: Evolix/evoadmin-mail
/**
 * PHP cookies session
 */
session_name('EVOADMIN_SESS');
session_start();
if (isset($_SESSION['login'])) {
    /**
     * Requires
     */
    require_once EVOADMIN_BASE . 'common.php';
    // $login var need for debut.php
    $login = $_SESSION['login'];
    include EVOADMIN_BASE . 'haut.php';
    include EVOADMIN_BASE . 'inc/add.js';
    include EVOADMIN_BASE . 'debut.php';
    if (!superadmin($login) || $conf['domaines']['driver'] != 'ldap') {
        print "<p class='error'>Vous n'avez pas les droits pour cette page</p>";
        EvoLog::log("Access denied on domaine.php");
        include EVOADMIN_BASE . 'fin.php';
        exit(1);
    }
    // Supprimer un domaine
    if (isset($_GET['del'])) {
        $domain = Html::clean($_GET['del']);
        if (isset($_GET['modif']) && $_GET['modif'] == 'yes') {
            print "<center>";
            print "<p>Suppression {$domain} en cours...</p>";
            // TODO : Verifier que l'objet existe avant sa suppression
            //$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN,LDAP_ADMIN_PASS);
            //$sr = Ldap::lda_del($ldapconn,"domain=" .$domain. "," .$rdn);
            if ($sr) {
コード例 #2
0
ファイル: superadmin.php プロジェクト: Evolix/evoadmin-mail
session_name('EVOADMIN_SESS');
session_start();
if (isset($_SESSION['login'])) {
    /**
     * Requires
     */
    require_once EVOADMIN_BASE . 'common.php';
    include EVOADMIN_BASE . 'haut.php';
    $login = $_SESSION['login'];
    // pas de domaine/variable domaine sur superadmin.php
    unset($_SESSION['domain']);
    global $conf;
    // array with all domains with rights on
    $domaines = array();
    // If you are superadmin, you view all domains
    if (superadmin($login)) {
        // driver 'ldap'
        if ($conf['domaines']['driver'] == 'ldap') {
            //TODO: foreach LDAP serveurs
            if ($conf['evoadmin']['cluster']) {
                $ldapconns = array();
                foreach ($ldap_servers as $server) {
                    array_push($ldapconns, Ldap::lda_connect(LDAP_ADMIN_DN, LDAP_ADMIN_PASS));
                }
            } else {
                $ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN, LDAP_ADMIN_PASS);
            }
            if ($ldapconn) {
                // compatibilite anciens schemas
                if ($conf['evoadmin']['version'] == 1) {
                    $filter = "(objectClass=ldapDomain)";