Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix collabora on smb + session credential workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Sep 18, 2017
1 parent a008516 commit a9009ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions core/src/core/src/pydio/Core/Http/Wopi/AuthFrontend.php
Expand Up @@ -137,6 +137,12 @@ function tryToLogUser(ServerRequestInterface &$request, ResponseInterface &$resp
$token = $payload->token;
$task = $payload->task;

// store encrypted user's credential in cache.
$sessionId = $payload->session_id;
$encryptedString = CacheService::fetch(AJXP_CACHE_SERVICE_NS_SHARED, $sessionId);
$credential = MemorySafe::getCredentialsFromEncodedString($encryptedString);
MemorySafe::storeCredentials($credential["user"], $credential["password"]);

$key = ApiKeysService::findPairForAdminTask($task, $currentUser->getId());

if ($key["t"] !== $token) {
Expand Down
21 changes: 20 additions & 1 deletion core/src/plugins/auth.ldap/LdapAuthDriver.php
Expand Up @@ -425,7 +425,7 @@ public function getUserEntries($login = null, $countOnly = false, $offset = -1,
}
if ($isSupportPagedResult)
foreach ($ret as $element) {
if (is_resource($element))
if (is_resource($element) && count($allEntries["count"]) > 1)
@ldap_control_paged_result_response($this->ldapconn, $element, $cookie);
}
} while (($cookie !== null && $cookie != '') && ($isSupportPagedResult) && (!$gotAllEntries));
Expand Down Expand Up @@ -1176,4 +1176,23 @@ public function sanitize($s, $level = InputFilter::SANITIZE_HTML)
$newS = preg_replace($preg, '_', $s);
return $newS;
}

/*
public $rebind_dn;
public $rebind_pass;
function rebind($ldap, $referral) {
$server= preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $referral);
if (!($ldap = ldap_connect($server))){
return true;
}
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 1);
ldap_set_rebind_proc($ldap, "rebind");
if (!ldap_bind($ldap,$this->rebind_dn,$this->rebind_pass)){
return true;
}
return 0;
}
*/
}

0 comments on commit a9009ea

Please sign in to comment.