[ABD] Double Account Preventer

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
Sailsfast
Registered User
Posts: 28
Joined: Wed Feb 20, 2008 3:10 am

Re: [RC] Double Account Preventer

Post by Sailsfast »

ON a clean server...

I copy all the files to where they go...

try to run dap_install...

It seems to get going...

Select yes

and I get this

Code: Select all

General Error
SQL ERROR [ postgres ]

ERROR: type "mediumtext" does not exist LINE 1: ALTER TABLE phpbb_users ADD common_names mediumtext ^ []

SQL

ALTER TABLE phpbb_users ADD common_names mediumtext

BACKTRACE

FILE: includes/db/postgres.php
LINE: 177
CALL: dbal->sql_error()

FILE: dap_install.php
LINE: 143
CALL: dbal_postgres->sql_query()
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [RC] Double Account Preventer

Post by kmklr72 »

I've never tested this MOD on postgres and that is a problem with an incompatible SQL statement. I'll make up the SQL statements when I can get on a computer.
Avdon
Registered User
Posts: 186
Joined: Tue Jun 02, 2009 4:55 pm
Location: Germany
Name: Danny Alkhaldy

Re: [RC] Double Account Preventer

Post by Avdon »

In my board
kmklr72 wrote:With how the MOD is set up now, it just tracks every user and will notify you if/when they try to register another account. It is up to you what sort of action is taken for the user at that point.
That's very good for me because I use "Advanced Double Activation Pack" mod.

In my board I use two URLs and the second on is https, so when a user login with this url he will have a different ip than if he login with the normal url. would this url cheat this mod?
inetforce
Registered User
Posts: 7
Joined: Mon Jul 03, 2006 1:18 pm

Re: [RC] Double Account Preventer

Post by inetforce »

I am getting a similar error and I am using mySQL

Code: Select all

Fatal error: Call to a member function get_dap_config() on a non-object in /var/www/phpBB3/includes/functions.php on line 3853
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [RC] Double Account Preventer

Post by kmklr72 »

I will have this fixed in the next version. It would have already been released but I've been having some problems with the installer. Once I get that sorted out, I'll get it packaged and released.
dallas2
Registered User
Posts: 29
Joined: Tue Dec 26, 2006 5:42 pm
Location: Croatia
Contact:

Re: [RC] Double Account Preventer

Post by dallas2 »

Where can I download this MOD from and test it ?
Link in the first post doesn't work.
User avatar
Ashley.S.
Registered User
Posts: 469
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [RC] Double Account Preventer

Post by Ashley.S. »

dallas2 wrote:Where can I download this MOD from and test it ?
Link in the first post doesn't work.
kmklr72 changed his site the other day, the download topic is now here: http://demonmods.com/viewtopic.php?f=13&t=5
Regards,
-Ashley.S. [ PurephpBB Founder ]
dallas2
Registered User
Posts: 29
Joined: Tue Dec 26, 2006 5:42 pm
Location: Croatia
Contact:

Re: [RC] Double Account Preventer

Post by dallas2 »

I can download from this link, but when I try to extract, I get "The archive is corrupt" message :(
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [RC] Double Account Preventer

Post by kmklr72 »

I'll reupload the files when I get home from vacation at the end of the week. Sorry for the inconvienience.
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [RC] Double Account Preventer

Post by kmklr72 »

I re-uploaded the MOD so it should fixed now.
dallas2
Registered User
Posts: 29
Joined: Tue Dec 26, 2006 5:42 pm
Location: Croatia
Contact:

Re: [RC] Double Account Preventer

Post by dallas2 »

Download is working now.
Thanks.
User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Re: [RC] Double Account Preventer

Post by beggers »

This looks like a very useful mod! Thanks.
johnj7l
Registered User
Posts: 164
Joined: Mon Nov 26, 2007 2:52 pm

Re: [RC] Double Account Preventer

Post by johnj7l »

I downloaded this from demonmods yesterday and installed it;

I installed this mod and it said it installed fine but when I went to my ACP I seen the .MOD TAB on top to click but when I clicked it, I got this error message.
------------------------------------------------------------
Fatal error: Call to a member function get_dap_config() on a non-object in /home/equipme2/public_html/includes/acp/acp_dap.php on line 33
-----------------------------------------------------------
Any help on this?
kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [RC] Double Account Preventer

Post by kmklr72 »

Could you post your acp_dap.php file code here? Also double check your edits to make sure you didn't miss one (the common.php edit will be the problem if it is missing).
johnj7l
Registered User
Posts: 164
Joined: Mon Nov 26, 2007 2:52 pm

Re: [RC] Double Account Preventer

Post by johnj7l »

kmklr72 wrote:Could you post your acp_dap.php file code here? Also double check your edits to make sure you didn't miss one (the common.php edit will be the problem if it is missing).


Sure here it is below:

By the way LINE 33 is this:
$dap_config = $dap->get_dap_config();





Code: Select all

<?php

/**
*
* @package acp
* @copyright (c) 2009 kmklr72
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package acp
*/
class acp_dap
{
	var $u_action;
	var $new_config = array();

	function main($id, $mode)
	{
		global $db, $user, $auth, $template;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		global $dap;

		$dap_config = $dap->get_dap_config();
		$this->new_config = $dap_config;

		$action	= request_var('action', '');
		$submit = (isset($_POST['submit'])) ? true : false;

		$form_key = 'acp_dap';
		add_form_key($form_key);

		/**
		*	Validation types are:
		*		string, int, bool,
		*		script_path (absolute path in url - beginning with / and no trailing slash),
		*		rpath (relative), rwpath (realtive, writable), path (relative path, but able to escape the root), wpath (writable)
		*/
		switch ($mode)
		{
			case 'settings':
				$display_vars = array(
					'title'	=> 'ACP_DAP_SETTINGS',
					'vars'	=> array(
						'legend1'						=> 'ACP_DAP_SETTINGS',
						'require_ip_check'				=> array('lang' => 'IP_CHECK_REGISTRATION',					'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check_registration', 'explain' => true),
						'require_cookie_check'			=> array('lang' => 'COOKIE_CHECK_REGISTRATION',				'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'enable_email_notification'		=> array('lang' => 'DAP_EMAIL_NOTIFICATION',				'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'legend2'						=> 'ACP_DAP_COOKIE_BAN_SETTINGS',
						'cookie_ban_enabled'			=> array('lang' => 'DAP_COOKIE_BAN_ENABLED',				'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'cookie_ban_message'			=> array('lang' => 'DAP_COOKIE_BAN_MESSAGE',				'validate' => 'string', 'type' => 'text:80:200', 'explain' => true),

						'legend3'						=> 'ACP_DAP_PROXY_SETTINGS',
						'proxy_check_enabled'			=> array('lang' => 'DAP_PROXY_CHECK_ENABLED',				'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'proxy_check_block'				=> array('lang' => 'DAP_PROXY_CHECK_BLOCK',					'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'proxy_block_message'			=> array('lang' => 'DAP_PROXY_BLOCK_MESSAGE',				'validate' => 'string', 'type' => 'text:80:200', 'explain' => true),
					)
				);
			break;

			case 'pm_notification':
				$display_vars = array(
					'title' => 'ACP_DAP_PM_NOTIFICATION',
					'vars'	=> array(
						'legend1'						=> 'ACP_DAP_PM_NOTIFICATION',
						'enable_pm_notification'		=> array('lang' => 'DAP_PM_NOTIFICATION',					'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'alert_user_id'					=> array('lang' => 'DAP_ALERT_USER_ID',						'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
						'pm_subject'					=> array('lang' => 'DAP_PM_NOTIFICATION_SUBJECT',			'validate' => 'string', 'type' => 'text:80:200', 'explain' => true),
						'pm_message'					=> array('lang' => 'DAP_PM_NOTIFICATION_MESSAGE',			'type' => 'textarea:10:6', 'explain' => true),
					)
				);
			break;

			case 'post_notification':
				$display_vars = array(
					'title' => 'ACP_DAP_POST_NOTIFICATION',
					'vars'	=> array(
						'legend1'						=> 'ACP_DAP_POST_NOTIFICATION',
						'enable_post_notification'		=> array('lang' => 'DAP_POST_NOTIFICATION',					'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
						'post_forum_id'					=> array('lang' => 'DAP_POST_NOTIFICATION_FORUM',			'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
						'post_subject'					=> array('lang' => 'DAP_POST_NOTIFICATION_SUBJECT',			'validate' => 'string', 'type' => 'text:80:200', 'explain' => true),
						'post_message'					=> array('lang' => 'DAP_POST_NOTIFICATION_MESSAGE',			'type' => 'textarea:10:6', 'explain' => true),
					)
				);
			break;

			case 'dupe_user_list':
				$display_vars = array(
					'title' => 'ACP_DAP_DUPE_USER_LIST',
				);

				$this->list_dupe_users();

				$template->assign_vars(array(
					'L_TITLE'			=> $user->lang[$display_vars['title']],
					'L_TITLE_EXPLAIN'	=> $user->lang[$display_vars['title'] . '_EXPLAIN'],

					'DUPE_USER_LIST'					=> true,
				));

				if (isset($_GET['ban']))
				{
					//$user_id = $_GET['u'];
					//$ban = $_GET['ban'];
					$user_id = request_var('u', 0);
					$ban = request_var('ban', 0);

					$this->cookie_ban_user($user_id, $ban);
				}
			break;

			default:
				trigger_error('NO_MODE', E_USER_ERROR);
			break;
		}

		if ($mode != 'dupe_user_list')
		{
			$this->page_output($display_vars, $form_key);
		}

		$this->tpl_name = 'acp_dap';
		$this->page_title = $user->lang[$display_vars['title']];
	}

	function select_ip_check_registration($value, $key = '')
	{
		global $user, $config;

		$radio_ary = array(0 => 'IP_CHECK_DISABLE', 1 => 'IP_CHECK_NONE', 2 => 'IP_CHECK_LIGHT', 3 => 'IP_CHECK_FULL');	

		return h_radio('config[require_ip_check]', $radio_ary, $value, $key);
	}

	function list_dupe_users()
	{
		global $auth, $db, $template, $phpbb_root_path, $phpEx;

		$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_double = ' . (bool) true;
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$ban = ($row['user_banned_cookie'] == 0) ? 1 : 0;

			$template->assign_block_vars('dupe_users', array(
				'USER_ID'			=> $row['user_id'],
				'USERNAME'			=> $row['username'],
				'COMMON_NAMES'		=> $row['common_names'],
				'DETECT_METHOD'		=> $row['user_detect_method'],

				'PROXY'				=> $row['proxy'],

				'U_USER_ADMIN'		=> ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&mode=overview&u=' . $row['user_id'], true) : '',
				'U_USER_COOKIE_BAN'	=> append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=dap&mode=dupe_user_list&ban=' . $ban . '&u=' . $row['user_id'], true),
			));
		}
		$db->sql_freeresult($result);

		return;
	}

	function cookie_ban_user($user_id, $ban)
	{
		global $db;

		$sql = 'UPDATE ' . USERS_TABLE . ' SET user_banned_cookie = ' . (int) $ban . ' WHERE user_id = ' . (int) $user_id;
		$db->sql_query($sql);
	}

	function page_output($display_vars, $form_key)
	{
		global $db, $user, $auth, $template;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		global $dap;

		$action	= request_var('action', '');
		$submit = (isset($_POST['submit'])) ? true : false;

		$dap_config = $dap->get_dap_config();
		$this->new_config = $dap_config;
		$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
		$error = array();

		// We validate the complete config if whished
		validate_config_vars($display_vars['vars'], $cfg_array, $error);

		if ($submit && !check_form_key($form_key))
		{
			$error[] = $user->lang['FORM_INVALID'];
		}
		// Do not write values if there is an error
		if (sizeof($error))
		{
			$submit = false;
		}

		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
		foreach ($display_vars['vars'] as $config_name => $null)
		{
			if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
			{
				continue;
			}

			$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];

			if ($submit)
			{
				$dap->set_dap_config($config_name, $config_value);
			}
		}

		$template->assign_vars(array(
			'L_TITLE'			=> $user->lang[$display_vars['title']],
			'L_TITLE_EXPLAIN'	=> $user->lang[$display_vars['title'] . '_EXPLAIN'],

			'S_ERROR'			=> (sizeof($error)) ? true : false,
			'ERROR_MSG'			=> implode('<br />', $error),

			'U_ACTION'			=> $this->u_action)
		);

		// Output relevant page
		foreach ($display_vars['vars'] as $config_key => $vars)
		{
			if (!is_array($vars) && strpos($config_key, 'legend') === false)
			{
				continue;
			}

			if (strpos($config_key, 'legend') !== false)
			{
				$template->assign_block_vars('options', array(
					'S_LEGEND'		=> true,
					'LEGEND'		=> (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars)
				);

				continue;
			}

			$type = explode(':', $vars['type']);

			$l_explain = '';
			if ($vars['explain'] && isset($vars['lang_explain']))
			{
				$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
			}
			else if ($vars['explain'])
			{
				$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
			}

			$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);

			if (empty($content))
			{
				continue;
			}

			$template->assign_block_vars('options', array(
				'KEY'			=> $config_key,
				'TITLE'			=> (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
				'S_EXPLAIN'		=> $vars['explain'],
				'TITLE_EXPLAIN'	=> $l_explain,
				'CONTENT'		=> $content,
				)
			);

			unset($display_vars['vars'][$config_key]);
		}

		//return;
	}
}

?>
Locked

Return to “[3.0.x] Abandoned MODs”