FusionDirectory
|
This class is responsible for parsing and querying the fusiondirectory configuration file. More...
Public Member Functions | |
__construct ($filename, $basedir='') | |
Class constructor of the config class. More... | |
check_and_reload ($force=FALSE) | |
Check and reload the configuration. More... | |
parse ($filename) | |
Parse the given configuration file. More... | |
tag_open ($parser, $tag, $attrs) | |
Open xml tag when parsing the xml config. More... | |
tag_close ($parser, $tag) | |
Close xml tag when parsing the xml config. More... | |
get_credentials ($creds) | |
Get the password when needed from the config file. More... | |
get_ldap_link (bool $sizelimit=FALSE) | |
Get a LDAP link object. More... | |
set_current ($name) | |
Set the current location. More... | |
updateManagementConfig (string $managementClass, $managementConfig, bool $userConfig=FALSE) | |
Update the management config in the LDAP and the cache. | |
hasManagementConfig (string $managementClass, bool $userConfig=FALSE) | |
Test if there is a stored management config. | |
getManagementConfig ($managementClass) | |
Returns the config for a management class, or NULL. | |
searchHooks ($class, $value) | |
Search for hooks. More... | |
get_cfg_value ($name, $default='') | |
Get a configuration value from the config. More... | |
check_session_lifetime () | |
Check if session lifetime matches session.gc_maxlifetime. More... | |
snapshotEnabled () | |
Check if snapshot are enabled. More... | |
Data Fields | |
$current = [] | |
Store configuration for current location. | |
Protected Member Functions | |
storeDepartmentList () | |
Store the departments from ldap in $this->departmentList. | |
storeDepartmentTree () | |
Store the tree render for departments in $this->departmentTree. | |
This class is responsible for parsing and querying the fusiondirectory configuration file.
Definition at line 31 of file class_config.inc.
__construct | ( | $filename, | |
$basedir = '' |
|||
) |
Class constructor of the config class.
string | $filename | path to the configuration file |
string | $basedir | base directory |
Definition at line 76 of file class_config.inc.
References parse().
check_and_reload | ( | $force = FALSE | ) |
Check and reload the configuration.
This function checks if the configuration has changed, since it was read the last time and reloads it. It uses the file mtime to check weither the file changed or not.
Definition at line 93 of file class_config.inc.
References CACHE_DIR, CLASS_CACHE, session\get(), session\is_set(), parse(), session\set(), set_current(), and session\un_set().
check_session_lifetime | ( | ) |
Check if session lifetime matches session.gc_maxlifetime.
On debian systems the session files are deleted with a cronjob, which detects all files older than specified in php.ini:'session.gc_maxlifetime' and removes them. This function checks if the fusiondirectory.conf value matches the range defined by session.gc_maxlifetime.
Definition at line 854 of file class_config.inc.
References get_cfg_value().
get_cfg_value | ( | $name, | |
$default = '' |
|||
) |
Get a configuration value from the config.
This returns a configuration value from the config. It either uses the data of the current location ($this->current), if it contains the value (e.g. current['BASE']) or otherwise uses the data from the main configuration section.
If no value is found and an optional default has been specified, then the default is returned.
string | $name | The configuration key (case-insensitive) |
string | $default | A default that is returned, if no value is found |
Definition at line 821 of file class_config.inc.
Referenced by check_session_lifetime(), set_current(), and snapshotEnabled().
get_credentials | ( | $creds | ) |
Get the password when needed from the config file.
This function can be used to get the password associated to a keyword in the config file
string | $creds | the keyword associated to the password needed |
Definition at line 264 of file class_config.inc.
References cred_decrypt(), session\get(), htmlescape(), session\is_set(), and session\set().
Referenced by get_ldap_link().
get_ldap_link | ( | bool | $sizelimit = FALSE | ) |
Get a LDAP link object.
This function can be used to get an ldap object, which in turn can be used to query the LDAP. See the LDAP class for more information on how to use it.
Example usage:
boolean | $sizelimit | Weither to impose a sizelimit on the LDAP object or not. Defaults to false. If set to true, the size limit in the configuration file will be used to set the option LDAP_OPT_SIZELIMIT. |
Definition at line 307 of file class_config.inc.
References get_credentials(), htmlescape(), and LDAP\init().
Referenced by set_current(), storeDepartmentList(), and updateManagementConfig().
parse | ( | $filename | ) |
Parse the given configuration file.
Parses the configuration file and displays errors if there is something wrong with it.
string | $filename | The filename of the configuration file. |
Definition at line 123 of file class_config.inc.
References htmlescape().
Referenced by __construct(), and check_and_reload().
searchHooks | ( | $class, | |
$value | |||
) |
Search for hooks.
Example usage:
string | $class | The class name |
string | $value | Key to search in the hooks |
Definition at line 797 of file class_config.inc.
set_current | ( | $name | ) |
Set the current location.
string | $name | the name of the location |
Definition at line 343 of file class_config.inc.
References Lock\add(), CACHE_DIR, CLASS_CACHE, CONFIGRDN, DEBUG_CONFIG, Lock\deleteByObject(), get_cfg_value(), get_ldap_link(), htmlescape(), Language\init(), objects\open(), and session\set().
Referenced by check_and_reload().
snapshotEnabled | ( | ) |
Check if snapshot are enabled.
Definition at line 871 of file class_config.inc.
References class_available(), logging\debug(), get_cfg_value(), htmlescape(), session\is_set(), and session\set().
tag_close | ( | $parser, | |
$tag | |||
) |
Close xml tag when parsing the xml config.
string | $parser | |
string | $tag |
Definition at line 245 of file class_config.inc.
tag_open | ( | $parser, | |
$tag, | |||
$attrs | |||
) |
Open xml tag when parsing the xml config.
string | $parser | |
string | $tag | |
string | $attrs |
Definition at line 163 of file class_config.inc.