function __construct() { Event::addHandler('InitializePlugin', array($this, 'initialize')); Event::addHandler('CleanupPlugin', array($this, 'cleanup')); foreach (get_class_methods($this) as $method) { if (mb_substr($method, 0, 2) == 'on') { Event::addHandler(mb_substr($method, 2), array($this, $method)); } } }
public function __construct($config) { Event::addHandler('Autoload', array($this, 'onAutoload')); foreach ($config as $key => $value) { $this->{$key} = $value; } $this->ldap_config = $this->get_ldap_config(); if (!isset($this->host)) { throw new Exception(_m("A host must be specified.")); } if (!isset($this->basedn)) { throw new Exception(_m('"basedn" must be specified.')); } if (!isset($this->attributes['username'])) { throw new Exception(_m('The username attribute must be set.')); } }
public function __construct($config) { Event::addHandler('Autoload', array($this, 'onAutoload')); foreach ($config as $key => $value) { $this->{$key} = $value; } $this->ldap_config = $this->get_ldap_config(); if (!isset($this->host)) { // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration. throw new Exception(_m('A host must be specified.')); } if (!isset($this->basedn)) { // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration. throw new Exception(_m('"basedn" must be specified.')); } if (!isset($this->attributes['username'])) { // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration. throw new Exception(_m('The username attribute must be set.')); } }