⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 主要是提供域名查询功能的主程序 PHP源代码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
					switch($page)
					{
						case "goLogout" :
							$this->USER->logout();
							$this->navigate();
						break;

						case "goModifyConfig" :
							$this->ModifyConfig($_POST);
							$this->page_Message("Settings Updated", "Your settings have been updated.");
						break;

						case "goRemoveConfig" :
							$this->RemoveConfig($_POST);
							$this->page_Message("Configuration Removed", "Your settings have been updated.");
						break;

						case "goAddNameserver" :
							$this->AddNameserver($_POST);
							$this->page_Message("Nameserver Added", "Your settings have been updated.");
						break;

						case "goModifyTLDPrices" :
							$this->ModifyTLDPrices($_POST);
							$this->page_Message("TLD Prices Updated", "Your settings have been updated.");
						break;

						case "AdminSettings" :
							$this->page_AdminSettings();
						break;

						case "ScriptSettings" :
							$this->page_ScriptSettings();
						break;

						case "BuyModeSettings" :
							$this->page_BuyModeSettings();
						break;

						case "TLDSettings" : 
							$this->page_TLDSettings();
						break;

						case "AddNameserver" :
							$this->page_AddNameserver();
						break;

						case "NameserverSettings" :
							$this->page_NameserverSettings();
						break;

						case "DeleteNameserver" :
							$this->page_DeleteNameserver();
						break;

						case "TemplateSettings" :
							$this->page_TemplateSettings();
						break;

						case "ErrorSettings" :
							$this->page_ErrorSettings();
						break;

						case "CheckForUpdate" :
							$this->page_CheckForUpdate();
						break;

						case "NSValidator" :
							$this->page_Nameserver_Validator();
						break;

						case "goValidateNameserver" :
							$this->ValidateNameserver($_REQUEST);
						break;

						default :
							$this->page_Main();
					}
				}
		}
	}



	/* ------------------------------------------------------------------ */
	//	Login Page
	//	If specified, will fill in username and password input with given
	//	parameters.
	/* ------------------------------------------------------------------ */
	
	function page_Login($default_username="", $default_password="")
	{
		// start form
		$content .= $this->DISPLAY->constructStartForm("goLogin", "ADMIN_login_form");

		if (!empty($default_username))
			$content .= "<div align='center'>" . $this->DISPLAY->constructOutput("Click Login to begin!") . "</div>";

		$content .= "<br>";

		$content .= "<div align='center'><table>\n";
		
		$content .= "<tr>\n<td align='center'>" . $this->DISPLAY->constructOutput("Username: <input type='text' name='username' value='{$default_username}'>") . "</td>\n</tr>\n";
		$content .= "<tr>\n<td align='center'>" . $this->DISPLAY->constructOutput("Password: <input type='password' name='password' value='{$default_password}'>") . "</td>\n</tr>\n";

		$content .= "</table><div>\n";

		$content .= $this->DISPLAY->constructOutput("<a href='#' onClick=\"window.open('?page=FAQ&amp;topic=1&amp;small=1', 'feature_window', 'toolbar=no,status=no,height=300,width=475,resizable=yes,scrollbars=yes,top=100,left=100');\">Forgot your password?</a>");

		$content .= "<br>";

		// end form
		$content .= "<div align='center'>" . $this->DISPLAY->constructEndForm("Login") . "</div>";

		$content .= "<br>";

		if (!empty($default_username))
			$content .= "<div align='center'>" . $this->DISPLAY->constructOutput("NOTE: The default username is admin and the default password is blank (empty).") . "</div>";

		$this->DISPLAY->displayPage($content, "EP-Dev Whois Login");
	}



	/* ------------------------------------------------------------------ */
	//	Script Update Page
	//	Checks to see if script is up-to-date.
	/* ------------------------------------------------------------------ */
	
	function page_CheckForUpdate()
	{
		$update_info = $this->CheckUpdate();
		if ($update_info['version_available'])
		{
			$message = $this->DISPLAY->constructOutput("A new update, version {$update_info['version_current']}, is available for download from <a href='{$update_info['download_url']}' target='_blank'>EP-Dev.com</a>. Details can be found below:<br>");
			
			if ($update_info['recommend'])
			{
				$message .= $this->DISPLAY->constructOutput("<font color='red'>Warning: The version of the script you are running, {$update_info['version_user']}, is at least two versions old. Please update as soon as possible.</font>");
			}

			if (!empty($update_info['download_url']))
			{
				$message .= "<br>";

				$message .= $this->DISPLAY->constructOutput("You can download the new version from <a href='{$update_info['download_url']}' target='_blank'>EP-Dev.com</a>.");
			}

			if (count($update_info['version_recent']) != 0)
			{
				$message .= "<br><strong>Bug Fixes and Features in new version:</strong>";
			}

			for($i=0; $i<count($update_info['version_recent']); $i++)
			{
				$message .= $this->DISPLAY->constructOutput("<i>Version {$update_info['version_recent'][$i]['number']}</i><br>{$update_info['version_recent'][$i]['description']}") . "<br>";
			}
		}
		else
		{
			$message = $this->DISPLAY->constructOutput("No new updates are available. Your script is up-to-date.");
		}

		$message .= "<br>\n" . $this->DISPLAY->constructOutput("Your current script version is " . $this->CONFIG->SCRIPT['version']);

		$this->DISPLAY->displayPage($message, ($update_info['version_available'] ? "<font color='red'>Update Available!</font>" : "No Update Available"));
	}



	/* ------------------------------------------------------------------ */
	//	Check Update
	//	Returns script info pulled from EP-Dev.com server.
	//	returns array:	string ['ver'] = version number from server.
	//					boolean ['new'] = script status (true = up-to-date)
	/* ------------------------------------------------------------------ */
	
	function CheckUpdate()
	{
		// +------------------------------
		//	Connect to EP-Dev and check for Update.
		// +------------------------------

		$referrer = "http://" . $_SERVER['HTTP_HOST'] . str_replace("whois/admin/index.php" , "", $_SERVER['PHP_SELF']);
		
		$cur_version = $this->CONFIG->SCRIPT['version'];
		$file = @file_get_contents("http://www.ep-dev.com/update/check.php?name=ep-dev-whois&version={$cur_version}&referrer={$referrer}");
		if ($file === false)
		{
			$version_info['success'] = false;
			$version_info['version_available'] = false;
		}
		else
		{
			$version_info = unserialize($file);
			$version_info['success'] = true;
			$version_info['version_available'] = ($version_info['version_current'] != $cur_version);
		}

		return $version_info;
	}



	/* ------------------------------------------------------------------ */
	//	FAQ Page
	//	If set, $_GET['topic'] will force single topic display.
	//	Else, all will be displayed in FAQ manner.
	/* ------------------------------------------------------------------ */
	
	function page_FAQ()
	{
		// get proper FAQ code, 0 = display all (default)
		$faq_code = (isset($_GET['topic']) ? $_GET['topic'] : 0);
		$small_display = ($_GET['small'] == "1");

		// +------------------------------
		//	Format questions / answers (General)
		// +------------------------------

		$questions[] = "I forgot my username and password to the admin section. How can I change them manually?";
		$answers[] = "Open up config/config.php and edit the <font color='#0000FF'>\$this->ADMIN['username']</font> and <font color='#0000FF'>\$this->ADMIN['password']</font> values.";


		$questions[] = "What tags can be used for logging?";
		$answers[] = "The following tags can be used in the log filename and logging formats:<br>
		<font color='#0000FF'>[[MONTH]]</font> - 3 letter month<br>
		<font color='#0000FF'>[[DAY]]</font> - Day number of month.<br>
		<font color='#0000FF'>[[YEAR]]</font> - four number year (ex: 2005).<br>
		<font color='#0000FF'>[[TIME]]</font> - Number of seconds since Unix equinox.<br>
		<font color='#0000FF'>[[DOMAIN]]</font> - The domain of the query being logged.<br>
		<font color='#0000FF'>[[EXT]]</font> - The extension of the query being logged.<br>
		<font color='#0000FF'>[[IP]]</font> - The IP of the query being logged.";


		$questions[] = "How do I configure the price format option?";
		$answers[] = "The price format of <font color='#0000FF'>Buy Mode Settings</font> can accept many different values.<br>
		Acceptable formats are:<br>
		<font color='#0000FF'>us</font> - Will display 9.95 as $9.95<br>
		<font color='#0000FF'>uk</font> - Will display 9.95 as 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -