diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index f7ce4f87a6..67b61989f7 100644 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -23,6 +23,9 @@ require_once('apps/user_ldap/user_ldap.php'); +// define LDAP_DEFAULT_PORT +define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389); + // register user backend OC_USER::useBackend( "LDAP" ); diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 22f817e7ca..f7aff1b461 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -29,7 +29,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )) exit(); } -$params = array('ldap_host', 'ldap_dn', 'ldap_password', 'ldap_base', 'ldap_filter'); +$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_password', 'ldap_base', 'ldap_filter'); foreach($params as $param){ if(isset($_POST[$param])){ @@ -45,4 +45,8 @@ foreach($params as $param){ $value = OC_APPCONFIG::getValue('user_ldap', $param,''); $tmpl->assign($param, $value); } + +// ldap_port has a default value +$tmpl->assign( 'ldap_port', OC_APPCONFIG::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT)); + $tmpl->printPage(); diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 5f7ee671ce..0145736e80 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -5,6 +5,9 @@