diff --git a/conf/migrate_7.0.6.sql b/conf/migrate_7.0.6.sql new file mode 100644 index 0000000..836fa4e --- /dev/null +++ b/conf/migrate_7.0.6.sql @@ -0,0 +1,15 @@ +ALTER TABLE `compte` +ADD `totp_etat` smallint(5) unsigned DEFAULT NULL; + +ALTER TABLE `compte` +ADD `totp_secret` varchar(255) DEFAULT NULL; + +CREATE TABLE `cle_valeur` ( + `cle` varchar(255) NOT NULL, + `valeur` bigint(20) unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +INSERT INTO `cle_valeur` (`cle`, `valeur`) VALUES +('pub_visite_mensuel', 0), +('pub_visite_hebdo', 0), +('pub_visite_jour', 0); diff --git a/manifest.toml b/manifest.toml index a7d8eb0..3b0b21f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Moncycle" description.en = "Menstrual cycle follow-up for natural family planning" description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance" -version = "7.0~ynh6" +version = "8.0~ynh1" maintainers = ["Raoul de Limezy"] @@ -38,8 +38,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/jean-io/moncycle.app/archive/4ee55999138825fd2f309fa27a69bafe6f5a0c36.zip" - sha256 = "94c3010d12f9650ea87aecde046ef0ba4102308b566de94868adc76c69c22ccf" + url = "https://github.com/jean-io/moncycle.app/archive/a686e4f1769203ec66884a772c9d274ce3777274.zip" + sha256 = "60697bc442373b25c996eedb805c71c2b63a6cc7abdcef2e08f5f4257fecb005" [resources.system_user] diff --git a/scripts/upgrade b/scripts/upgrade index f938b44..01fb7dc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,12 +44,22 @@ pushd "$install_dir" ynh_script_progression --message="Checking if a database migration is needed" if ynh_compare_current_package_version --comparison le --version 7.0~ynh5 then - ynh_script_progression --message="Database migration required, migrating" - ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate.sql" - ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate.sql + ynh_script_progression --message="7.0.5 to 8.0 database migration required, migrating" + ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate_7.0.5.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.5.sql + ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql else - ynh_script_progression --message="Database migration not required" + if ynh_compare_current_package_version --comparison eq --version 7.0~ynh6 + then + ynh_script_progression --message="7.0.6 to 8.0 database migration required, migrating" + ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql + else + ynh_script_progression --message="7.0.6 to 8.0 database migration not required" + fi fi + ynh_script_progression --message="Database migration not required" popd diff --git a/sources/patches/app-01-mail.patch b/sources/patches/app-01-mail.patch index 87b81ef..c8db56e 100644 --- a/sources/patches/app-01-mail.patch +++ b/sources/patches/app-01-mail.patch @@ -1,17 +1,16 @@ diff --git a/www_data/lib/mail.php b/www_data/lib/mail.php -index f153e3c..e56f1fd 100644 +index 363aeb7..343e33b 100644 --- a/www_data/lib/mail.php +++ b/www_data/lib/mail.php @@ -15,10 +15,10 @@ function mail_init(){ - $mail->isSMTP(); - $mail->Host = SMTP_HOST; -- $mail->SMTPAuth = true; - $mail->Username = SMTP_MAIL; - $mail->Password = SMTP_PASSWORD; -- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; -+ $mail->SMTPAutoTLS = false; -+ $mail->SMTPSecure = false; - $mail->Port = SMTP_PORT; - $mail->CharSet = 'UTF-8'; - + $mail->isSMTP(); + $mail->Host = SMTP_HOST; +- $mail->SMTPAuth = true; + $mail->Username = SMTP_MAIL; + $mail->Password = SMTP_PASSWORD; +- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; ++ $mail->SMTPAutoTLS = false; ++ $mail->SMTPSecure = false; + $mail->Port = SMTP_PORT; + $mail->CharSet = 'UTF-8';