pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
867 stars 289 forks source link

smb not use settings in smb drivers options since pydio 7.x #1290

Closed Nanomani closed 7 years ago

Nanomani commented 7 years ago

smb not used option defined in "settings SMB drivers" since pydio 7.x. this must be defined manually in smb.php line 33 and line 37

if (!defined('SMB4PHP_SMBCLIENT')) {
    define ('SMB4PHP_SMBCLIENT', 'your_path_to_smbclient');
}

if (!defined('SMB4PHP_SMBTMP')) {
    define ('SMB4PHP_SMBTMP', 'your_path_to_tmp_folder');
}

Tested with Windows OS Pydio 7.x to pydio 7.0.1 Apache 2.4.23 + FCGI Php 5.6.27

Nanomani commented 7 years ago

comment line 95 in SMBAccessDriver.php

// require_once($this->getBaseDir()."/smb.php");

or comment whole function "public function detectStreamWrapper" in SMBAccessDriver.php

   /* public function detectStreamWrapper($register = false, ContextInterface $ctx = null)
    {
        if ($register) {
            require_once($this->getBaseDir()."/smb.php");
        }
        return parent::detectStreamWrapper($register, $ctx);
    } */

fix this issue

File and folder are displayed Operation on files, on folders works well (rename, copy, move, delete, download, compress, share, drag and drop)

cdujeu commented 7 years ago

mmm, i'm a bit reluctant to remove that. Could you try to apply the attached patch and see if it works as well? Always_set_options_before_loading_external_smb_php_file.patch.zip

Nanomani commented 7 years ago

Done. File.patch applied. Same issue Same workaround Comment Line 99 "$this->loadExternalWrapper();"

cdujeu commented 7 years ago

yes sorry, typo in my patch. Try that (and leave the call on line 99)?

protected function loadExternalWrapper(){
    if(!empty($this->pluginConf["SMBCLIENT"])){
        define ('SMB4PHP_SMBCLIENT', $this->pluginConf["SMBCLIENT"]);
    }
    if(!empty($this->pluginConf["SMB_PATH_TMP"])){
        define ('SMB4PHP_SMBTMP', $this->pluginConf["SMB_PATH_TMP"]);
    }
    require_once($this->getBaseDir()."/smb.php");
}
cdujeu commented 7 years ago

Should even be :

protected function loadExternalWrapper(){
    if(!empty($this->pluginConf['SMBCLIENT']) && !defined('SMB4PHP_SMBCLIENT')){
        define ('SMB4PHP_SMBCLIENT', $this->pluginConf["SMBCLIENT"]);
    }
    if(!empty($this->pluginConf['SMB_PATH_TMP']) && !defined('SMB_PATH_TMP')){
        define ('SMB4PHP_SMBTMP', $this->pluginConf["SMB_PATH_TMP"]);
    }
    require_once($this->getBaseDir()."/smb.php");
}
cdujeu commented 7 years ago

for me it's working (was indeed broken before these changes).

Nanomani commented 7 years ago

Yep, I confirme too. It fixed now thx

cdujeu commented 7 years ago

(will be closed on commit / push)

Nanomani commented 7 years ago

Ok ok understood. :-)