1

我在社交网络上工作。我已经安装了“重定向注册 JomSocial”插件,用于将注册页面重定向到 jomsocial 注册。我正在获取注册页面,但是一旦完成注册的第一步,页面就会重定向到登录页面,显示消息为“请先登录”。

仅当我禁用在 jomsocial 安装期间创建的菜单“Jomsocial”时才会发生这种情况。

有没有其他方法可以将注册页面重定向到 jomsocial 注册。

4

2 回答 2

1

您似乎有菜单项问题。可能您在 JomSocial 工具栏之外创建了一些菜单项,并且您已为此菜单项之一(具有最高菜单项 ID 的那个)设置了隐私限制。

因此,您进入注册页面,然后单击下一个 Joomla!正在从我上面提到的菜单项中获取菜单项 ID……这会导致重定向到“请先登录”。只需检查您的菜单项;)

于 2015-07-24T18:46:18.007 回答
0

You may not disable the jomsocial menu items, if you don't want to show them just put them in a new menu, which you won't create a module for (or create a module and don't assign it to any position). This is why it's failing now. The function requiring this is getMenuItem() in the redirect plugin.

What you will find next is that a visitor clicking on a link that requires login will be sent to the login page with a &return parameter with the encoded url it's supposed to go back to after login. This is not handled by jomsocial plugin, just change is like this:

file 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;
    }
}
于 2013-01-30T08:44:34.283 回答