From 208f550d2cdb965f98c33fdc8314056ac2eb8426 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 7 Aug 2019 12:49:12 +0200 Subject: [PATCH 1/3] Allow LDAP and username/password login to co-exist Closes https://github.com/YunoHost-Apps/mediawiki_ynh/issues/8. --- conf/LocalSettings.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/LocalSettings.php b/conf/LocalSettings.php index 0a1292b..5baee38 100644 --- a/conf/LocalSettings.php +++ b/conf/LocalSettings.php @@ -137,6 +137,8 @@ wfLoadExtension( 'LDAPProvider' ); # https://www.mediawiki.org/wiki/Extension:PluggableAuth wfLoadExtension( 'PluggableAuth' ); +$wgPluggableAuth_EnableLocalLogin = true; + # LDAPAuthentication2 # https://www.mediawiki.org/wiki/Extension:LDAPAuthentication2 wfLoadExtension( 'LDAPAuthentication2' ); From f9ec2d2405b01074c73a32921ad3fd0d2908c5c5 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 7 Aug 2019 12:50:25 +0200 Subject: [PATCH 2/3] Name admin password explicitly and save it in settings --- scripts/install | 5 +++-- scripts/upgrade | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 63bb72a..56e307a 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN +admin_password=$YNH_APP_ARG_PASSWORD is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE password=$YNH_APP_ARG_PASSWORD @@ -50,6 +51,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=admin_password --value=$admin_password ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=wiki_name --value=$wiki_name @@ -148,7 +150,7 @@ php $final_path/maintenance/install.php --conf $final_path \ --dbname $db_name \ --dbprefix "mdk_" \ --lang $language \ - --pass $password \ + --pass $admin_password \ $wiki_name $admin #================================================= @@ -158,7 +160,6 @@ cp ../conf/LocalSettings.php $final_path/LocalSettings.php ynh_replace_string --match_string="__WIKI_NAME__" --replace_string="$wiki_name" --target_file="$final_path/LocalSettings.php" ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/LocalSettings.php" -ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/LocalSettings.php" if [ $path_url = "/" ]; then # MediaWiki expects a "" for the root URL which is typically assumed to be diff --git a/scripts/upgrade b/scripts/upgrade index c5681f1..15253b9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,7 +15,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) admin=$(ynh_app_setting_get $app admin) -password=$(ynh_app_setting_get $app password) is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) language=$(ynh_app_setting_get $app language) @@ -130,7 +129,6 @@ cp ../conf/LocalSettings.php $final_path/LocalSettings.php ynh_replace_string "__WIKI_NAME__" "YunoWiki" "$final_path/LocalSettings.php" ynh_replace_string "__ADMIN__" "$admin" "$final_path/LocalSettings.php" -ynh_replace_string "__PASSWORD__" "$password" "$final_path/LocalSettings.php" if [ $path_url = "/" ]; then # MediaWiki expects a "" for the root URL which is typically assumed to be From 0028b8ed3d36c35a14cefd37cd68fcd7406c7846 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 7 Aug 2019 12:56:21 +0200 Subject: [PATCH 3/3] Allow to override user preferences This is a good stop gap for https://github.com/YunoHost-Apps/mediawiki_ynh/issues/9. --- conf/LocalSettings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/LocalSettings.php b/conf/LocalSettings.php index 5baee38..cc62bf5 100644 --- a/conf/LocalSettings.php +++ b/conf/LocalSettings.php @@ -138,6 +138,7 @@ wfLoadExtension( 'LDAPProvider' ); wfLoadExtension( 'PluggableAuth' ); $wgPluggableAuth_EnableLocalLogin = true; +$wgPluggableAuth_EnableLocalProperties = true; # LDAPAuthentication2 # https://www.mediawiki.org/wiki/Extension:LDAPAuthentication2