Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropbox connection #1596

Closed
applibs opened this issue Aug 15, 2016 · 28 comments
Closed

Dropbox connection #1596

applibs opened this issue Aug 15, 2016 · 28 comments
Assignees

Comments

@applibs
Copy link

applibs commented Aug 15, 2016

I already have access tokens to dropbox, but elfinder need confirm connection.
I passed it into accessToken and accessTokenSecret in $opts.

@nao-pon
Copy link
Member

nao-pon commented Aug 15, 2016

@standus Please set 'consumerKey', 'consumerSecret', 'accessToken' and 'accessTokenSecret' in volume root options.

@applibs
Copy link
Author

applibs commented Aug 15, 2016

Sure I have it too, but EF still want user confirm.

@nao-pon
Copy link
Member

nao-pon commented Aug 15, 2016

I tested with next config. It was no problem.

array(
    'driver' => 'Dropbox',
    'consumerKey' => 'xxxxx',
    'consumerSecret' => 'xxxxx',
    'accessToken' => 'xxxxx',
    'accessTokenSecret' => 'xxxxx',
    'path' => '/Public',
);

@applibs
Copy link
Author

applibs commented Aug 15, 2016

I tested on clean install as multiroot:
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'Dropbox',
'path' => '/Public',
'consumerKey'=>'myvalue',
'consumerSecret'=>'myvalue',
'accessToken'=>'myvalue',
'accessTokenSecret'=>'myvalue',
),
array(
'driver' => 'LocalFileSystem',
'path' => '../files/',
'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/',
'alias' => 'FileSystem',
'accessControl' => 'access' ,
'uploadDeny' => array('all'),
'uploadAllow' => array('image', 'text/plain'),
'uploadOrder' => array('deny', 'allow'),
'accessControl' => 'access'
)
)
);

but Dropbox is not listed on left.

@nao-pon
Copy link
Member

nao-pon commented Aug 15, 2016

Please set 'debug' => true, and check about dialog - debug tab - debug section.

This is example of wrong accessTokenSecret config.
fireshot capture 5 - demo_elfinder 2 1_ - http___hypweb net_elfinder-nightly_demo_develop_

@applibs
Copy link
Author

applibs commented Aug 15, 2016

Driver "elFinderVolumeDropbox" : Root folder does not exist.
I tried :
'path' => '/Public',
'path' => '/',
but always same error and not visible on left root folders.

@nao-pon
Copy link
Member

nao-pon commented Aug 15, 2016

Can you connect with netmount?

@applibs
Copy link
Author

applibs commented Aug 15, 2016

No.

@applibs
Copy link
Author

applibs commented Aug 15, 2016

When I disable
if (!$root) {
//return $this->setError('Root folder does not exist.');
}
then I have:
if (!$root) {
//return $this->setError('Root folder does not exist.');
}
When I diasable
if (!$root['read'] && !$root['write']) {
//return $this->setError('Root folder has not read and write permissions.');
}
then still errors.

I see next function ->stat(..) and inside:
$ret = isset($this->cache[$path]) //where $path is '/'
is always return empty array.
Then i see empty on if (isset($this->sessionCache['rootstat'][$rootKey]))
Then it goes to function private function getDBdat($path) {} and there is some DB query. Why db query?

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Did you make dropbox App as Full Dropbox?

@applibs
Copy link
Author

applibs commented Aug 16, 2016

As Full too. Result is always the same:
Driver "elFinderVolumeDropbox" : Root folder does not exist.

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Witch version of elFinder are you using? Please try latest version or latest nightly.

@applibs
Copy link
Author

applibs commented Aug 16, 2016

2.1.14

---------- Původní zpráva ----------

Od: Naoki Sawada notifications@github.com

Komu: Studio-42/elFinder elFinder@noreply.github.com

Datum: 16. 8. 2016 9:06:06

Předmět: Re: [Studio-42/elFinder] Dropbox connection (#1596)

"

Witch version of elFinder are you using? Please try latest version or latest
nightly(https://github.com/Studio-42/elFinder/archive/2.1.zip).

You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
(#1596 (comment)),
or mute the thread
(https://github.com/notifications/unsubscribe-auth/AEmF_rJTRJwmsamHjkHyGwd6S-rq8v5Dks5qgWFcgaJpZM4JkZov)
.

"=

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

I can't reproduce this issue in my site. Could you do debug of elFinderVolumeDropbox.class.php _stat() , deltaCheck(), parseRaw(), etc...?

@applibs
Copy link
Author

applibs commented Aug 16, 2016

all functions return empty array. when i debug localfilesystem then always
is array full. i will try it more debug. i am time limited.

---------- Původní zpráva ----------

Od: Naoki Sawada

Datum: 16. 8. 2016 v 13:04:32

Předmět: Re: [Studio-42/elFinder] Dropbox connection (#1596)

I can't reproduce this issue in my site. Could you do debug of
elFinderVolumeDropbox.class.php _stat() , getDBdat(), parseRaw(), etc...?

You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
(#1596 (comment)),
or mute the thread
(https://github.com/notifications/unsubscribe-auth/AEmF_msNOOFWPRPQJMlDQWYJNup7JMk2ks5qgZktgaJpZM4JkZov)
.

@applibs
Copy link
Author

applibs commented Aug 16, 2016

in function _stat($path) return isMyReload() and then it goes to getDBdat($path), but in getDBdat is request with SQL query. Why query to DB as I said berofe? Nowhere in documentation is not information about DB connection.

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Dropbox driver use SQLite DB for cache. DB data file(.elFinder_dropbox_db_[unique key]) will be created in tmp directory(option metaCachePath, tmpPath, tmbPath or elFinder::commonTempPath).

@applibs
Copy link
Author

applibs commented Aug 16, 2016

OK, maybe some problem with my Win OS?
DB file is created, Connection works.

@applibs
Copy link
Author

applibs commented Aug 16, 2016

mount(array $opts) cals: stat($path)
in stat($path):
$this->_stat('/') always return false
$this->convEncOut($stat) always return false
$this->updateCache alwayr seturn array(0)
and in final $root = $this->stat($this->root); return empty array.
result is return $this->setError('Root folder does not exist.');

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Would you try to clear session cache by browser restart?

@applibs
Copy link
Author

applibs commented Aug 16, 2016

Done, no good result. Same another browsers.

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

umm... I don't get it.

I have test site on XAMPP 5.6.23 (Windows 10). That is no problem.

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Do you have any error messages in the debug tab of the info dialog?

@applibs
Copy link
Author

applibs commented Aug 16, 2016

Here is my sources and try it on your PC please.
elfinder.zip

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

I got same error. I'll debug it.

@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

Could you try install pear/http_oauth?

@nao-pon nao-pon self-assigned this Aug 16, 2016
@nao-pon
Copy link
Member

nao-pon commented Aug 16, 2016

I found a bug and fixed it. @standus Thanks! 👍

Please delete DB file before retry with this fix.

@applibs
Copy link
Author

applibs commented Aug 16, 2016

I confirm that it works now. Without any pear libs. Thanks too Naoki. Perfect cooperation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants