function update_domain($domain, $ns1, $ns2, $ns1_ip, $ns2_ip) { global $TLD, $tld_db; show_header(); $updated = strftime('%Y-%m-%d'); $userid = $_SESSION['userid']; $base = database_open_now($tld_db, 0666); $query = "SELECT userid FROM domains WHERE userid='" . $userid . "' AND domain='" . $domain . "' LIMIT 1"; $results = database_query_now($base, $query); $arr = database_fetch_array_now($results); $real_userid = $arr['userid']; if ($userid != $real_userid) { echo "<font color=\"#ff0000\"><b>Error: You do not have permission to modify this domain.</b></font>"; die; } echo "Updating " . $domain . '.' . $TLD . "..."; if ($ns1_ip != "NULL" && $ns2_ip != "NULL") { if (!validateIPAddress($ns1_ip) && !validateIPAddress($ns2_ip)) { echo "Error. NS1 and NS2 custom nameservers must be IP addresses."; } else { $query = "UPDATE domains SET ns1='" . $ns1 . "', ns2='" . $ns2 . "', ns1_ip='" . $ns1_ip . "', ns2_ip='" . $ns2_ip . "', updated='" . $updated . "' WHERE domain='" . $domain . "'"; } } else { $query = "UPDATE domains SET ns1='" . $ns1 . "', ns2='" . $ns2 . "', updated='" . $updated . "' WHERE domain='" . $domain . "'"; } database_query_now($base, $query); echo "Done. The changes should take effect within the hour. Please be aware some networks may not see the changes for up to 72 hours.<BR>"; if ($ns1 == $ns2) { echo "<b>Please Note:</b> We highly recommend that you use two different nameserver values instead of the same one."; } }
function confirm_user($username) { global $tld_db; $base = database_open_now($tld_db, 0666); $query = "UPDATE users SET verified=1 WHERE username='******'"; database_query_now($base, $query); }
function update_account($country, $password) { global $tld_db; show_header(); if (!isset($_SESSION['userid'])) { echo "No valid account."; die; } $userid = $_SESSION['userid']; $password = htmlspecialchars(stripslashes($password)); $real_password = hash('sha256', $password); $query = "UPDATE users SET country='" . $country . "', password='******' WHERE userid='" . $userid . "'"; $base = database_open_now($tld_db, 0666); database_query_now($base, $query); echo "Details updated."; }
function dashboard() { global $TLD, $domain_expires, $tld_db, $user_table; show_header(); $username = $_SESSION['username']; $userid = $_SESSION['userid']; // echo "<p align=\"right\"><a href=\"user.php?action=logout\">Logout</a></p>\n"; echo "<center><H2>Welcome to " . $username . "'s Dashboard for ." . $TLD . "</H2>\n"; echo "<b>My ." . $TLD . " domains</b><BR><BR>"; $base = database_open_now($tld_db, 0666); $query = "SELECT domain, registered, expires FROM domains WHERE userid=" . $userid . ""; $results = database_query_now($base, $query); if (dbNumRows($results)) { echo "<table width=\"400\" align=\"center\" border=0 cellspacing=1 cellpadding=0>\n"; echo "<tr><td>Domain Name</td><td>Created</td>"; if ($domain_expires == 1) { echo "<td>Expires</td>"; } echo "</tr>\n"; while ($arr = database_fetch_array_now($results)) { echo "<tr><td><a href=\"domain.php?action=modify&domain=" . $arr['domain'] . "\">" . $arr['domain'] . '.' . $TLD . "</a></td><td>" . $arr['registered'] . "</td>"; if ($domain_expires == 1) { echo "<td>" . $arr['expires'] . "</td>"; } echo "</tr>\n"; } echo "</table>\n"; } else { echo "You do not have any domains registered.\n"; } echo "You can register a new " . $TLD . " <a href=\"domain.php?action=frm_check_domain\">here</a>."; $get_user_details = "SELECT email, pgpkey FROM users WHERE userid='" . $userid . "' AND username='******' LIMIT 1"; $base = database_open_now($tld_db, 0666); $get_user_details_results = database_query_now($base, $get_user_details); $get_user_details_arr = database_fetch_array_now($get_user_details_results); #$name=$get_user_details_arr['name']; #$get_user_details_arr=databse_pdo_query("SELECT email, pgpkey FROM $user_table WHERE userid='$userid' AND username='******' LIMIT 1"; $email = $get_user_details_arr['email']; #$country=$get_user_details_arr['country']; $pgpkey = $get_user_details_arr['pgpkey']; ?> <BR><BR> <form action="user.php" method="post"> <table width="450" align="center"> <tr><td colspan="2" align="center"><b>.<?php echo $TLD; ?> User Details</b></td></tr> <tr><td>Email</td><td><?php echo $email; ?> <sup>*</sup></td></tr> <tr><td>Current Password</td><td><input type="password" name="password"></td></tr> <tr><td valign="top">Password</td><td><input type="password" name="password1"><BR><font size="-1">(Must be at least 5 characters long)</font></td></tr> <tr><td>Password Confirm</td><td><input type="password" name="password2"></td></tr> <tr><td>PGP Key*</td><td><textarea rows="40" cols="85" name="pgpkey" wrap="physical"><?php echo $pgpkey; ?> </textarea></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="submit" value="Update"></td></tr> <input type="hidden" name="action" value="update_account"> <tr><td colspan="2"> <font size="-1"> <sup>*</sup>Please contact support to change this.<BR> <sup>**</sup>This is optional and for our statistics only. </font></td></tr> </table> </form> <?php echo "</center>"; }