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

Commit 6ad0370

Browse files
committed
include domain name to user name
1 parent 47a2c2a commit 6ad0370

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

core/src/plugins/auth.smb/class.smbAuthDriver.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function logoutCallback($actionName, $httpVars, $fileVars)
5656

5757
public function checkPassword($login, $pass, $seed)
5858
{
59-
require_once(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/access.smb/smb.php");
59+
require_once(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/access.smb/smb.php");
6060

6161
$_SESSION["AJXP_SESSION_REMOTE_PASS"] = $pass;
6262
$repoId = $this->options["REPOSITORY_ID"];
@@ -66,7 +66,15 @@ public function checkPassword($login, $pass, $seed)
6666
$basePath = $repoObject->getOption("PATH", true);
6767
$basePath = str_replace("AJXP_USER", $login, $basePath);
6868
$host = $repoObject->getOption("HOST");
69-
$url = "smb://$login:$pass@".$host."/".$basePath."/";
69+
$domain = $repoObject->getOption("DOMAIN", true);
70+
$smbPath = $repoObject->getOption("PATH", true);
71+
72+
if(!empty($domain)){
73+
$login = $domain.$login;
74+
}
75+
$strTmp = "$login:$pass@".$host."/".$basePath."/".$smbPath."/";
76+
$strTmp = str_replace("//", "/",$strTmp);
77+
$url = "smb://".$strTmp;
7078
try {
7179
if (!is_dir($url)) {
7280
$this->logDebug("SMB Login failure");

0 commit comments

Comments
 (0)