aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/questionnaire/questionnaire_phpbb.php
blob: 7c2ce4c29229005599b6c15c6aedcc01a57e449a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

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

include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);

class questionnaire_phpbb_data_provider
{
	var $config;
	var $unique_id;

	/**
	* Constructor.
	*
	* @param	array	$config
	* @param	string	$oldversion
	*/
	function __construct($config)
	{
		// generate a unique id if necessary
		if (!isset($config['questionnaire_unique_id']))
		{
			$this->unique_id = unique_id();
			set_config('questionnaire_unique_id', $this->unique_id);
		}
		else
		{
			$this->unique_id = $config['questionnaire_unique_id'];
		}

		$this->config = $config;
	}

	/**
	* Returns a string identifier for this data provider
	*
	* @return	string	"phpBB"
	*/
	function getIdentifier()
	{
		return 'phpBB';
	}


	/**
	* Get data about this phpBB installation.
	*
	* @return	array	Relevant anonymous config options
	*/
	function getData()
	{
		
		// Exclude certain config vars
		$exclude_config_vars = array(
			'avatar_gallery_path' => true,
			'avatar_path' => true,
			'avatar_salt' => true,
			'board_contact' => true,
			'board_disable_msg' => true,
			'board_email' => true,
			'board_email_sig' => true,
			'cookie_name' => true,
			'icons_path' => true,
			'icons_path' => true,
			'jab_host' => true,
			'jab_password' => true,
			'jab_port' => true,
			'jab_username' => true,
			'ldap_base_dn' => true,
			'ldap_email' => true,
			'ldap_password' => true,
			'ldap_port' => true,
			'ldap_server' => true,
			'ldap_uid' => true,
			'ldap_user' => true,
			'ldap_user_filter' => true,
			'ranks_path' => true,
			'script_path' => true,
			'server_name' => true,
			'server_port' => true,
			'server_protocol' => true,
			'site_desc' => true,
			'sitename' => true,
			'smilies_path' => true,
			'smtp_host' => true,
			'smtp_password' => true,
			'smtp_port' => true,
			'smtp_username' => true,
			'upload_icons_path' => true,
			'upload_path' => true,
			'newest_user_colour' => true,
			'newest_user_id' => true,
			'newest_username' => true,
			'rand_seed' => true,
		);

		$result = array();
		foreach ($this->config as $name => $value)
		{
			if (!isset($exclude_config_vars[$name]))
			{
				$result['config.' . $name] = $value;
			}
		}

		return $result;
	}
}