1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

enh migrate from 'sql query' to 'cli tool'

This commit is contained in:
Gofannon 2023-03-01 19:40:29 +01:00
parent 64ec144cc7
commit 19884bad97
2 changed files with 20 additions and 5 deletions

View file

@ -0,0 +1,10 @@
{
"Enabled": "1",
"URI": "ldap://localhost/ou=users,dc=yunohost,dc=org",
"Filter": "(&(objectclass=posixAccount)(|(uid=%1$s)(mail=%1$s))(permission=cn=wordpress.admin,ou=permission,dc=yunohost,dc=org))",
"NameAttr": "givenName",
"SecName": "sn",
"UidAttr": "uid",
"MailAttr": "mail",
"DefaultRole": "subscriber"
}

View file

@ -225,12 +225,12 @@ then
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/multisite.sql
plugin_network="--network"
else
db_prefix="wp_"
ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/single.sql
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/single.sql
ynh_replace_string --match_string="__LENGTH__" --replace_string="$((${#app} + 108))" --target_file=../conf/sql/single.sql
#db_prefix="wp_"
#ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/single.sql
#ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/single.sql
#ynh_replace_string --match_string="__LENGTH__" --replace_string="$((${#app} + 108))" --target_file=../conf/sql/single.sql
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/single.sql
#ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/single.sql
plugin_network=""
fi
@ -240,6 +240,11 @@ fi
ynh_script_progression --message="Activating plugins..." --weight=4
$wpcli_alias plugin activate authldap $plugin_network
$wpcli_alias option update authLDAPOptions --format=json < ../conf/plugin_authldap.json
# to display the list of all the possibles options, from your server:
# $ php8.0 ./wp-cli.phar --path=/var/www/wordpress --allow-root option get authLDAPOptions --json | jq
# Do not activate http-authentication, this plugin is sometimes unstable
$wpcli_alias plugin activate companion-auto-update $plugin_network
$wpcli_alias plugin activate wp-fail2ban-redux $plugin_network