コード例 #1
0
 function onInitializePlugin()
 {
     parent::onInitializePlugin();
     if (!isset($this->password_changeable) && $this->password_changeable) {
         throw new Exception("password_changeable cannot be set to true. This plugin does not support changing passwords.");
     }
 }
コード例 #2
0
 function onAutoload($cls)
 {
     switch ($cls) {
         case 'LdapCommon':
             require_once INSTALLDIR . '/plugins/LdapCommon/LdapCommon.php';
             return false;
     }
     return parent::onAutoload($cls);
 }
コード例 #3
0
 function onInitializePlugin()
 {
     parent::onInitializePlugin();
     if (!isset($this->attributes['nickname'])) {
         throw new Exception("must specify a nickname attribute");
     }
     if ($this->password_changeable && (!isset($this->attributes['password']) || !isset($this->password_encoding))) {
         throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified");
     }
     $this->ldapCommon = new LdapCommon(get_object_vars($this));
 }
コード例 #4
0
 function onInitializePlugin()
 {
     parent::onInitializePlugin();
     if (!isset($this->attributes['nickname'])) {
         // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
         throw new Exception(_m('You must specify a nickname attribute.'));
     }
     if ($this->password_changeable && (!isset($this->attributes['password']) || !isset($this->password_encoding))) {
         // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
         throw new Exception(_m('If password_changeable is set, the password attribute and password_encoding must also be specified.'));
     }
     $this->ldapCommon = new LdapCommon(get_object_vars($this));
 }
コード例 #5
0
 function onInitializePlugin()
 {
     parent::onInitializePlugin();
     if (!isset($this->host)) {
         throw new Exception("must specify a host");
     }
     if (!isset($this->basedn)) {
         throw new Exception("must specify a basedn");
     }
     if (!isset($this->attributes['nickname'])) {
         throw new Exception("must specify a nickname attribute");
     }
     if (!isset($this->attributes['username'])) {
         throw new Exception("must specify a username attribute");
     }
     if ($this->password_changeable && (!isset($this->attributes['password']) || !isset($this->password_encoding))) {
         throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified");
     }
 }
コード例 #6
0
 function onInitializePlugin()
 {
     parent::onInitializePlugin();
     if (!isset($this->server)) {
         throw new Exception(_m("Specifying a server is required."));
     }
     if (!isset($this->port)) {
         throw new Exception(_m("Specifying a port is required."));
     }
     if (!isset($this->path)) {
         throw new Exception(_m("Specifying a path is required."));
     }
     //These values need to be accessible to a action object
     //I can't think of any other way than global variables
     //to allow the action instance to be able to see values :-(
     global $casSettings;
     $casSettings = array();
     $casSettings['server'] = $this->server;
     $casSettings['port'] = $this->port;
     $casSettings['path'] = $this->path;
     $casSettings['takeOverLogin'] = $this->takeOverLogin;
 }