Fix several minor issues

This commit is contained in:
Joas Schilling 2016-05-12 16:55:58 +02:00
parent db2e9df5f0
commit b616318327
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
4 changed files with 9 additions and 11 deletions

View File

@ -316,7 +316,7 @@ class Access extends LDAPUtility implements IUserTools {
* @return string|false LDAP DN on success, otherwise false
*/
public function groupname2dn($name) {
return $this->groupMapper->getDNbyName($name);
return $this->groupMapper->getDNByName($name);
}
/**
@ -325,7 +325,7 @@ class Access extends LDAPUtility implements IUserTools {
* @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

View File

@ -464,7 +464,7 @@ class User {
}
}
if(!is_null($quota)) {
$user = $this->userManager->get($this->uid)->setQuota($quota);
$this->userManager->get($this->uid)->setQuota($quota);
}
}
@ -502,16 +502,13 @@ class User {
*/
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;
}

View File

@ -98,7 +98,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
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);

View File

@ -34,6 +34,7 @@ namespace OCA\User_LDAP;
use OC\ServerNotAvailableException;
class Wizard extends LDAPUtility {
/** @var \OCP\IL10N */
static protected $l;
protected $access;
protected $cr;
@ -1033,12 +1034,12 @@ class Wizard extends LDAPUtility {
$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);