Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
index a390d11d79..559d4540be 100644
--- a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
@@ -1,71 +1,71 @@
<?php
final class PhabricatorAuthManagementLDAPWorkflow
extends PhabricatorAuthManagementWorkflow {
protected function didConstruct() {
$this
->setName('ldap')
->setExamples('**ldap**')
->setSynopsis(
pht('Analyze and diagnose issues with LDAP configuration.'));
}
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$console->getServer()->setEnableLog(true);
- $provider = new PhabricatorAuthProviderLDAP();
- if (!$provider->isEnabled()) {
+ $provider = PhabricatorAuthProviderLDAP::getLDAPProvider();
+ if (!$provider) {
$console->writeOut(
"%s\n",
"The LDAP authentication provider is not enabled.");
exit(1);
}
if (!function_exists('ldap_connect')) {
$console->writeOut(
"%s\n",
"The LDAP extension is not enabled.");
exit(1);
}
$adapter = $provider->getAdapter();
$adapter->setConsole($console);
$console->writeOut("%s\n", pht('LDAP CONFIGURATION'));
$adapter->printConfiguration();
$console->writeOut("%s\n", pht('Enter LDAP Credentials'));
$username = phutil_console_prompt("LDAP Username: ");
if (!strlen($username)) {
throw new PhutilArgumentUsageException(
pht("You must enter an LDAP username."));
}
phutil_passthru('stty -echo');
$password = phutil_console_prompt("LDAP Password: ");
phutil_passthru('stty echo');
if (!strlen($password)) {
throw new PhutilArgumentUsageException(
pht("You must enter an LDAP password."));
}
$adapter->setLoginUsername($username);
$adapter->setLoginPassword(new PhutilOpaqueEnvelope($password));
$console->writeOut("\n");
$console->writeOut("%s\n", pht('Connecting to LDAP...'));
$account_id = $adapter->getAccountID();
if ($account_id) {
$console->writeOut("%s\n", pht('Found LDAP Account: %s', $account_id));
} else {
$console->writeOut("%s\n", pht('Unable to find LDAP account!'));
}
return 0;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jul 2, 12:48 AM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
164586
Default Alt Text
(2 KB)

Event Timeline