强制用户进入编辑配置文件页面的最佳方式是什么?
下面是我的代码:
$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
}我想要重定向的用户谁的电子邮件匹配,以迫使他们编辑他们的个人资料的正确方式,重定向到编辑个人资料页面是我需要知道的。
发布于 2018-03-05 23:58:03
使用应用程序对象的redirect()方法:
$app = JFactory::getApplication();
$user = JFactory::getUser();
if ($user->email === "fakemail@spam-disposable-domain.com")
{
$app->enqueueMessage('Please change your email address!');
$app->redirect(
JRoute::_(
'index.php?option=com_users&view=profile&layout=edit'
)
);
}https://stackoverflow.com/questions/49111253
复制相似问题