コード例 #1
0
ファイル: nav.php プロジェクト: jeremy-cayrasso/dtc
<?php

if (isset($_REQUEST["gen_named_files"]) && $_REQUEST["gen_named_files"] == 1) {
    named_generate();
    $console .= _("Named conf files generated !");
    $console .= "\n";
}
// Executes the command liste bellow
if (isset($_REQUEST["gen_perso_vhost"]) && $_REQUEST["gen_perso_vhost"] == 1) {
    perso_vhost_generate();
    $console .= _("Apache vhost file for personal account generated !");
    $console .= "\n";
}
if (isset($_REQUEST["gen_pro_vhost"]) && $_REQUEST["gen_pro_vhost"] == 1) {
    pro_vhost_generate();
    $console .= _("Apache vhost file generated !");
    $console .= "\n";
}
if (isset($_REQUEST["gen_email_account"]) && $_REQUEST["gen_email_account"] == 1) {
    mail_account_generate();
    $console .= _("Email user and domain files generated !");
    $console .= "\n";
}
if (isset($_REQUEST["gen_backup_script"]) && $_REQUEST["gen_backup_script"] == 1) {
    backup_script_generate();
    $console .= _("Backup script generated !");
    $console .= "\n";
}
if (isset($_REQUEST["gen_stat_script"]) && $_REQUEST["gen_stat_script"] == 1) {
    stat_script_generate();
    $console .= _("Stat script generated !");
コード例 #2
0
ファイル: cron.php プロジェクト: jeremy-cayrasso/dtc
function checkNamedCronService()
{
    global $conf_generated_file_path;
    global $conf_dtc_system_username;
    global $conf_dtc_system_groupname;
    global $keep_dns_generate_flag;
    $cronjob_table_content = getCronFlags();
    ///////////////////////////////////////////////////////
    // First, see if we have to regenerate deamons files //
    ///////////////////////////////////////////////////////
    if ($cronjob_table_content["gen_named"] == "yes" || $cronjob_table_content["gen_reverse"] == "yes") {
        echo "Generating Named zonefile ... this may take a while\n";
        named_generate();
        system("chgrp {$conf_dtc_system_groupname} {$conf_generated_file_path}/named.conf {$conf_generated_file_path}/named.slavezones.conf");
        system("chmod 770 {$conf_generated_file_path}/named.conf {$conf_generated_file_path}/named.slavezones.conf");
        system("chgrp -R {$conf_dtc_system_groupname} \"{$conf_generated_file_path}/zones\"");
        system("chmod 770 \"{$conf_generated_file_path}/zones\"");
        system("./checkbind.sh {$conf_generated_file_path}");
        if ($keep_dns_generate_flag == "no") {
            markCronflagOk("gen_named='no'");
        }
    }
    if ($cronjob_table_content["reload_named"] == "yes") {
        echo "Reloading name-server\n";
        if (system("pgrep named") != "") {
            if (file_exists("/usr/sbin/rndc")) {
                system("/usr/sbin/rndc reload");
            } else {
                system("killall -HUP named");
            }
            if ($keep_dns_generate_flag == "no") {
                markCronflagOk("reload_named='no'");
            }
        } else {
            echo "named NOT RUNNING\n";
            if (system("uname -s") == "FreeBSD") {
                system("/etc/rc.d/named start");
            }
        }
    }
}