phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: GeneralSettings

Source Location: /qp_inc/settings/model/_generalsettings.class.php

Class GeneralSettings

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From AbstractSettings

AbstractSettings::$all_loaded
AbstractSettings::$cache
AbstractSettings::$cache_by_col_keys
AbstractSettings::$col_key_names
AbstractSettings::$col_value_name
AbstractSettings::$db_table_name

Inherited From AbstractSettings

AbstractSettings::AbstractSettings()
Constructor.
AbstractSettings::dbupdate()
Commit changed settings to DB.
AbstractSettings::delete()
Remove a setting.
AbstractSettings::delete_array()
Delete an array of values.
AbstractSettings::get()
Get a setting from the DB settings table.
AbstractSettings::get_cond()
Only set the first variable (passed by reference) if we could retrieve a setting.
AbstractSettings::get_default()
Get the default for the last key of $col_key_names
AbstractSettings::load_all()
Load all settings, disregarding the derived classes setting of $cache_by_col_keys
  • useful if you know that you want to get
all user settings for example.
AbstractSettings::reset()
Reset cache (includes settings to be written to DB).
AbstractSettings::restore_defaults()
Delete values for $_defaults in DB.
AbstractSettings::set()
Temporarily sets a setting (dbupdate() writes it to DB).
AbstractSettings::set_array()
Set an array of values.
AbstractSettings::_load()
Loads the settings. Not meant to be called directly, but gets called when needed.

[ Top ]
Property Summary
array   $_defaults   The default settings to use, when a setting is not given in the database.

[ Top ]
Method Summary
GeneralSettings   GeneralSettings()   Constructor.
string   get_public_key_salt()   Get a 32-byte string that can be used as salt for public keys.

[ Top ]
Properties
array   $_defaults = array(
// Global settings -> General subtab
// "After each new post..." section
'outbound_notifications_mode' => 'immediate', // 'off', 'immediate', 'cron'
// "Blog by email" section
'eblog_enabled' => 0,
'eblog_method' => 'pop3',
'eblog_server_port' => 110,
'eblog_encrypt' => 'none',
'eblog_default_category' => 1,
'eblog_subject_prefix' => 'blog:',
'eblog_add_imgtag' => 1,
'AutoBR' => 0,
'eblog_body_terminator' => '___',
// "Categories" section
'allow_moving_chapters' => '0',
'chapter_ordering' => 'alpha',
// "Default user permissions" section
'newusers_canregister' => '0',
'newusers_level' => '1',
// "Display options" section
'default_admin_template' => 'wind',
// "Email validation" section
'newusers_mustvalidate' => '1',
'newusers_revalidate_emailchg' => '0',
// "Features" section
'fm_enabled' => '1',
'general_cache_enabled' => 0,
'webhelp_enabled' => '0',
// "Hit & session logging" section
'log_public_hits' => '1',
'log_admin_hits' => '0',
'auto_prune_stats_mode' => 'page', // 'off', 'page', 'cron'
'auto_prune_stats' => '15',
// "Security options" section
'user_minpwdlen' => '5',
'js_passwd_hashing' => '1',
// "Timeouts" section
'timeout_sessions' => '604800', // (in seconds, 604800 == 7 days)
'reloadpage_timeout' => '300',

// Global settings -> Files subtab
// "Accessible file roots" section
'fm_enable_roots_blog' => '1',
'fm_enable_roots_user' => '1',
'fm_enable_roots_shared' => '1',
'fm_enable_roots_templates' => '0',
// "File creation options" section
'fm_enable_create_dir' => '1',
'fm_enable_create_file' => '1',
'upload_enabled' => '1',
'upload_maxkb' => '2048',
// "Advanced options" section
'fm_default_chmod_file' => '664',
'fm_default_chmod_dir' => '775',
'regexp_filename' => '^[a-zA-Z0-9\-_. ]+$', // TODO: accept (spaces and) special chars / do full testing on this
'regexp_dirname' => '^[a-zA-Z0-9\-_]+$', // TODO: accept spaces and special chars / do full testing on this

// not sorted by tab/subtab/section yet...
'fm_showtypes' => '0',
'fm_showfsperms' => '0',
'log_spam_hits' => '0',
'antispam_last_update' => '2000-01-01 00:00:00',
'antispam_threshold_publish' => '-90',
'antispam_threshold_delete' => '100', // do not delete by default!
'antispam_block_spam_referers' => '0', // By default, let spam referers go in silently (just don't log them). This is in case the blacklist is too paranoid (social media, etc.)
'antispam_report_to_central' => '1',
'time_difference' => '0',
)
[line 57]

The default settings to use, when a setting is not given in the database.

The following are set and reset on Global settings -> general and have no defined defaults: 'eblog_server_host', 'eblog_username', 'eblog_password', 'eblog_novalidatecert', 'eblog_body_terminator', 'eblog_test_mode', 'newusers_grp_ID', 'default_blog_ID',

API Tags:
Access:  protected

Information Tags:
Todo:  (legacy): Allow overriding from /qp_config/_config_TEST.php?
Todo:  EdB: IMPORTANT! make this be configurable new user defaults one day

Redefinition of:
AbstractSettings::$_defaults
Default settings.

[ Top ]
Methods
Constructor GeneralSettings  [line 139]

  GeneralSettings GeneralSettings( )

Constructor.

This loads the general settings and checks db_version.

It will also turn off error-reporting/halting of the DB object temporarily to present a more decent error message if tables do not exist yet.

Because the DB object itself creates a connection when it gets created "Error selecting database" occurs before we can check for it here.



[ Top ]
get_public_key_salt  [line 179]

  string get_public_key_salt( )

Get a 32-byte string that can be used as salt for public keys.



[ Top ]