Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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: 13.03 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                  ($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168'))
 195              {
 196                  return true;
 197              }
 198          }
 199          // IPv6
 200          else
 201          {
 202              // unique local unicast
 203              $prefix = substr($ip, 0, 2);
 204              if ($prefix == 'fc' || $prefix == 'fd')
 205              {
 206                  return true;
 207              }
 208          }
 209   
 210          return false;
 211      }
 212  }
 213   
 214  /**
 215  * Questionnaire phpBB data provider
 216  */
 217  class phpbb_questionnaire_phpbb_data_provider
 218  {
 219      var $config;
 220      var $unique_id;
 221   
 222      /**
 223      * Constructor.
 224      *
 225      * @param    array    $config
 226      */
 227      function phpbb_questionnaire_phpbb_data_provider($config)
 228      {
 229          // generate a unique id if necessary
 230          if (empty($config['questionnaire_unique_id']))
 231          {
 232              $this->unique_id = unique_id();
 233              set_config('questionnaire_unique_id', $this->unique_id);
 234          }
 235          else
 236          {
 237              $this->unique_id = $config['questionnaire_unique_id'];
 238          }
 239   
 240          $this->config = $config;
 241      }
 242   
 243      /**
 244      * Returns a string identifier for this data provider
 245      *
 246      * @return    string    "phpBB"
 247      */
 248      function get_identifier()
 249      {
 250          return 'phpBB';
 251      }
 252   
 253      /**
 254      * Get data about this phpBB installation.
 255      *
 256      * @return    array    Relevant anonymous config options
 257      */
 258      function get_data()
 259      {
 260          global $phpbb_root_path, $phpEx, $phpbb_config_php_file;
 261   
 262          extract($phpbb_config_php_file->get_all());
 263          unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
 264   
 265          $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
 266   
 267          // Only send certain config vars
 268          $config_vars = array(
 269              'active_sessions' => true,
 270              'allow_attachments' => true,
 271              'allow_autologin' => true,
 272              'allow_avatar' => true,
 273              'allow_avatar_local' => true,
 274              'allow_avatar_remote' => true,
 275              'allow_avatar_upload' => true,
 276              'allow_bbcode' => true,
 277              'allow_birthdays' => true,
 278              'allow_bookmarks' => true,
 279              'allow_emailreuse' => true,
 280              'allow_forum_notify' => true,
 281              'allow_mass_pm' => true,
 282              'allow_name_chars' => true,
 283              'allow_namechange' => true,
 284              'allow_nocensors' => true,
 285              'allow_pm_attach' => true,
 286              'allow_pm_report' => true,
 287              'allow_post_flash' => true,
 288              'allow_post_links' => true,
 289              'allow_privmsg' => true,
 290              'allow_quick_reply' => true,
 291              'allow_sig' => true,
 292              'allow_sig_bbcode' => true,
 293              'allow_sig_flash' => true,
 294              'allow_sig_img' => true,
 295              'allow_sig_links' => true,
 296              'allow_sig_pm' => true,
 297              'allow_sig_smilies' => true,
 298              'allow_smilies' => true,
 299              'allow_topic_notify' => true,
 300              'attachment_quota' => true,
 301              'auth_bbcode_pm' => true,
 302              'auth_flash_pm' => true,
 303              'auth_img_pm' => true,
 304              'auth_method' => true,
 305              'auth_smilies_pm' => true,
 306              'avatar_filesize' => true,
 307              'avatar_max_height' => true,
 308              'avatar_max_width' => true,
 309              'avatar_min_height' => true,
 310              'avatar_min_width' => true,
 311              'board_email_form' => true,
 312              'board_hide_emails' => true,
 313              'board_timezone' => true,
 314              'browser_check' => true,
 315              'bump_interval' => true,
 316              'bump_type' => true,
 317              'cache_gc' => true,
 318              'captcha_plugin' => true,
 319              'captcha_gd' => true,
 320              'captcha_gd_foreground_noise' => true,
 321              'captcha_gd_x_grid' => true,
 322              'captcha_gd_y_grid' => true,
 323              'captcha_gd_wave' => true,
 324              'captcha_gd_3d_noise' => true,
 325              'captcha_gd_fonts' => true,
 326              'confirm_refresh' => true,
 327              'check_attachment_content' => true,
 328              'check_dnsbl' => true,
 329              'chg_passforce' => true,
 330              'cookie_secure' => true,
 331              'coppa_enable' => true,
 332              'database_gc' => true,
 333              'dbms_version' => true,
 334              'default_dateformat' => true,
 335              'default_lang' => true,
 336              'display_last_edited' => true,
 337              'display_order' => true,
 338              'edit_time' => true,
 339              'email_check_mx' => true,
 340              'email_enable' => true,
 341              'email_function_name' => true,
 342              'email_package_size' => true,
 343              'enable_confirm' => true,
 344              'enable_pm_icons' => true,
 345              'enable_post_confirm' => true,
 346              'feed_enable' => true,
 347              'feed_http_auth' => true,
 348              'feed_limit_post' => true,
 349              'feed_limit_topic' => true,
 350              'feed_overall' => true,
 351              'feed_overall_forums' => true,
 352              'feed_forum' => true,
 353              'feed_topic' => true,
 354              'feed_topics_new' => true,
 355              'feed_topics_active' => true,
 356              'feed_item_statistics' => true,
 357              'flood_interval' => true,
 358              'force_server_vars' => true,
 359              'form_token_lifetime' => true,
 360              'form_token_mintime' => true,
 361              'form_token_sid_guests' => true,
 362              'forward_pm' => true,
 363              'forwarded_for_check' => true,
 364              'full_folder_action' => true,
 365              'fulltext_native_common_thres' => true,
 366              'fulltext_native_load_upd' => true,
 367              'fulltext_native_max_chars' => true,
 368              'fulltext_native_min_chars' => true,
 369              'gzip_compress' => true,
 370              'hot_threshold' => true,
 371              'img_create_thumbnail' => true,
 372              'img_display_inlined' => true,
 373              'img_imagick' => true,
 374              'img_link_height' => true,
 375              'img_link_width' => true,
 376              'img_max_height' => true,
 377              'img_max_thumb_width' => true,
 378              'img_max_width' => true,
 379              'img_min_thumb_filesize' => true,
 380              'ip_check' => true,
 381              'jab_enable' => true,
 382              'jab_package_size' => true,
 383              'jab_use_ssl' => true,
 384              'limit_load' => true,
 385              'limit_search_load' => true,
 386              'load_anon_lastread' => true,
 387              'load_birthdays' => true,
 388              'load_cpf_memberlist' => true,
 389              'load_cpf_viewprofile' => true,
 390              'load_cpf_viewtopic' => true,
 391              'load_db_lastread' => true,
 392              'load_db_track' => true,
 393              'load_jumpbox' => true,
 394              'load_moderators' => true,
 395              'load_online' => true,
 396              'load_online_guests' => true,
 397              'load_online_time' => true,
 398              'load_onlinetrack' => true,
 399              'load_search' => true,
 400              'load_tplcompile' => true,
 401              'load_user_activity' => true,
 402              'max_attachments' => true,
 403              'max_attachments_pm' => true,
 404              'max_autologin_time' => true,
 405              'max_filesize' => true,
 406              'max_filesize_pm' => true,
 407              'max_login_attempts' => true,
 408              'max_name_chars' => true,
 409              'max_num_search_keywords' => true,
 410              'max_pass_chars' => true,
 411              'max_poll_options' => true,
 412              'max_post_chars' => true,
 413              'max_post_font_size' => true,
 414              'max_post_img_height' => true,
 415              'max_post_img_width' => true,
 416              'max_post_smilies' => true,
 417              'max_post_urls' => true,
 418              'max_quote_depth' => true,
 419              'max_reg_attempts' => true,
 420              'max_sig_chars' => true,
 421              'max_sig_font_size' => true,
 422              'max_sig_img_height' => true,
 423              'max_sig_img_width' => true,
 424              'max_sig_smilies' => true,
 425              'max_sig_urls' => true,
 426              'min_name_chars' => true,
 427              'min_pass_chars' => true,
 428              'min_post_chars' => true,
 429              'min_search_author_chars' => true,
 430              'mime_triggers' => true,
 431              'new_member_post_limit' => true,
 432              'new_member_group_default' => true,
 433              'override_user_style' => true,
 434              'pass_complex' => true,
 435              'pm_edit_time' => true,
 436              'pm_max_boxes' => true,
 437              'pm_max_msgs' => true,
 438              'pm_max_recipients' => true,
 439              'posts_per_page' => true,
 440              'print_pm' => true,
 441              'queue_interval' => true,
 442              'require_activation' => true,
 443              'referer_validation' => true,
 444              'search_block_size' => true,
 445              'search_gc' => true,
 446              'search_interval' => true,
 447              'search_anonymous_interval' => true,
 448              'search_type' => true,
 449              'search_store_results' => true,
 450              'secure_allow_deny' => true,
 451              'secure_allow_empty_referer' => true,
 452              'secure_downloads' => true,
 453              'session_gc' => true,
 454              'session_length' => true,
 455              'smtp_auth_method' => true,
 456              'smtp_delivery' => true,
 457              'topics_per_page' => true,
 458              'tpl_allow_php' => true,
 459              'version' => true,
 460              'warnings_expire_days' => true,
 461              'warnings_gc' => true,
 462   
 463              'num_files' => true,
 464              'num_posts' => true,
 465              'num_topics' => true,
 466              'num_users' => true,
 467              'record_online_users' => true,
 468          );
 469   
 470          $result = array();
 471          foreach ($config_vars as $name => $void)
 472          {
 473              if (isset($this->config[$name]))
 474              {
 475                  $result['config_' . $name] = $this->config[$name];
 476              }
 477          }
 478   
 479          global $db, $request;
 480   
 481          $result['dbms'] = $dbms;
 482          $result['acm_type'] = $acm_type;
 483          $result['user_agent'] = 'Unknown';
 484          $result['dbms_version'] = $db->sql_server_info(true);
 485   
 486          // Try to get user agent vendor and version
 487          $match = array();
 488          $user_agent = $request->header('User-Agent');
 489          $agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
 490   
 491          // We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/)
 492          foreach ($agents as $agent)
 493          {
 494              if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match))
 495              {
 496                  $result['user_agent'] = $match[1] . ' ' . $match[2];
 497                  break;
 498              }
 499          }
 500   
 501          return $result;
 502      }
 503  }
 504