我正在做jomsocial。我已经安装了“jomsocial重定向注册”插件,用于将注册页面重定向到jomsocial注册。我正在得到注册页面,但一旦完成注册的第一步,页面重定向到登录页面,显示消息为“请先登录”。
只有当我禁用在jomsocial安装过程中创建的菜单"Jomsocial“时,才会发生这种情况。
是否有其他方法可以将注册页面重定向到jomsocial注册。
发布于 2015-07-25 02:46:18
看起来您的菜单项有问题。您可能在JomSocial工具栏之外创建了一些菜单项,并为其中一个菜单项(具有最高菜单项ID的菜单项)设置了隐私限制。
所以当你点击下一步Joomla时,你会进入注册页面!正在从我上面提到的菜单项中获取菜单项ID ...这会导致重定向到“请先登录”。只需检查您的菜单项;)
发布于 2013-01-30 16:44:34
您可以不禁用jomsocial菜单项,如果您不想显示它们,只需将它们放在一个新菜单中,您不会为其创建一个模块(或者创建一个模块并不将其分配给任何位置)。这就是它现在失败的原因。需要这样做的函数是重定向插件中的getMenuItem()。
接下来你会发现,当访问者点击一个需要登录的链接时,它会被发送到登录页面,并带有一个&return参数以及它应该在登录后返回的编码后的url。这不是由jomsocial插件处理的,只是更改如下所示:
文件plugins/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;
}
}https://stackoverflow.com/questions/14480381
复制相似问题