aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-08-08 22:01:51 +0200
committerMarc Alexander <admin@m-a-styles.de>2019-08-08 22:01:51 +0200
commit3f852a3233b2ee51c3fab7dc6d077778fd35e0fd (patch)
tree8d1596774ad6482d325e66cf696a083fb57f13d6
parent9cb22f008d5aa335fbb143cdf058a0a3f132f61d (diff)
downloadforums-3f852a3233b2ee51c3fab7dc6d077778fd35e0fd.tar
forums-3f852a3233b2ee51c3fab7dc6d077778fd35e0fd.tar.gz
forums-3f852a3233b2ee51c3fab7dc6d077778fd35e0fd.tar.bz2
forums-3f852a3233b2ee51c3fab7dc6d077778fd35e0fd.tar.xz
forums-3f852a3233b2ee51c3fab7dc6d077778fd35e0fd.zip
[ticket/11327] Move UCP remind functionality to a controller for password reset
PHPBB3-11327
-rw-r--r--phpBB/config/default/container/services.yml1
-rw-r--r--phpBB/config/default/container/services_ucp.yml15
-rw-r--r--phpBB/config/default/routing/routing.yml4
-rw-r--r--phpBB/config/default/routing/ucp.yml3
-rw-r--r--phpBB/includes/functions.php5
-rw-r--r--phpBB/phpbb/ucp/controller/reset_password.php (renamed from phpBB/includes/ucp/ucp_remind.php)0
-rw-r--r--phpBB/ucp.php6
7 files changed, 31 insertions, 3 deletions
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml
index 3ead1e6181..2d4720029d 100644
--- a/phpBB/config/default/container/services.yml
+++ b/phpBB/config/default/container/services.yml
@@ -27,6 +27,7 @@ imports:
- { resource: services_text_formatter.yml }
- { resource: services_text_reparser.yml }
- { resource: services_twig.yml }
+ - { resource: services_ucp.yml }
- { resource: services_user.yml }
- { resource: tables.yml }
diff --git a/phpBB/config/default/container/services_ucp.yml b/phpBB/config/default/container/services_ucp.yml
new file mode 100644
index 0000000000..615a5698c4
--- /dev/null
+++ b/phpBB/config/default/container/services_ucp.yml
@@ -0,0 +1,15 @@
+services:
+ phpbb.ucp.controller.reset_password:
+ class: phpbb\ucp\controller\reset_password
+ arguments:
+ - '@config'
+ - '@dbal.conn'
+ - '@dispatcher'
+ - '@controller.helper'
+ - '@language'
+ - '@passwords.manager'
+ - '@request'
+ - '@template'
+ - '@user'
+ - '%core.root_path%'
+ - '%core.php_ext%'
diff --git a/phpBB/config/default/routing/routing.yml b/phpBB/config/default/routing/routing.yml
index 199c5229b0..a5e9265dc3 100644
--- a/phpBB/config/default/routing/routing.yml
+++ b/phpBB/config/default/routing/routing.yml
@@ -26,3 +26,7 @@ phpbb_help_routing:
phpbb_report_routing:
resource: report.yml
+
+phpbb_ucp_routing:
+ resource: ucp.yml
+ prefix: /user
diff --git a/phpBB/config/default/routing/ucp.yml b/phpBB/config/default/routing/ucp.yml
new file mode 100644
index 0000000000..be97f597a0
--- /dev/null
+++ b/phpBB/config/default/routing/ucp.yml
@@ -0,0 +1,3 @@
+phpbb_ucp_reset_password_controller:
+ path: /reset_password
+ defaults: { _controller: phpbb.ucp.controller.reset_password:handle }
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2aa98b384e..5ac26b450e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2519,11 +2519,14 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
+
$login_box_template_data = array(
'LOGIN_ERROR' => $err,
'LOGIN_EXPLAIN' => $l_explain,
- 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
+ 'U_SEND_PASSWORD' => ($config['email_enable']) ? $controller_helper->route('phpbb_ucp_reset_password_controller') : '',
'U_RESEND_ACTIVATION' => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/phpbb/ucp/controller/reset_password.php
index e50428bfea..e50428bfea 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/phpbb/ucp/controller/reset_password.php
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index c60d9930fc..34a6c6bb99 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -63,8 +63,10 @@ switch ($mode)
break;
case 'sendpassword':
- $module->load('ucp', 'remind');
- $module->display($user->lang['UCP_REMIND']);
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
+
+ redirect($controller_helper->route('phpbb_ucp_reset_password_controller'));
break;
case 'register':