Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15414408
D10260.id24696.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10260.id24696.diff
View Options
diff --git a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
@@ -15,6 +15,8 @@
$console = PhutilConsole::getConsole();
$console->getServer()->setEnableLog(true);
+ PhabricatorLDAPAuthProvider::assertLDAPExtensionInstalled();
+
$provider = PhabricatorLDAPAuthProvider::getLDAPProvider();
if (!$provider) {
$console->writeOut(
diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
@@ -251,12 +251,26 @@
return array($errors, $issues, $values);
}
+ public static function assertLDAPExtensionInstalled() {
+ if (!function_exists('ldap_bind')) {
+ throw new Exception(
+ pht(
+ 'Before you can set up or use LDAP, you need to install the PHP '.
+ 'LDAP extension. It is not currently installed, so PHP can not '.
+ 'talk to LDAP. Usually you can install it with '.
+ '`yum install php-ldap`, `apt-get install php5-ldap`, or a '.
+ 'similar package manager command.'));
+ }
+ }
+
public function extendEditForm(
AphrontRequest $request,
AphrontFormView $form,
array $values,
array $issues) {
+ self::assertLDAPExtensionInstalled();
+
$labels = $this->getPropertyLabels();
$captions = array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 12:30 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7441841
Default Alt Text
D10260.id24696.diff (1 KB)
Attached To
Mode
D10260: Surface a better warning when the LDAP extension is not installed
Attached
Detach File
Event Timeline
Log In to Comment