mirror of
https://github.com/YunoHost-Apps/joomla_ynh.git
synced 2024-09-03 19:26:34 +02:00
better way to create the first account
This commit is contained in:
parent
525553e750
commit
9ab6333406
1 changed files with 5 additions and 7 deletions
|
@ -110,6 +110,7 @@ ynh_script_progression --message="Configuring PHP-FPM..."
|
|||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -136,15 +137,12 @@ ynh_mysql_execute_file_as_root --file="$final_path/installation/sql/mysql/base.s
|
|||
ynh_mysql_execute_file_as_root --file="$final_path/installation/sql/mysql/extensions.sql" --database=$db_name
|
||||
ynh_mysql_execute_file_as_root --file="$final_path/installation/sql/mysql/supports.sql" --database=$db_name
|
||||
|
||||
JUSERID=$[ ( $RANDOM % 100 ) + 1 ]
|
||||
JPASS="$(echo -n "$password" | md5sum | awk '{ print $1 }' )"
|
||||
ynh_mysql_execute_as_root --database=$db_name --sql="INSERT INTO \`${db_prefix}users\` (\`id\`, \`name\`, \`username\`, \`email\`, \`password\`, \`block\`, \`sendEmail\`, \`registerDate\`, \`lastvisitDate\`, \`activation\`, \`params\`, \`lastResetTime\`, \`resetCount\`, \`otpKey\`, \`otep\`, \`requireReset\`) VALUES ('${JUSERID}', 'Me', '${admin}', '${admin_email}', '${JPASS}', '0', '0', '0000-00-00 00:00:00.000000', '0000-00-00 00:00:00.000000', '', '', '0000-00-00 00:00:00.000000', '0', '', '', '0');"
|
||||
ynh_mysql_execute_as_root --database=$db_name --sql="INSERT INTO \`${db_prefix}user_usergroup_map\` (\`user_id\`, \`group_id\`) VALUES ('${JUSERID}', '8');"
|
||||
JUSERINC=$((JUSERID+1))
|
||||
ynh_mysql_execute_as_root --database=$db_name --sql="ALTER TABLE \`${db_prefix}users\` auto_increment = ${JUSERINC};"
|
||||
|
||||
ynh_secure_remove --file="$final_path/installation"
|
||||
|
||||
pushd "$final_path/cli"
|
||||
php$phpversion joomla.php user:add --username "$admin" --name "$admin" --password "$password" --email "$admin_email" --usergroup "Super Users" -n
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue