mirror of
https://github.com/YunoHost-Apps/baikal_ynh.git
synced 2024-09-03 18:16:11 +02:00
* 0.9.3 * Auto-update README * Update baikal.yaml * Php (#74) * set php * Fix * Update upgrade * Auto-update README * cleaning * Update manifest.json * Auto-update README * Update manifest.json * Update upgrade * remove old link * Auto-update README * Update nginx.conf * Update upgrade * fix * Auto-update README * Update upgrade * Update check_process * Update manifest.json * Auto-update README * Update baikal.yaml * Update upgrade (#83) * Version 2 (#79) * v2 * v2 * fix * Update manifest.toml * fix * Auto-update README * fix * Auto-update README * Update manifest.toml * Update manifest.toml * Update manifest.toml * Update upgrade * cleaning * Update manifest.toml * Update upgrade * Auto-update README * Update manifest.toml * Auto-update README * Update install --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> * cleaning * Auto-update README * Update manifest.toml * Update manifest.toml * Auto-update README * Update manifest.toml * rename 'app' -> 'main' (#89) 'main' is the new default source_id. This re-enables the extra sources and the patch, which in turn re-enables the LDAP authentication. * Auto-update README * Update manifest.toml * Auto-update README --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: Toromtomtom <Toromtomtom@users.noreply.github.com>
79 lines
3.5 KiB
Diff
79 lines
3.5 KiB
Diff
diff --git a/Core/Frameworks/Baikal/Core/Server.php b/Core/Frameworks/Baikal/Core/Server.php
|
|
index e96fe39..b90b49e 100644
|
|
--- a/Core/Frameworks/Baikal/Core/Server.php
|
|
+++ b/Core/Frameworks/Baikal/Core/Server.php
|
|
@@ -133,8 +133,8 @@
|
|
|
|
if ($this->authType === 'Basic') {
|
|
$authBackend = new \Baikal\Core\PDOBasicAuth($this->pdo, $this->authRealm);
|
|
- } elseif ($this->authType === 'Apache') {
|
|
- $authBackend = new \Sabre\DAV\Auth\Backend\Apache();
|
|
+ } elseif ($this->authType === 'LDAP-UserBind') {
|
|
+ $authBackend = new \Baikal\Core\LDAPUserBindAuth($this->pdo, $this->authRealm);
|
|
} else {
|
|
$authBackend = new \Sabre\DAV\Auth\Backend\PDO($this->pdo);
|
|
$authBackend->setRealm($this->authRealm);
|
|
diff --git a/Core/Frameworks/Baikal/Model/Config/Standard.php b/Core/Frameworks/Baikal/Model/Config/Standard.php
|
|
index 1ef5a51..32ec217 100644
|
|
--- a/Core/Frameworks/Baikal/Model/Config/Standard.php
|
|
+++ b/Core/Frameworks/Baikal/Model/Config/Standard.php
|
|
@@ -37,6 +37,26 @@
|
|
"card_enabled" => true,
|
|
"cal_enabled" => true,
|
|
"dav_auth_type" => "Digest",
|
|
+ "dav_ldap_uri" => "ldapi:///",
|
|
+ "dav_ldap_dn_template" => "uid=%n,dc=example,dc=com",
|
|
+ "dav_ldap_displayname_attr" => "cn",
|
|
+ "dav_ldap_email_attr" => "mail",
|
|
+ "dav_ldap_uri" => [
|
|
+ "type" => "string",
|
|
+ "comment" => "URI to LDAP Server (for ldap-userbind auth); default ldapi:///"
|
|
+ ],
|
|
+ "dav_ldap_dn_template" => [
|
|
+ "type" => "string",
|
|
+ "comment" => "User DN for bind; with replacments %n => username, %u => user part, %d => domain part of username"
|
|
+ ],
|
|
+ "dav_ldap_displayname_attr" => [
|
|
+ "type" => "string",
|
|
+ "comment" => "LDAP-attribute for displayname; default cn"
|
|
+ ],
|
|
+ "dav_ldap_email_attr" => [
|
|
+ "type" => "string",
|
|
+ "comment" => "LDAP-attribute for email; default mail"
|
|
+ ],
|
|
"admin_passwordhash" => "",
|
|
"failed_access_message" => "user %u authentication failure for Baikal",
|
|
// While not editable as will change admin & any existing user passwords,
|
|
@@ -79,7 +99,31 @@
|
|
$oMorpho->add(new \Formal\Element\Listbox([
|
|
"prop" => "dav_auth_type",
|
|
"label" => "WebDAV authentication type",
|
|
- "options" => ["Digest", "Basic", "Apache"],
|
|
+ "options" => ["Digest", "Basic", "LDAP-UserBind"]
|
|
+ ]));
|
|
+
|
|
+ $oMorpho->add(new \Formal\Element\Text([
|
|
+ "prop" => "dav_ldap_uri",
|
|
+ "label" => "LDAP URI"
|
|
+ ]));
|
|
+
|
|
+ $oMorpho->add(new \Formal\Element\Text([
|
|
+ "prop" => "dav_ldap_dn_template",
|
|
+ "label" => "LDAP DN template",
|
|
+ "popover" => [
|
|
+ "title" => "posible placeholder",
|
|
+ "content" => "<strong>%n</strong> - username<br /><strong>%u</strong> - user part of username , when it is an email address)<br /><strong>%d</strong> - domain part",
|
|
+ ]
|
|
+ ]));
|
|
+
|
|
+ $oMorpho->add(new \Formal\Element\Text([
|
|
+ "prop" => "dav_ldap_displayname_attr",
|
|
+ "label" => "LDAP attribute for DisplayName"
|
|
+ ]));
|
|
+
|
|
+ $oMorpho->add(new \Formal\Element\Text([
|
|
+ "prop" => "dav_ldap_email_attr",
|
|
+ "label" => "LDAP attribute for eMail"
|
|
]));
|
|
|
|
$oMorpho->add(new \Formal\Element\Password([
|