【发布时间】:2018-03-05 13:10:07
【问题描述】:
强制用户进入编辑个人资料页面的最佳方式是什么。
这是我的代码:
$user = JFactory::getUser();
if ($user->email === "fakemail@spam-disposable-domain.com") {
//Redirect user to the edit profile page forcing them to change their email.
//index.php?option=com_users&view=profile&layout=edit
}
我想重定向电子邮件匹配的用户,以强制他们编辑他们的个人资料,正确的方式将他们重定向到编辑个人资料页面是我需要知道的。
【问题讨论】:
-
通过
@拆分电子邮件并检查域?用户header()将用户发送到页面? -
@IsThisJavascript 所以一个简单的位置重定向就可以了,没有我应该使用的重定向 joomla 功能.....
-
我不知道 joomla 框架,但因为它是 php;
header("Location: path/to/page"); exit();仍然可以工作 -
应该有类似
$app->redirect的东西。试试谷歌。 -
@Xatenev 感谢您提供这些信息,您知道我是否需要额外的逻辑,或者当他们更改电子邮件时,我是否会遇到使用重定向代码保存编辑配置文件表单的问题,我担心它可能无法保存到期到重定向逻辑。