From 864d1a095ed6b62ae107e32aaa9baab256ef8147 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 30 Aug 2024 22:39:04 +0200 Subject: [PATCH] [autopatch] Automatic patch attempt for helpers 2.1 --- .DS_Store | Bin 6148 -> 0 bytes conf/extra_php-fpm.conf | 4 -- conf/nginx.conf | 2 +- manifest.toml | 4 +- scripts/_common.sh | 16 +------ scripts/backup | 29 ++++------- scripts/change_url | 14 ++---- scripts/install | 40 ++++++---------- scripts/remove | 21 ++++---- scripts/restore | 44 +++++++---------- scripts/upgrade | 52 +++++++------------- sources/patches/app-00-add-http-auth.patch | 53 --------------------- 12 files changed, 77 insertions(+), 202 deletions(-) delete mode 100644 .DS_Store delete mode 100644 conf/extra_php-fpm.conf delete mode 100644 sources/patches/app-00-add-http-auth.patch diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 055dc255932f8055ed7be0d8601aba63622cf4a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK&1%~~5Z<+&M%$R8LJkh}u+T#YU<@J; zkOye4N%J0UAEGbPduMjnrN-?olwxLJ_M4rZnPoqT{b7vp!8G1w%w>!@pok3t%^w8E zQCFm4J%}7@OwOZBMbP^Zov%cb<9}oTzg?5XOtI6b`u+Q5>7?xSzVk-2weeun5f4RM zJQD4X!B|y68J5$@AS_1ilOTQsrfs=1HOJnHnFC(mYnxKuz;_qT_9GZNCZ2G1L)H{iN1R3P+6G&TQs+&%4s= z_vc+X+uQ4PW#4--p9{y?dG_k<@$~ZQ)Ah~m=esXo4gVZ|RV|M#F5nv&mWqp@$TO9n zfoBoDh$18ghyh|?4H&Rno3phBYoR3&1H{1nGJyMo1V!{M)&}*~0S#UsalD0y0ye%S z5T!-mVr>vcK)6W-G^yM^F}O(wzqE0_#oC}rXI#$=b?nUCzEHTH9sE*#o<{iK~F$YFs?TED+LUF6hkZ? d#T`&B;Fo9s`W9=0-~pkFfTn>OV&I=L@Dl{_U+@3` diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 700c37c..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M diff --git a/conf/nginx.conf b/conf/nginx.conf index fc7f1d0..4349f4b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -12,7 +12,7 @@ location __PATH__/ { try_files $uri __PATH__/__PATH__/index.php$is_args$args; location ~ ^__PATH__/index\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/manifest.toml b/manifest.toml index 10bc1ba..627cc37 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,8 @@ demo = "https://demo.yunohost.org/agendav" admindoc = "https://agendav.readthedocs.io" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = false ldap = true @@ -55,6 +56,7 @@ ram.runtime = "10M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index a24a626..f054d8c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,11 +1,7 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= _ynh_agendav_find_caldav_app() { @@ -21,16 +17,8 @@ _ynh_agendav_find_caldav_app() { caldav_app="${installed_baikal[0]}" caldav_baseurl=/ else - ynh_die --message="Please install Baïkal or Radicale before AgenDAV." + ynh_die "Please install Baïkal or Radicale before AgenDAV." fi echo -e "$caldav_app $caldav_baseurl" } - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index f52392e..2cc2803 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,59 +1,50 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= # Clean cache files before backup -ynh_secure_remove --file="$install_dir/web/var/cache/profiler" -ynh_secure_remove --file="$install_dir/web/var/cache/twig" +ynh_safe_rm "$install_dir/web/var/cache/profiler" +ynh_safe_rm "$install_dir/web/var/cache/twig" mkdir -p "$install_dir/web/var/cache/"{profiler,twig} chown -R "$app" "$install_dir/web/var/cache/"{profiler,twig} -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" #================================================= # BACKUP LOGROTATE #================================================= -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info "Backing up the MySQL database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_mysql_dump_db > db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 16e0f3c..39d37fc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,25 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index bdeb564..2ea9ed5 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -17,47 +11,44 @@ caldav_info=$(_ynh_agendav_find_caldav_app) caldav_app="$(cut -d " " -f 1 <<< "$caldav_info")" caldav_baseurl="$(cut -d " " -f 2 <<< "$caldav_info")" -#================================================= -# STANDARD MODIFICATIONS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=4 +ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx mkdir -p "/var/log/$app" -chown -R "$app:" "/var/log/$app" +#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:" "/var/log/$app" # Use logrotate to manage application logfile(s) -ynh_use_logrotate +ynh_config_add_logrotate #================================================= # SPECIFIC SETUP #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=2 +ynh_script_progression "Adding $app's configuration..." # Generate random encryption key encryptkey=$(ynh_string_random --length=24) -ynh_app_setting_set --app="$app" --key=encryptkey --value="$encryptkey" +ynh_app_setting_set --key=encryptkey --value="$encryptkey" # Copy and set AgenDAV configuration timezone=$(cat /etc/timezone) @@ -67,20 +58,19 @@ caldav_path=$(ynh_app_setting_get --app=$caldav_app --key=path) caldav_url="https://${caldav_domain}${caldav_path%/}" caldav_baseurl="${caldav_url}${caldav_baseurl}" -ynh_add_config --template="../conf/settings.php" --destination="${install_dir}/web/config/settings.php" +ynh_config_add --template="settings.php" --destination="${install_dir}/web/config/settings.php" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) #================================================= -ynh_script_progression --message="Initialising $app..." --weight=3 +ynh_script_progression "Initialising $app..." ( cd "$install_dir" || ynh_die - "php$phpversion" agendavcli migrations:migrate --no-interaction + "php$php_version" agendavcli migrations:migrate --no-interaction ) -chown -R "$app:www-data" "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" # Only agendav user should write here chown -R "$app" "$install_dir/web/var/cache/"{profiler,twig} @@ -93,4 +83,4 @@ chmod -R 750 "$install_dir/web/config/" # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 10c3a5d..aac83f5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,34 +1,29 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SYSTEMD SERVICE +# REMOVE SYSTEMD SERVICE + #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." # Remove the app-specific logrotate config -ynh_remove_logrotate +ynh_config_remove_logrotate # Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx # Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_config_remove_phpfpm -ynh_secure_remove --file="/var/log/$app" +#REMOVEME? (Apps should not remove their log dir during remove ... this should only happen if --purge is used, and be handled by the core...) ynh_safe_rm "/var/log/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 1ad3002..3f5949e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -13,16 +7,14 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" - -chown -R "$app:www-data" "$install_dir" +ynh_restore "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" # Only agendav user should write here chown -R "$app" "$install_dir/web/var/cache/"{profiler,twig} @@ -34,38 +26,36 @@ chmod -R 750 "$install_dir/web/config/" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 +ynh_script_progression "Restoring the MySQL database..." -ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql +ynh_mysql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" mkdir -p "/var/log/$app" -chown -R "$app:" "/var/log/$app" +#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:" "/var/log/$app" -ynh_restore_file --origin_path="/etc/logrotate.d/$app" +ynh_restore "/etc/logrotate.d/$app" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 +ynh_script_progression "Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service="php$php_version-fpm" --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index a77ea1a..03c9b57 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,20 +1,8 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # GET THE CALDAV APP #================================================= @@ -27,41 +15,39 @@ caldav_baseurl="$(cut -d " " -f 2 <<< "$caldav_info")" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed +if ynh_app_upstream_version_changed then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="web/config/settings.php" fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx mkdir -p "/var/log/$app" -chown -R "$app:" "/var/log/$app" +#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:" "/var/log/$app" # Use logrotate to manage application logfile(s) -ynh_use_logrotate --non-append +ynh_config_add_logrotate -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=2 +ynh_script_progression "Updating configuration..." # Copy and set AgenDAV configuration timezone=$(cat /etc/timezone) @@ -71,20 +57,19 @@ caldav_path=$(ynh_app_setting_get --app="$caldav_app" --key=path) caldav_url="https://${caldav_domain}${caldav_path%/}" caldav_baseurl="${caldav_url}${caldav_baseurl}" -ynh_add_config --template="../conf/settings.php" --destination="${install_dir}/web/config/settings.php" +ynh_config_add --template="settings.php" --destination="${install_dir}/web/config/settings.php" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) #================================================= -ynh_script_progression --message="Upgrading $app..." --weight=1 +ynh_script_progression "Upgrading $app..." ( cd "$install_dir" || ynh_die - "php$phpversion" agendavcli migrations:migrate --no-interaction + "php$php_version" agendavcli migrations:migrate --no-interaction ) -chown -R "$app:www-data" "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" # Only agendav user should write here chown -R "$app" "$install_dir/web/var/cache/"{profiler,twig} @@ -94,10 +79,9 @@ chown -R "$app:www-data" "$install_dir/web/config/" chmod -R 750 "$install_dir/web/config/" # FIXME: Should cleanup all the chmods. -chmod 750 "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" diff --git a/sources/patches/app-00-add-http-auth.patch b/sources/patches/app-00-add-http-auth.patch deleted file mode 100644 index abd4452..0000000 --- a/sources/patches/app-00-add-http-auth.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- a/web/app/controllers.php -+++ b/web/app/controllers.php -@@ -58,14 +58,20 @@ $controllers->before(function(Request $request, Silex\Application $app) { - // processing the request - if ($app['session']->has('username')) { - $username = $app['session']->get('username'); -- $preferences = $app['preferences.repository']->userPreferences($username); -- $app['user.preferences'] = $preferences; -- $app['user.timezone'] = $preferences->get('timezone'); -- -- // Set application language -- $request->setLocale($preferences->get('language')); -- $app['translator']->setLocale($preferences->get('language')); -- return; -+ // Clear user session if HTTP authentication changed -+ if (isset($_SERVER['PHP_AUTH_USER']) -+ && $username != $_SERVER['PHP_AUTH_USER']) { -+ $app['session']->clear(); -+ } else { -+ $preferences = $app['preferences.repository']->userPreferences($username); -+ $app['user.preferences'] = $preferences; -+ $app['user.timezone'] = $preferences->get('timezone'); -+ -+ // Set application language -+ $request->setLocale($preferences->get('language')); -+ $app['translator']->setLocale($preferences->get('language')); -+ return; -+ } - } - - if ($request->isXmlHttpRequest()) { -diff --git a/web/src/Controller/Authentication.php b/web/src/Controller/Authentication.php -index deebb751..134cc9a8 100644 ---- a/web/src/Controller/Authentication.php -+++ b/web/src/Controller/Authentication.php -@@ -34,9 +34,14 @@ class Authentication - $success = false; - $template_vars = []; - -- if ($request->isMethod('POST')) { -- $user = $request->request->get('user'); -- $password = $request->request->get('password'); -+ if ($request->isMethod('POST') || isset($_SERVER['PHP_AUTH_USER'])) { -+ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { -+ $user = $_SERVER['PHP_AUTH_USER']; -+ $password = $_SERVER['PHP_AUTH_PW']; -+ } else { -+ $user = $request->request->get('user'); -+ $password = $request->request->get('password'); -+ } - - if (empty($user) || empty($password)) { - $template_vars['error'] = $app['translator']->trans('messages.error_empty_fields');