Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

questionnaire.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 12.93 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  /**
015  * @ignore
016  */
017  if (!defined('IN_PHPBB'))
018  {
019      exit;
020  }
021   
022  /**
023  * This class collects data which is used to create some usage statistics.
024  *
025  * The collected data is - after authorization of the administrator - submitted
026  * to a central server. For privacy reasons we try to collect only data which aren't private
027  * or don't give any information which might help to identify the user.
028  *
029  * @author        Johannes Schlueter <johannes@php.net>
030  * @copyright    (c) 2007-2008 Johannes Schlueter
031  */
032  class phpbb_questionnaire_data_collector
033  {
034      var $providers;
035      var $data = null;
036      var $install_id = '';
037   
038      /**
039      * Constructor.
040      *
041      * @param    string
042      */
043      function phpbb_questionnaire_data_collector($install_id)
044      {
045          $this->install_id = $install_id;
046          $this->providers = array();
047      }
048   
049      function add_data_provider($provider)
050      {
051          $this->providers[] = $provider;
052      }
053   
054      /**
055      * Get data as an array.
056      *
057      * @return    array    All Data
058      */
059      function get_data_raw()
060      {
061          if (!$this->data)
062          {
063              $this->collect();
064          }
065   
066          return $this->data;
067      }
068   
069      function get_data_for_form()
070      {
071          return base64_encode(serialize($this->get_data_raw()));
072      }
073   
074      /**
075      * Collect info into the data property.
076      *
077      * @return    null
078      */
079      function collect()
080      {
081          foreach (array_keys($this->providers) as $key)
082          {
083              $provider = $this->providers[$key];
084              $this->data[$provider->get_identifier()] = $provider->get_data();
085          }
086          $this->data['install_id'] = $this->install_id;
087      }
088  }
089   
090  /** interface: get_indentifier(), get_data() */
091   
092  /**
093  * Questionnaire PHP data provider
094  */
095  class phpbb_questionnaire_php_data_provider
096  {
097      function get_identifier()
098      {
099          return 'PHP';
100      }
101   
102      /**
103      * Get data about the PHP runtime setup.
104      *
105      * @return    array
106      */
107      function get_data()
108      {
109          return array(
110              'version'                        => PHP_VERSION,
111              'sapi'                            => PHP_SAPI,
112              'int_size'                        => defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '',
113              'safe_mode'                        => (int) @ini_get('safe_mode'),
114              'open_basedir'                    => (int) @ini_get('open_basedir'),
115              'memory_limit'                    => @ini_get('memory_limit'),
116              'allow_url_fopen'                => (int) @ini_get('allow_url_fopen'),
117              'allow_url_include'                => (int) @ini_get('allow_url_include'),
118              'file_uploads'                    => (int) @ini_get('file_uploads'),
119              'upload_max_filesize'            => @ini_get('upload_max_filesize'),
120              'post_max_size'                    => @ini_get('post_max_size'),
121              'disable_functions'                => @ini_get('disable_functions'),
122              'disable_classes'                => @ini_get('disable_classes'),
123              'enable_dl'                        => (int) @ini_get('enable_dl'),
124              'magic_quotes_gpc'                => (int) @ini_get('magic_quotes_gpc'),
125              'register_globals'                => (int) @ini_get('register_globals'),
126              'filter.default'                => @ini_get('filter.default'),
127              'zend.ze1_compatibility_mode'    => (int) @ini_get('zend.ze1_compatibility_mode'),
128              'unicode.semantics'                => (int) @ini_get('unicode.semantics'),
129              'zend_thread_safty'                => (int) function_exists('zend_thread_id'),
130              'extensions'                    => get_loaded_extensions(),
131          );
132      }
133  }
134   
135  /**
136  * Questionnaire System data provider
137  */
138  class phpbb_questionnaire_system_data_provider
139  {
140      function get_identifier()
141      {
142          return 'System';
143      }
144   
145      /**
146      * Get data about the general system information, like OS or IP (shortened).
147      *
148      * @return    array
149      */
150      function get_data()
151      {
152          global $request;
153   
154          // Start discovering the IPV4 server address, if available
155          // Try apache, IIS, fall back to 0.0.0.0
156          $server_address = htmlspecialchars_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0')));
157   
158          return array(
159              'os'    => PHP_OS,
160              'httpd'    => htmlspecialchars_decode($request->server('SERVER_SOFTWARE')),
161              // we don't want the real IP address (for privacy policy reasons) but only
162              // a network address to see whether your installation is running on a private or public network.
163              'private_ip'    => $this->is_private_ip($server_address),
164              'ipv6'            => strpos($server_address, ':') !== false,
165          );
166      }
167   
168      /**
169      * Checks whether the given IP is in a private network.
170      *
171      * @param    string    $ip    IP in v4 dot-decimal or v6 hex format
172      * @return    bool        true if the IP is from a private network, else false
173      */
174      function is_private_ip($ip)
175      {
176          // IPv4
177          if (strpos($ip, ':') === false)
178          {
179              $ip_address_ary = explode('.', $ip);
180   
181              // build ip
182              if (!isset($ip_address_ary[0]) || !isset($ip_address_ary[1]))
183              {
184                  $ip_address_ary = explode('.', '0.0.0.0');
185              }
186   
187              // IANA reserved addresses for private networks (RFC 1918) are:
188              // - 10.0.0.0/8
189              // - 172.16.0.0/12
190              // - 192.168.0.0/16
191              if ($ip_address_ary[0] == '10' ||
192                  ($ip_address_ary[0] == '172' && intval($ip_address_ary[1]) > 15 && intval($ip_address_ary[1]) < 32) ||
193                  ($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168'))
194              {
195                  return true;
196              }
197          }
198          // IPv6
199          else
200          {
201              // unique local unicast
202              $prefix = substr($ip, 0, 2);
203              if ($prefix == 'fc' || $prefix == 'fd')
204              {
205                  return true;
206              }
207          }
208   
209          return false;
210      }
211  }
212   
213  /**
214  * Questionnaire phpBB data provider
215  */
216  class phpbb_questionnaire_phpbb_data_provider
217  {
218      var $config;
219      var $unique_id;
220   
221      /**
222      * Constructor.
223      *
224      * @param    array    $config
225      */
226      function phpbb_questionnaire_phpbb_data_provider($config)
227      {
228          // generate a unique id if necessary
229          if (empty($config['questionnaire_unique_id']))
230          {
231              $this->unique_id = unique_id();
232              $config->set('questionnaire_unique_id', $this->unique_id);
233          }
234          else
235          {
236              $this->unique_id = $config['questionnaire_unique_id'];
237          }
238   
239          $this->config = $config;
240      }
241   
242      /**
243      * Returns a string identifier for this data provider
244      *
245      * @return    string    "phpBB"
246      */
247      function get_identifier()
248      {
249          return 'phpBB';
250      }
251   
252      /**
253      * Get data about this phpBB installation.
254      *
255      * @return    array    Relevant anonymous config options
256      */
257      function get_data()
258      {
259          global $phpbb_config_php_file;
260   
261          extract($phpbb_config_php_file->get_all());
262          unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
263   
264          $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
265   
266          // Only send certain config vars
267          $config_vars = array(
268              'active_sessions' => true,
269              'allow_attachments' => true,
270              'allow_autologin' => true,
271              'allow_avatar' => true,
272              'allow_avatar_local' => true,
273              'allow_avatar_remote' => true,
274              'allow_avatar_upload' => true,
275              'allow_bbcode' => true,
276              'allow_birthdays' => true,
277              'allow_bookmarks' => true,
278              'allow_emailreuse' => true,
279              'allow_forum_notify' => true,
280              'allow_mass_pm' => true,
281              'allow_name_chars' => true,
282              'allow_namechange' => true,
283              'allow_nocensors' => true,
284              'allow_pm_attach' => true,
285              'allow_pm_report' => true,
286              'allow_post_flash' => true,
287              'allow_post_links' => true,
288              'allow_privmsg' => true,
289              'allow_quick_reply' => true,
290              'allow_sig' => true,
291              'allow_sig_bbcode' => true,
292              'allow_sig_flash' => true,
293              'allow_sig_img' => true,
294              'allow_sig_links' => true,
295              'allow_sig_pm' => true,
296              'allow_sig_smilies' => true,
297              'allow_smilies' => true,
298              'allow_topic_notify' => true,
299              'attachment_quota' => true,
300              'auth_bbcode_pm' => true,
301              'auth_flash_pm' => true,
302              'auth_img_pm' => true,
303              'auth_method' => true,
304              'auth_smilies_pm' => true,
305              'avatar_filesize' => true,
306              'avatar_max_height' => true,
307              'avatar_max_width' => true,
308              'avatar_min_height' => true,
309              'avatar_min_width' => true,
310              'board_email_form' => true,
311              'board_hide_emails' => true,
312              'board_timezone' => true,
313              'browser_check' => true,
314              'bump_interval' => true,
315              'bump_type' => true,
316              'cache_gc' => true,
317              'captcha_plugin' => true,
318              'captcha_gd' => true,
319              'captcha_gd_foreground_noise' => true,
320              'captcha_gd_x_grid' => true,
321              'captcha_gd_y_grid' => true,
322              'captcha_gd_wave' => true,
323              'captcha_gd_3d_noise' => true,
324              'captcha_gd_fonts' => true,
325              'confirm_refresh' => true,
326              'check_attachment_content' => true,
327              'check_dnsbl' => true,
328              'chg_passforce' => true,
329              'cookie_secure' => true,
330              'coppa_enable' => true,
331              'database_gc' => true,
332              'dbms_version' => true,
333              'default_dateformat' => true,
334              'default_lang' => true,
335              'display_last_edited' => true,
336              'display_order' => true,
337              'edit_time' => true,
338              'email_check_mx' => true,
339              'email_enable' => true,
340              'email_function_name' => true,
341              'email_package_size' => true,
342              'enable_confirm' => true,
343              'enable_pm_icons' => true,
344              'enable_post_confirm' => true,
345              'feed_enable' => true,
346              'feed_http_auth' => true,
347              'feed_limit_post' => true,
348              'feed_limit_topic' => true,
349              'feed_overall' => true,
350              'feed_overall_forums' => true,
351              'feed_forum' => true,
352              'feed_topic' => true,
353              'feed_topics_new' => true,
354              'feed_topics_active' => true,
355              'feed_item_statistics' => true,
356              'flood_interval' => true,
357              'force_server_vars' => true,
358              'form_token_lifetime' => true,
359              'form_token_mintime' => true,
360              'form_token_sid_guests' => true,
361              'forward_pm' => true,
362              'forwarded_for_check' => true,
363              'full_folder_action' => true,
364              'fulltext_native_common_thres' => true,
365              'fulltext_native_load_upd' => true,
366              'fulltext_native_max_chars' => true,
367              'fulltext_native_min_chars' => true,
368              'gzip_compress' => true,
369              'hot_threshold' => true,
370              'img_create_thumbnail' => true,
371              'img_display_inlined' => true,
372              'img_imagick' => true,
373              'img_link_height' => true,
374              'img_link_width' => true,
375              'img_max_height' => true,
376              'img_max_thumb_width' => true,
377              'img_max_width' => true,
378              'img_min_thumb_filesize' => true,
379              'ip_check' => true,
380              'jab_enable' => true,
381              'jab_package_size' => true,
382              'jab_use_ssl' => true,
383              'limit_load' => true,
384              'limit_search_load' => true,
385              'load_anon_lastread' => true,
386              'load_birthdays' => true,
387              'load_cpf_memberlist' => true,
388              'load_cpf_viewprofile' => true,
389              'load_cpf_viewtopic' => true,
390              'load_db_lastread' => true,
391              'load_db_track' => true,
392              'load_jumpbox' => true,
393              'load_moderators' => true,
394              'load_online' => true,
395              'load_online_guests' => true,
396              'load_online_time' => true,
397              'load_onlinetrack' => true,
398              'load_search' => true,
399              'load_tplcompile' => true,
400              'load_user_activity' => true,
401              'max_attachments' => true,
402              'max_attachments_pm' => true,
403              'max_autologin_time' => true,
404              'max_filesize' => true,
405              'max_filesize_pm' => true,
406              'max_login_attempts' => true,
407              'max_name_chars' => true,
408              'max_num_search_keywords' => true,
409              'max_pass_chars' => true,
410              'max_poll_options' => true,
411              'max_post_chars' => true,
412              'max_post_font_size' => true,
413              'max_post_img_height' => true,
414              'max_post_img_width' => true,
415              'max_post_smilies' => true,
416              'max_post_urls' => true,
417              'max_quote_depth' => true,
418              'max_reg_attempts' => true,
419              'max_sig_chars' => true,
420              'max_sig_font_size' => true,
421              'max_sig_img_height' => true,
422              'max_sig_img_width' => true,
423              'max_sig_smilies' => true,
424              'max_sig_urls' => true,
425              'min_name_chars' => true,
426              'min_pass_chars' => true,
427              'min_post_chars' => true,
428              'min_search_author_chars' => true,
429              'mime_triggers' => true,
430              'new_member_post_limit' => true,
431              'new_member_group_default' => true,
432              'override_user_style' => true,
433              'pass_complex' => true,
434              'pm_edit_time' => true,
435              'pm_max_boxes' => true,
436              'pm_max_msgs' => true,
437              'pm_max_recipients' => true,
438              'posts_per_page' => true,
439              'print_pm' => true,
440              'queue_interval' => true,
441              'require_activation' => true,
442              'referer_validation' => true,
443              'search_block_size' => true,
444              'search_gc' => true,
445              'search_interval' => true,
446              'search_anonymous_interval' => true,
447              'search_type' => true,
448              'search_store_results' => true,
449              'secure_allow_deny' => true,
450              'secure_allow_empty_referer' => true,
451              'secure_downloads' => true,
452              'session_gc' => true,
453              'session_length' => true,
454              'smtp_auth_method' => true,
455              'smtp_delivery' => true,
456              'topics_per_page' => true,
457              'tpl_allow_php' => true,
458              'version' => true,
459              'warnings_expire_days' => true,
460              'warnings_gc' => true,
461   
462              'num_files' => true,
463              'num_posts' => true,
464              'num_topics' => true,
465              'num_users' => true,
466              'record_online_users' => true,
467          );
468   
469          $result = array();
470          foreach ($config_vars as $name => $void)
471          {
472              if (isset($this->config[$name]))
473              {
474                  $result['config_' . $name] = $this->config[$name];
475              }
476          }
477   
478          global $db, $request;
479   
480          $result['dbms'] = $dbms;
481          $result['acm_type'] = $acm_type;
482          $result['user_agent'] = 'Unknown';
483          $result['dbms_version'] = $db->sql_server_info(true);
484   
485          // Try to get user agent vendor and version
486          $match = array();
487          $user_agent = $request->header('User-Agent');
488          $agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
489   
490          // We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/)
491          foreach ($agents as $agent)
492          {
493              if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match))
494              {
495                  $result['user_agent'] = $match[1] . ' ' . $match[2];
496                  break;
497              }
498          }
499   
500          return $result;
501      }
502  }
503