2018-10-09 14:14:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Config {
|
2019-03-28 15:35:34 +01:00
|
|
|
private static $name='Evoadmin Mail', $mail='root@localhost', $log_level='error', $ldap=array(), $quota_path='';
|
2018-12-05 11:25:57 +01:00
|
|
|
public static function load() {
|
|
|
|
$file = getenv("EVOADMINMAIL_CONFIG_FILE") or $file = '../config/config.ini';
|
2018-10-09 14:14:58 +02:00
|
|
|
$ini = parse_ini_file($file, true);
|
|
|
|
self::$name = $ini['global']['name'];
|
|
|
|
self::$mail = $ini['global']['mail'];
|
|
|
|
self::$log_level = $ini['global']['log_level'];
|
|
|
|
self::$ldap = $ini['ldap'];
|
2019-03-28 15:35:34 +01:00
|
|
|
self::$quota_path = $ini['quota']['path'];
|
2018-10-09 14:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getName() {
|
|
|
|
return self::$name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getMail() {
|
|
|
|
return self::$mail;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getLogLevel() {
|
|
|
|
return self::$log_level;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getLdapUri() {
|
|
|
|
return 'ldap://'.self::$ldap['host'].':'.self::$ldap['port'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getLdapDN() {
|
|
|
|
return self::$ldap['admin_dn'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getLdapPass() {
|
|
|
|
return self::$ldap['admin_pass'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getLdapBase() {
|
|
|
|
return self::$ldap['base'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getSuperadmin() {
|
|
|
|
return self::$ldap['superadmin'];
|
|
|
|
}
|
2019-03-28 15:35:34 +01:00
|
|
|
|
|
|
|
public static function getQuotaPath() {
|
|
|
|
return self::$quota_path;
|
|
|
|
}
|
2022-04-05 17:02:05 +02:00
|
|
|
|
|
|
|
public static function getEvoexec() {
|
|
|
|
return self::$evoexec['sudobin'].' '.self::$evoexec['sudoscript'].' -p '.self::$evoexec['sudopass'].' ';
|
|
|
|
}
|
|
|
|
|
2018-10-09 14:14:58 +02:00
|
|
|
}
|