[Pkg-owncloud-commits] [owncloud] 19/78: Support constructing an SMB_OC without saved session credentials
David Prévot
taffit at moszumanska.debian.org
Sun May 31 01:59:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 467da3c5195934b4f27e2303fe51479e66d3f606
Author: Robin McCorkell <rmccorkell at karoshi.org.uk>
Date: Fri Mar 20 15:55:53 2015 +0000
Support constructing an SMB_OC without saved session credentials
Conflicts:
apps/files_external/lib/smb_oc.php
---
apps/files_external/lib/smb_oc.php | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/apps/files_external/lib/smb_oc.php b/apps/files_external/lib/smb_oc.php
index 8ead750..5dedfaa 100644
--- a/apps/files_external/lib/smb_oc.php
+++ b/apps/files_external/lib/smb_oc.php
@@ -18,13 +18,19 @@ class SMB_OC extends \OC\Files\Storage\SMB {
* @throws \Exception
*/
public function __construct($params) {
- if (isset($params['host']) && \OC::$session->exists('smb-credentials')) {
+ if (isset($params['host'])) {
$host=$params['host'];
$this->username_as_share = ($params['username_as_share'] === 'true');
- $params_auth = json_decode(\OC::$server->getCrypto()->decrypt(\OC::$session->get('smb-credentials')), true);
- $user = \OC::$session->get('loginname');
- $password = $params_auth['password'];
+ $user = 'foo';
+ $password = 'bar';
+ if (\OC::$session->exists('smb-credentials')) {
+ $params_auth = json_decode(\OC::$server->getCrypto()->decrypt(\OC::$session->get('smb-credentials')), true);
+ $user = \OC::$session->get('loginname');
+ $password = $params_auth['password'];
+ } else {
+ // assume we are testing from the admin section
+ }
$root=isset($params['root'])?$params['root']:'/';
$share = '';
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list