/** * listens to a hook thrown by server2server sharing and replaces the given * login name by a username, if it matches an LDAP user. * * @param array $param * @throws \Exception */ public static function loginName2UserName($param) { if (!isset($param['uid'])) { throw new \Exception('key uid is expected to be set in $param'); } //ain't it ironic? $helper = new Helper(); $configPrefixes = $helper->getServerConfigurationPrefixes(true); $ldapWrapper = new LDAP(); $ocConfig = \OC::$server->getConfig(); $userBackend = new User_Proxy($configPrefixes, $ldapWrapper, $ocConfig); $uid = $userBackend->loginName2UserName($param['uid']); if ($uid !== false) { $param['uid'] = $uid; } }