* @return string|false LDAP DN on success, otherwise false
*/
public function groupname2dn($name) {
- return $this->groupMapper->getDNbyName($name);
+ return $this->groupMapper->getDNByName($name);
}
/**
* @return string|false with the LDAP DN on success, otherwise false
*/
public function username2dn($name) {
- $fdn = $this->userMapper->getDNbyName($name);
+ $fdn = $this->userMapper->getDNByName($name);
//Check whether the DN belongs to the Base, to avoid issues on multi-
//server setups
}
}
if(!is_null($quota)) {
- $user = $this->userManager->get($this->uid)->setQuota($quota);
+ $this->userManager->get($this->uid)->setQuota($quota);
}
}
*/
private function setOwnCloudAvatar() {
if(!$this->image->valid()) {
- $this->log->log('user_ldap', 'jpegPhoto data invalid for '.$this->dn,
- \OCP\Util::ERROR);
+ $this->log->log('jpegPhoto data invalid for '.$this->dn, \OCP\Util::ERROR);
return;
}
//make sure it is a square and not bigger than 128x128
$size = min(array($this->image->width(), $this->image->height(), 128));
if(!$this->image->centerCrop($size)) {
- $this->log->log('user_ldap',
- 'croping image for avatar failed for '.$this->dn,
- \OCP\Util::ERROR);
+ $this->log->log('croping image for avatar failed for '.$this->dn, \OCP\Util::ERROR);
return;
}
public function getLDAPUserByLoginName($loginName) {
//find out dn of the user name
$attrs = $this->access->userManager->getAttributes();
- $users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1);
+ $users = $this->access->fetchUsersByLoginName($loginName, $attrs);
if(count($users) < 1) {
throw new \Exception('No user available for the given login name on ' .
$this->access->connection->ldapHost . ':' . $this->access->connection->ldapPort);
use OC\ServerNotAvailableException;
class Wizard extends LDAPUtility {
+ /** @var \OCP\IL10N */
static protected $l;
protected $access;
protected $cr;
$host = $this->configuration->ldapHost;
$hostInfo = parse_url($host);
if(!$hostInfo) {
- throw new \Exception($this->l->t('Invalid Host'));
+ throw new \Exception(self::$l->t('Invalid Host'));
}
\OCP\Util::writeLog('user_ldap', 'Wiz: Attempting to connect ', \OCP\Util::DEBUG);
$cr = $this->ldap->connect($host, $port);
if(!is_resource($cr)) {
- throw new \Exception($this->l->t('Invalid Host'));
+ throw new \Exception(self::$l->t('Invalid Host'));
}
\OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG);