[英]JomSocial - Registration Redirection
我正在从事社交游戏。 我已经安装了“用于JomSocial的重定向注册”插件,用于将注册页面重定向到jomsocial注册。 我正在获取注册页面,但是一旦完成第一步注册,页面就会重定向到登录页面,显示消息为“请先登录”。
仅当我禁用在jomsocial安装过程中创建的菜单“ Jomsocial”时,才会发生这种情况。
还有其他方法可以将注册页面重定向到jomsocial注册。
看来您有菜单项问题。 可能是您在JomSocial工具栏之外创建了一些菜单项,并且已为此菜单项之一(具有最高ID的菜单项)设置了隐私限制。
所以,您进入注册页面,然后单击下一个Joomla! 正在从我上面提到的菜单项中获取菜单项ID ...这导致重定向到“请先登录”。 只需检查您的菜单项;)
如果您不希望显示临时菜单项,则不要禁用它们,只要将它们放在一个新菜单中,就不会为其创建模块(或创建模块并且不将其分配到任何位置) 。 这就是为什么现在失败了。 需要此功能的函数是重定向插件中的getMenuItem()。
接下来,您将发现,单击需要登录的链接的访问者将被带到带有&return参数的登录页面,该参数带有应在登录后返回的编码网址。 这不是由jomsocial插件处理的,只是更改是这样的:
文件插件/system/jomsocialredirect/jomsocialredirect.php
/**
* Method to override Login / Logout redirect
*/
private function overrideRedirectLoginLogout() {
$mainframe =& JFactory::getApplication();
$task = JRequest::getVar ( 'task' );
switch ($task) {
case 'user.login' : //Joomla 1.6 and later
case 'login' : /* on logging */
/**
* krz This next line restores working status of login redirects.
* (the purpose of jomsocialredirect plugin is to redirect after login, but some links for guests
* point to com_login with a return url set; if this is the case, the next line makes the feature work,
* otherwise it would be overridden;
* note: redirect is to be avoided on logout.
*/
if (JRequest::getVar('return','')!='') return;
if ($this->login ()) { /* we do login by self */
/* redirect if login success */
$link = $this->getMenuLink ( $this->pluginParams->get ( 'redirect_login', 1 ) );
$mainframe->redirect ( $link, JText::_ ( $this->pluginParams->get ( 'redirect_login_msg', 'LOGIN_SUCCESSFUL' ) ), 'message' );
} else {
/* redirect if login failed */
$link = $this->getMenuLink ( $this->pluginParams->get ( 'redirect_login_failed', 1 ) );
$mainframe->redirect ( $link, JText::_ ( $this->pluginParams->get ( 'redirect_login_failed_msg', 'LOGIN_FAILED' ) ), 'notice' );
}
break;
case 'user.logout' : //Joomla 1.6 and later
case 'logout' :
$link = $this->getMenuLink ( $this->pluginParams->get ( 'redirect_logout', 1 ) );
JFactory::getApplication ()->logout ();
$mainframe->redirect ( $link, JText::_ ( $this->pluginParams->get ( 'redirect_logout_msg', 'YOU_HAVE_LOGGED_OUT' ) ), 'message' );
break;
default :
/* override redirect after login / logout */
$view = JRequest::getVar('view','');
if ($view=='profile') {
$link = $this->getMenuLink ( $this->pluginParams->get ( 'redirect_login', 1 ) );
$mainframe->redirect ( $link);
}
break;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.