Merge pull request #314 from owncloud/kill_oc_session
use accessor to get session
This commit is contained in:
commit
4a25c13a52
@ -99,9 +99,10 @@ class File {
|
|||||||
public function checkPassword($password){
|
public function checkPassword($password){
|
||||||
$shareId = $this->getShareId();
|
$shareId = $this->getShareId();
|
||||||
if (!$this->isPasswordProtected()
|
if (!$this->isPasswordProtected()
|
||||||
|| (\OC::$session->exists('public_link_authenticated')
|
|| (\OC::$server->getSession()->exists('public_link_authenticated')
|
||||||
&& \OC::$session->get('public_link_authenticated') === $shareId)
|
&& \OC::$server->getSession()->get('public_link_authenticated') === $shareId
|
||||||
){
|
)
|
||||||
|
){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ class File {
|
|||||||
if ($hasher->CheckPassword($password.\OC_Config::getValue('passwordsalt', ''),
|
if ($hasher->CheckPassword($password.\OC_Config::getValue('passwordsalt', ''),
|
||||||
$this->getPassword())) {
|
$this->getPassword())) {
|
||||||
// Save item id in session for future request
|
// Save item id in session for future request
|
||||||
\OC::$session->set('public_link_authenticated', $shareId);
|
\OC::$server->getSession()->set('public_link_authenticated', $shareId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user