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

Commit

Permalink
Fixes to SMB auth:
Browse files Browse the repository at this point in the history
- Registered stream is smbclient://, not smb://
- smbclient binary path could not be set for auth plugin
  • Loading branch information
gboor committed Feb 19, 2016
1 parent f1550b7 commit 44fa9dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/src/plugins/auth.smb/class.smbAuthDriver.php
Expand Up @@ -56,7 +56,12 @@ public function logoutCallback($actionName, $httpVars, $fileVars)

public function checkPassword($login, $pass, $seed)
{
require_once(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/access.smb/smb.php");
if(!defined('SMB4PHP_SMBCLIENT'))
{
define('SMB4PHP_SMBCLIENT', $this->pluginConf["SMBCLIENT"]);
}

require_once(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/access.smb/smb.php");

$_SESSION["AJXP_SESSION_REMOTE_PASS"] = $pass;
$repoId = $this->options["REPOSITORY_ID"];
Expand All @@ -74,7 +79,7 @@ public function checkPassword($login, $pass, $seed)
}
$strTmp = "$login:$pass@".$host."/".$basePath."/";
$strTmp = str_replace("//", "/",$strTmp);
$url = "smb://".$strTmp;
$url = "smbclient://".$strTmp;
try {
if (!is_dir($url)) {
$this->logDebug("SMB Login failure");
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/auth.smb/manifest.xml
Expand Up @@ -8,6 +8,7 @@
<server_settings>
<param name="REPOSITORY_ID" type="select" choices="json_list:list_all_repositories_json" label="CONF_MESSAGE[Workspace]" description="CONF_MESSAGE[ID of the workspace used to validate credentials]" mandatory="true"/>
<param name="ADMIN_USER" type="string" label="CONF_MESSAGE[Admin user]" description="CONF_MESSAGE[The ID of an existing admin for Pydio (using conf.serial)]" mandatory="true"/>
<global_param name="SMBCLIENT" type="string" label="CONF_MESSAGE[Smbclient]" description="CONF_MESSAGE[Path to smbclient executable, considered to be in the path by default.]" mandatory="true" default="smbclient"/>
</server_settings>
<class_definition filename="plugins/auth.smb/class.smbAuthDriver.php" classname="smbAuthDriver"/>
<registry_contributions>
Expand Down

0 comments on commit 44fa9dd

Please sign in to comment.