Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\Core\Preferences Class Reference
Collaboration diagram for Galette\Core\Preferences:

Public Member Functions

 __construct (Db $zdb, bool $load=true)
 
 load ()
 
 installInit (string $lang, string $adm_login, string $adm_pass)
 
 getFieldsNames ()
 
 check (array $values, Login $login)
 
 validateValue (string $fieldname, mixed $value)
 
 store ()
 
 getPostalAddress ()
 
 showPublicPages (Authentication $login)
 
 __get (string $name)
 
 __isset (string $name)
 
 getDefaults ()
 
 __set (string $name, mixed $value)
 
 getURL ()
 
 getDefaultURL ()
 
 getTelemetryDate ()
 
 getRegistrationDate ()
 
 getErrors ()
 
 getLegend ()
 
 getMailSignature (PHPMailer $mail)
 
 setSocialReplacements ()
 
 cleanHtmlValue (string $value)
 

Public Attributes

const TABLE = 'preferences'
 
const PK = 'nom_pref'
 
const POSTAL_ADDRESS_FROM_PREFS = 0
 
const POSTAL_ADDRESS_FROM_STAFF = 1
 
const PUBLIC_PAGES_VISIBILITY_PUBLIC = 0
 
const PUBLIC_PAGES_VISIBILITY_RESTRICTED = 1
 
const PUBLIC_PAGES_VISIBILITY_PRIVATE = 2
 
const LOG_DISABLED = 0
 
const LOG_ENABLED = 1
 
const PWD_NONE = 0
 
const PWD_WEAK = 1
 
const PWD_MEDIUM = 2
 
const PWD_STRONG = 3
 
const PWD_VERY_STRONG = 4
 

Protected Member Functions

 getSignaturePatterns (bool $legacy=true)
 

Protected Attributes

Preferences $preferences
 

Constructor & Destructor Documentation

◆ __construct()

Galette\Core\Preferences::__construct ( Db  $zdb,
bool  $load = true 
)

Default constructor

Parameters
Db$zdbDb instance
boolean$loadAutomatically load preferences on load
Returns
void

Member Function Documentation

◆ __get()

Galette\Core\Preferences::__get ( string  $name)

Global getter method

Parameters
string$namename of the property we want to retrieve
Returns
mixed the called property

◆ __isset()

Galette\Core\Preferences::__isset ( string  $name)

Global isset method Required for twig to access properties via __get

Parameters
string$namename of the property we want to retrieve
Returns
bool

◆ __set()

Galette\Core\Preferences::__set ( string  $name,
mixed  $value 
)

Global setter method

Parameters
string$namename of the property we want to assign a value to
mixed$valuea relevant value for the property
Returns
void

◆ check()

Galette\Core\Preferences::check ( array  $values,
Login  $login 
)

Check values

Parameters
array<string,mixed>$values Values
Login$loginLogged in user
Returns
boolean

◆ cleanHtmlValue()

Galette\Core\Preferences::cleanHtmlValue ( string  $value)

Purify HTML value

Parameters
string$valueValue to clean
Returns
string

◆ getDefaults()

Galette\Core\Preferences::getDefaults ( )

Get default preferences

Returns
array<string, mixed>

◆ getDefaultURL()

Galette\Core\Preferences::getDefaultURL ( )

Get default URL (when not set by user in preferences)

Returns
string

◆ getErrors()

Galette\Core\Preferences::getErrors ( )

Get errors

Returns
array<string>

◆ getFieldsNames()

Galette\Core\Preferences::getFieldsNames ( )

Returns all preferences keys

Returns
array<string>

◆ getLegend()

Galette\Core\Preferences::getLegend ( )

Build legend array

Returns
array<string, array<string, string>>

◆ getMailSignature()

Galette\Core\Preferences::getMailSignature ( PHPMailer  $mail)

Get email signature

Parameters
PHPMailer$mailPHPMailer instance
Returns
string

◆ getPostalAddress()

Galette\Core\Preferences::getPostalAddress ( )

Returns postal address

Returns
string postal address

◆ getRegistrationDate()

Galette\Core\Preferences::getRegistrationDate ( )

Get last telemetry registration date

Returns
string|null

◆ getSignaturePatterns()

Galette\Core\Preferences::getSignaturePatterns ( bool  $legacy = true)
protected

Get patterns for mail signature

Parameters
boolean$legacyWhether to load legacy patterns
Returns
array<string, array<string, string>>

◆ getTelemetryDate()

Galette\Core\Preferences::getTelemetryDate ( )

Get last telemetry date

Returns
string

◆ getURL()

Galette\Core\Preferences::getURL ( )

Get instance URL from configuration (if set) or guessed if not

Returns
string

◆ installInit()

Galette\Core\Preferences::installInit ( string  $lang,
string  $adm_login,
string  $adm_pass 
)

Set default preferences at install time

Parameters
string$langlanguage selected at install screen
string$adm_loginadmin login entered at install time
string$adm_passadmin password entered at install time
Returns
boolean
Exceptions
Throwable

◆ load()

Galette\Core\Preferences::load ( )

Load current preferences from database.

Returns
boolean

◆ setSocialReplacements()

Galette\Core\Preferences::setSocialReplacements ( )

Set emails replacements

Returns
$this

◆ showPublicPages()

Galette\Core\Preferences::showPublicPages ( Authentication  $login)

Are public pages visible?

Parameters
Authentication$loginAuthentication instance
Returns
boolean

◆ store()

Galette\Core\Preferences::store ( )

Will store all preferences in the database

Returns
boolean

◆ validateValue()

Galette\Core\Preferences::validateValue ( string  $fieldname,
mixed  $value 
)

Validate value of a field

Parameters
string$fieldnameField name
mixed$valueValue to be set
Returns
mixed

Member Data Documentation

◆ POSTAL_ADDRESS_FROM_PREFS

const Galette\Core\Preferences::POSTAL_ADDRESS_FROM_PREFS = 0

Postal address will be the one given in the preferences

◆ POSTAL_ADDRESS_FROM_STAFF

const Galette\Core\Preferences::POSTAL_ADDRESS_FROM_STAFF = 1

Postal address will be the one of the selected staff member

◆ PUBLIC_PAGES_VISIBILITY_PRIVATE

const Galette\Core\Preferences::PUBLIC_PAGES_VISIBILITY_PRIVATE = 2

Public pages are visibles for admin and staff members only

◆ PUBLIC_PAGES_VISIBILITY_PUBLIC

const Galette\Core\Preferences::PUBLIC_PAGES_VISIBILITY_PUBLIC = 0

Public pages stuff Public pages are publically visibles

◆ PUBLIC_PAGES_VISIBILITY_RESTRICTED

const Galette\Core\Preferences::PUBLIC_PAGES_VISIBILITY_RESTRICTED = 1

Public pages are visibles for up to date members only

◆ PWD_MEDIUM

const Galette\Core\Preferences::PWD_MEDIUM = 2

Medium password strength

◆ PWD_NONE

const Galette\Core\Preferences::PWD_NONE = 0

No password strength

◆ PWD_STRONG

const Galette\Core\Preferences::PWD_STRONG = 3

Strong password strength

◆ PWD_VERY_STRONG

const Galette\Core\Preferences::PWD_VERY_STRONG = 4

Very strong password strength

◆ PWD_WEAK

const Galette\Core\Preferences::PWD_WEAK = 1

Weak password strength


The documentation for this class was generated from the following file: