Exemplo n.º 1
0
     about_ppr();
     break;
 case "display_nouvelingenieur":
     about_nouvelingenieur();
     break;
 case "login":
     log_in();
     break;
 case "logout":
     log_out();
     break;
 case "create_account":
     create_account();
     break;
 case "confirm_subscribe":
     validate_account();
     break;
 case "change_pass":
     change_password(false);
     break;
 case "lost_ids":
     change_password(true);
     break;
 case "delete_account":
     if (isset($_SESSION["delete_account_state"]) && $_SESSION["delete_account_state"] == "display") {
         $_SESSION["delete_account_state"] = "execute";
         // Une fois réaffiché, on repasse en mode "exécution"
         if (isset($_SESSION["delete_account_display"])) {
             echo $_SESSION["delete_account_display"];
             // Affichage;
             unset($_SESSION["delete_account_display"]);
Exemplo n.º 2
0
/** Add Supermaster
 *
 * Add a trusted supermaster to the global supermasters table
 *
 * @param string $master_ip Supermaster IP address
 * @param string $ns_name Hostname of supermasterfound in NS records for domain
 * @param string $account Account name used for tracking
 *
 * @return boolean true on success
 */
function add_supermaster($master_ip, $ns_name, $account)
{
    global $db;
    if (!is_valid_ipv4($master_ip) && !is_valid_ipv6($master_ip)) {
        error(ERR_DNS_IP);
        return false;
    }
    if (!is_valid_hostname_fqdn($ns_name, 0)) {
        error(ERR_DNS_HOSTNAME);
        return false;
    }
    if (!validate_account($account)) {
        error(sprintf(ERR_INV_ARGC, "add_supermaster", "given account name is invalid (alpha chars only)"));
        return false;
    }
    if (supermaster_ip_name_exists($master_ip, $ns_name)) {
        error(ERR_SM_EXISTS);
        return false;
    } else {
        $db->query("INSERT INTO supermasters VALUES (" . $db->quote($master_ip, 'text') . ", " . $db->quote($ns_name, 'text') . ", " . $db->quote($account, 'text') . ")");
        return true;
    }
}