diff --git a/conf/sql/common.sql b/conf/sql/common.sql index 96a720b..c56f29f 100644 --- a/conf/sql/common.sql +++ b/conf/sql/common.sql @@ -1,2 +1 @@ INSERT INTO wp_options VALUES('','http_authentication_options','a:8:{s:13:"allow_wp_auth";b:1;s:10:"auth_label";s:19:"HTTP authentication";s:9:"login_uri";s:40:"https://__DOMAIN_PATH__/wp-login.php";s:10:"logout_uri";s:28:"https://__DOMAIN_PATH__/";s:22:"additional_server_keys";s:13:"PHP_AUTH_USER";s:24:"auto_create_email_domain";s:0:"";s:10:"db_version";i:2;s:16:"auto_create_user";b:0;}','yes'); -INSERT INTO wp_options (option_id,option_name,option_value,autoload) VALUES('','WPLANG','__LANGUAGE__','yes') ON DUPLICATE KEY UPDATE option_value=VALUES(option_value); diff --git a/scripts/install b/scripts/install index e54a52e..008eb77 100644 --- a/scripts/install +++ b/scripts/install @@ -143,7 +143,7 @@ sudo yunohost app ssowatconf # Régénère la configuration de SSOwat sudo systemctl reload nginx # Wordpress installation -ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin_wordpress" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin_wordpress@$domain" "language=$language" "Submit=Install+WordPress" +ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin_wordpress" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin_wordpress@$domain" "Submit=Install+WordPress" WARNING echo -n "Please wait during Wordpress installation" for i in `seq 1 300` @@ -170,13 +170,19 @@ php $final_path/wp-cli.phar --allow-root plugin install http-authentication --pa # Replace variables in sql scripts ynh_replace_string "__DOMAIN_PATH__" "$domain$path_url" ../conf/sql/*.sql -ynh_replace_string "__LANGUAGE__" "$language" ../conf/sql/*.sql ynh_replace_string "__DATE__" "$(date +%s)" ../conf/sql/*.sql # Charge les commandes sql communes à tous les scripts. # mysql --debug-check -u $db_user -p$db_pwd $db_user < ../conf/sql/common.sql ynh_mysql_connect_as $db_name $db_pwd $db_name < ../conf/sql/common.sql +#================================================= +# SET LANGUAGE +#================================================= + +php $final_path/wp-cli.phar --allow-root --path=$final_path core language install $language +php $final_path/wp-cli.phar --allow-root --path=$final_path core language activate $language + #================================================= # CONFIGURE MULTISITE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 85fa3ea..c5f304e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,6 +115,14 @@ ynh_add_fpm_config # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different "$final_path/wp-config.php" +#================================================= +# UPDATE WORDPRESS' PLUGINS +#================================================= + +sudo wget -nv https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O $final_path/wp-cli.phar +php $final_path/wp-cli.phar --allow-root plugin update simple-ldap-login --path=$final_path +php $final_path/wp-cli.phar --allow-root plugin update http-authentication --path=$final_path + #================================================= # CONFIGURE MULTISITE #=================================================