getFirstValue($data, 'cn'); $dn = $this->getFirstValue($data, 'dn'); // This must match the ID in the config.php $info = new SSOAccountInfo('example', $cn); // Set validity $info->expire = strtotime('+2 years'); // Set name and email address $info->nameFirst = $this->getFirstValue($data, 'givenname'); $info->nameLast = $this->getFirstValue($data, 'sn'); $info->email = $this->getFirstValue($data, 'mail'); // Eventually allow server administration if ($this->memberOf($dn, 'CN=SoSci_Admins,OU=F,OU=Groups,OU=LM,OU=IAM,DC=ads,DC=example,DC=com')) { $info->authorized = true; $info->addServerAuth(Account::SERVER_ADMIN); } else { // Specify survey usage auth $info->authorized = $this->memberOf($dn, 'CN=SoSci_Users,OU=F,OU=Groups,OU=LM,OU=IAM,DC=ads,DC=example,DC=com'); } return $info; } /** * Tell whether to convert existing account with the same email address to SSO accounts. * @return boolean */ public function getConvertAccount() { return true; } }