[問題]是否有自動偵訊”有效信箱”才可註冊外掛

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

oscerropper 寫:心靈補手


該不會是有東西衝到還是?還是有什麼還要再改?

我剛又再一次重安裝,且也執行了”lev_mod_db_setup.php”,也將”live_email_validation”改為”1”,不過就是沒有效?

---------------------------------

我已經測試過,麻煩請您幫我刪掉帳號 8-) dannyowan
歡迎您加入我的論壇! :-D
您還沒有啟動該帳號, 我會保留它至少一個星期.

如果方便的話, 您可以貼出修正過的 includes/functions_validate.php 嗎?
因為我查看安裝說明, 似乎只有它, 最有可能影響該外掛的功能而已.
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
oscerropper
星球公民
星球公民
文章: 197
註冊時間: 2004-12-21 17:56
來自: 興趣的黑洞

文章 oscerropper »

嗯我開啟帳號了:p

好熱鬧的論壇 8-)

代碼: 選擇全部

<?php
/***************************************************************************
 *                          functions_validate.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: functions_validate.php,v 1.6.2.12 2003/06/09 19:13:05 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

//
// Check to see if the username has been taken, or if it is disallowed.
// Also checks if it includes the " character, which we don't allow in usernames.
// Used for registering, changing names, and posting anonymously with a username
//
function validate_username($username)
{
	global $db, $lang, $userdata;

	// Remove doubled up spaces
	$username = preg_replace('#\s+#', ' ', $username); 
	// Limit username length
	$username = substr(str_replace("\'", "'", $username), 0, 25);
	$username = str_replace("'", "''", $username);

	$sql = "SELECT username 
		FROM " . USERS_TABLE . " 
		WHERE LOWER(username) = '" . strtolower($username) . "'";
	if ($result = $db->sql_query($sql))
	{
		if ($row = $db->sql_fetchrow($result))
		{
			if (($userdata['session_logged_in'] && $row['username'] != $userdata['username']) || !$userdata['session_logged_in'])
			{
				$db->sql_freeresult($result);
				return array('error' => true, 'error_msg' => $lang['Username_taken']);
			}
		}
	}
	$db->sql_freeresult($result);

	$sql = "SELECT group_name
		FROM " . GROUPS_TABLE . " 
		WHERE LOWER(group_name) = '" . strtolower($username) . "'";
	if ($result = $db->sql_query($sql))
	{
		if ($row = $db->sql_fetchrow($result))
		{
			$db->sql_freeresult($result);
			return array('error' => true, 'error_msg' => $lang['Username_taken']);
		}
	}
	$db->sql_freeresult($result);

	$sql = "SELECT disallow_username
		FROM " . DISALLOW_TABLE;
	if ($result = $db->sql_query($sql))
	{
		if ($row = $db->sql_fetchrow($result))
		{
			do
			{
				if (preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['disallow_username'], '#')) . ")\b#i", $username))
				{
					$db->sql_freeresult($result);
					return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
				}
			}
			while($row = $db->sql_fetchrow($result));
		}
	}
	$db->sql_freeresult($result);

	$sql = "SELECT word 
		FROM  " . WORDS_TABLE;
	if ($result = $db->sql_query($sql))
	{
		if ($row = $db->sql_fetchrow($result))
		{
			do
			{
				if (preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['word'], '#')) . ")\b#i", $username))
				{
					$db->sql_freeresult($result);
					return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
				}
			}
			while ($row = $db->sql_fetchrow($result));
		}
	}
	$db->sql_freeresult($result);

	// Don't allow " and ALT-255 in username.
	if (strstr($username, '"') || strstr($username, '"') || strstr($username, chr(160)))
	{
		return array('error' => true, 'error_msg' => $lang['Username_invalid']);
	}

	return array('error' => false, 'error_msg' => '');
}

// +MOD: Live Email Validate (LEV)
//
// test SMTP mail delivery
function probe_smtp_mailbox($email, $hostname)
{
	global $board_config, $lang, $phpEx;
  @set_time_limit(30);

  if ($connect = @fsockopen($hostname, 25, $errno, $errstr, 15))
  {
    usleep(888);
    $out = fgetss($connect, 1024);

    if (ereg('^220', $out))
    {
      fputs($connect, "HELO " . $hostname . "
");

      while (ereg('^220', $out))
      {
        $out = fgetss($connect, 1024);
      }

      fputs($connect, "VRFY <" . $email . ">
");
      $verify = fgetss($connect, 1024);

      fputs($connect, "MAIL FROM: <" . $board_config['board_email'] . ">
");
      $From = fgetss($connect, 1024);

      fputs($connect, "RCPT TO: <" . $email . ">
");
      $To = fgetss($connect, 1024);

      fputs($connect, "QUIT
");
      fclose($connect);

      if (ereg('^250', $From) && ereg('^250', $To) && !ereg('^550', $verify))
      {
        $result = array('error' => false, 'error_msg' => '');
      }
      else
      {
      	$result = array('error' => true, 'error_msg' => sprintf($lang['Email_unverified'], '<a href="' . append_sid('faq.' . $phpEx) . '">' . $lang['FAQ'] . '</a>') . ((DEBUG == TRUE) ? "<br />Server: $hostname | From: $From| To: " . str_replace('-"', ' ', $To) : ' '));
      }
    }
    @fclose($connect);
  }
  else
  {
  	$result = array('error' => true, 'error_msg' => sprintf($lang['No_connection'], '<a href="' . append_sid('faq.' . $phpEx) . '">' . $lang['FAQ'] . '</a>') . ((DEBUG == TRUE) ? "<br />$hostname : no route to this domain, host unavailable" : ' '));
  }
  return $result;
}

// Try to find an MX record that matches the hostname - Unix
function check_smtp_addr_unix($email)
{
  list($username, $domain) = explode('@', $email);

  if (checkdnsrr($domain, 'MX'))
  {
    getmxrr($domain, $mxhosts);
    $result = probe_smtp_mailbox($email, $mxhosts[0]);

    if ($result['error'] == false)
    {
    	return $result;
    }

    for ($i = 1; $i < count($mxhosts); $i++)
    {
      $result = probe_smtp_mailbox($email, $mxhosts[$i]);
      if ($result['error'] == false)
      {
      	return $result;
      }
    }
    return $result;
  }
  else
  {
  	return (probe_smtp_mailbox($email, $domain));
  }
}

// Try to find an MX record that matches the hostname - Win32
function check_smtp_addr_win($email)
{
  list($username, $domain) = explode('@', $email);
  exec("nslookup -type=MX $domain", $outputs);

  foreach ($outputs as $hostname)
  {
    if (@strpos($domain, $hostname))
    {
      $result =  probe_smtp_mailbox($email, $domain);

      if ($result['error'] == false)
      {
      	return $result;
      }
    }
  }

  if (isset($result))
  {
  	return $result;
  }
  else
  {
  	return (probe_smtp_mailbox($email, $domain));
  }
}
//
// -MOD: Live Email Validate (LEV)

//
// Check to see if email address is banned
// or already present in the DB
//
function validate_email($email)
{
	global $db, $lang, $board_config, $phpEx;

	if ($email != '')
	{
		if (preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/is', $email))
		{
			// +MOD: Live Email Validate (LEV)
      if ($board_config['live_email_validation'])
      {
        $system = @preg_match("/Microsoft|Win32|IIS|WebSTAR|Xitami/", $_SERVER['SERVER_SOFTWARE']) ?
        $result = check_smtp_addr_win($email) : $result = check_smtp_addr_unix($email);

        if ($result['error'] == true)
        {
          return array('error' => true, 'error_msg' => $result['error_msg']);
        }
      }
      // -MOD: Live Email Validate (LEV)
			
			$sql = "SELECT ban_email
				FROM " . BANLIST_TABLE;
			if ($result = $db->sql_query($sql))
			{
				if ($row = $db->sql_fetchrow($result))
				{
					do
					{
						$match_email = str_replace('*', '.*?', $row['ban_email']);
						if (preg_match('/^' . $match_email . '$/is', $email))
						{
							$db->sql_freeresult($result);
							return array('error' => true, 'error_msg' => $lang['Email_banned']);
						}
					}
					while($row = $db->sql_fetchrow($result));
				}
			}
			$db->sql_freeresult($result);

			$sql = "SELECT user_email
				FROM " . USERS_TABLE . "
				WHERE user_email = '" . str_replace("\'", "''", $email) . "'";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
			}
		
			if ($row = $db->sql_fetchrow($result))
			{
				return array('error' => true, 'error_msg' => $lang['Email_taken']);
			}
			$db->sql_freeresult($result);

			return array('error' => false, 'error_msg' => '');
		}
	}

	return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}

//
// Does supplementary validation of optional profile fields. This expects common stuff like trim() and strip_tags()
// to have already been run. Params are passed by-ref, so we can set them to the empty string if they fail.
//
function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$location, &$occupation, &$interests, &$sig)
{
	$check_var_length = array('aim', 'msnm', 'yim', 'location', 'occupation', 'interests', 'sig');

	for($i = 0; $i < count($check_var_length); $i++)
	{
		if (strlen($$check_var_length[$i]) < 2)
		{
			$$check_var_length[$i] = '';
		}
	}

	// ICQ number has to be only numbers.
	if (!preg_match('/^[0-9]+$/', $icq))
	{
		$icq = '';
	}
	
	// website has to start with http://, followed by something with length at least 3 that
	// contains at least one dot.
	if ($website != "")
	{
		if (!preg_match('#^http[s]?:\/\/#i', $website))
		{
			$website = 'http://' . $website;
		}

		if (!preg_match('#^http[s]?\\\:\\\/\\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $website))
		{
			$website = '';
		}
	}

	return;
}

?>
●架設主機作業系統:Unix
●您的上網方式:虛擬主機。
●您安裝的程式:
Apache version 2.0.63
MySQL version 45.0.92-community
PHP version 5.2.14
Perl version 5.8.8
●您的 phpBB2 版本:phpBB 3.0.8。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

To oscerropper:

頭一次看上頭的檔案, 發現有些錯和亂( 外掛註解, 部分不見),
當我要回覆時, 卻發現您已經修正了.

建議您:
再測試一次看看! ;-)

( ps. 我得關機消失了...)

祝您好運! :mrgreen:
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
oscerropper
星球公民
星球公民
文章: 197
註冊時間: 2004-12-21 17:56
來自: 興趣的黑洞

文章 oscerropper »

心靈捕手 寫:To oscerropper:

頭一次看上頭的檔案, 發現有些錯和亂( 外掛註解, 部分不見),
當我要回覆時, 卻發現您已經修正了.

建議您:
再測試一次看看! ;-)

( ps. 我得關機消失了...)

祝您好運! :mrgreen:
剛用2.0.15的 includes/functions_validate.php 原始檔案來改再上傳\r
依舊是不行 ... :(
既始是有效的email位置還是說沒用 :-(

gmail.com : no route to this domain, host unavailable
●架設主機作業系統:Unix
●您的上網方式:虛擬主機。
●您安裝的程式:
Apache version 2.0.63
MySQL version 45.0.92-community
PHP version 5.2.14
Perl version 5.8.8
●您的 phpBB2 版本:phpBB 3.0.8。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

oscerropper 寫:剛用2.0.15的 includes/functions_validate.php 原始檔案來改再上傳\r
依舊是不行 ... :(
既始是有效的email位置還是說沒用 :-(

gmail.com : no route to this domain, host unavailable
這的確是個令人不解的壞消息! :-?

建議您:
1. 先由後台關閉該功能;
2. 也許日後有新的版本出來, 問題自然解決也說不定.

其實, 只要如我上頭文章中提到:
帳號啟用動作, 設定成" 由會員自行啟動".
應該就已經夠用了, 不是嗎? :-)
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
oscerropper
星球公民
星球公民
文章: 197
註冊時間: 2004-12-21 17:56
來自: 興趣的黑洞

文章 oscerropper »

心靈捕手 寫:
oscerropper 寫:剛用2.0.15的 includes/functions_validate.php 原始檔案來改再上傳\r
依舊是不行 ... :(
既始是有效的email位置還是說沒用 :-(

gmail.com : no route to this domain, host unavailable
這的確是個令人不解的壞消息! :-?

建議您:
1. 先由後台關閉該功能;
2. 也許日後有新的版本出來, 問題自然解決也說不定.

其實, 只要如我上頭文章中提到:
帳號啟用動作, 設定成" 由會員自行啟動".
應該就已經夠用了, 不是嗎? :-)
因為我前陣子論壇有人惡意註冊無效mail, 所以我才要強制裝這種MOD :-(
●架設主機作業系統:Unix
●您的上網方式:虛擬主機。
●您安裝的程式:
Apache version 2.0.63
MySQL version 45.0.92-community
PHP version 5.2.14
Perl version 5.8.8
●您的 phpBB2 版本:phpBB 3.0.8。
DL
竹貓忠實會員
竹貓忠實會員
文章: 717
註冊時間: 2005-03-05 15:29

文章 DL »

其實...yahoo是「不一定行」,而不是「一定不行」
頭像
oscerropper
星球公民
星球公民
文章: 197
註冊時間: 2004-12-21 17:56
來自: 興趣的黑洞

文章 oscerropper »

DL 寫:其實...yahoo是「不一定行」,而不是「一定不行」
我用的是gmail lol 就連hinet的ms*.hinet.net都不行(但錯誤訊息不一樣)

總之, 我現在在尋問原作者答案, 多謝了 8-)
●架設主機作業系統:Unix
●您的上網方式:虛擬主機。
●您安裝的程式:
Apache version 2.0.63
MySQL version 45.0.92-community
PHP version 5.2.14
Perl version 5.8.8
●您的 phpBB2 版本:phpBB 3.0.8。
DL
竹貓忠實會員
竹貓忠實會員
文章: 717
註冊時間: 2005-03-05 15:29

文章 DL »

他是故意弄成這樣的
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

文章 阿維 »

請問有前輩可以提供這個外掛的中文翻譯嗎?
因為我很需要這個外掛,還請前輩們能夠協助翻譯語系檔
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

JORDAN 寫:請問有前輩可以提供這個外掛的中文翻譯嗎?
因為我很需要這個外掛,還請前輩們能夠協助翻譯語系檔
剛才重新下載此外掛, 發現已更新為 1.0.1 版;
但是語言檔部份, 並無變動.

以下中文化, 提供您參考:

代碼: 選擇全部

#
#-----[ OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_admin.php

#
#-----[ FIND ]---------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]----------------------------------------------
#
// +MOD: Live Email Validate (LEV)
$lang['Live_email_validation_title'] = '使用電子郵件檢查功能';
// -MOD: Live Email Validate (LEV)

#
#-----[ OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_faq.php

#
#-----[ FIND ]------------------------------------------
#
$faq[] = array("--","登入及註冊的問題");

#
#-----[ BEFORE, ADD ]----------------------------------------------
#
global $board_config;

#
#-----[ FIND ]------------------------------------------
#
$faq[] = array("--","使用者的偏好設定");

#
#-----[ BEFORE, ADD ]----------------------------------------------
#
// +MOD: Live Email Validate (LEV)
if ($board_config['live_email_validation'])
{
  $faq[] = array("為何當我試著去註冊或變更電子郵件時, 我收到 <b><i>'很抱歉! 這電子郵件位址不能證實'</i></b> 的訊息?", "假如您獲得這個訊息, 表示您的電子郵件位址是無效的. 通常的原因: 您拼錯了電子郵件的位址, 電子郵件的帳號不存在, 郵件伺服器結束配額 (信箱已經滿了), 或者是郵件伺服器沒有適當地回應.");
  $faq[] = array("為何當我試著去註冊或變更電子郵件時, 我收到 <b><i>'無法連接郵件伺服器'</i></b> 的訊息?", "您獲得這個訊息的原因有很多, 可能是 DNS 失敗 (從主機名稱無法獲得郵件伺服器的 IP 位址), 郵件伺服器不存在, 或者是尚未連線.");
}
// -MOD: Live Email Validate (LEV)

#
#-----[ OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['Email_invalid'] = '很抱歉!! 您輸入的不是合法的電子郵件位址';

#
#-----[ AFTER, ADD ]----------------------------------------------
#
// +MOD: Live Email Validate (LEV)
$lang['Email_unverified'] = '很抱歉! 這電子郵件位址不能證實, 參閱 <b>[%s]</b> 以獲得更多的資訊.'; // %s is replaced with a link to the FAQ page
$lang['No_connection'] = "無法連接郵件伺服器, 參閱 <b>[%s]</b> 以獲得更多的資訊.";
// -MOD: Live Email Validate (LEV)
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「外掛問題討論」