沒有爲CB自動登錄的解決方案,並註冊後重定向如果沒有需要檢查信箱:
編輯:/components/com_comprofiler/comprofiler.php
周圍有1078行:
echo "\n<div>" . implode("</div>\n<div>", $messagesToUser) . "</div>\n";
(從登錄取出)之前將這個:
//lets try to auto-login
$app = &JFactory::getApplication();
$password = cbGetParam($_POST, 'password', '', _CB_ALLOWRAW);
if($app->isSite())
{
# Login process
$credentials = array(
"username" => $username,
"password" => $password
);
if(is_dir(JPATH_BASE . DS . "components" . DS . "com_comprofiler")) {
$database = &JFactory::getDBO();
$sql_sync = "INSERT IGNORE INTO #__comprofiler(id, user_id) SELECT id,id FROM #__users";
$database->setQuery($sql_sync);
$database->query();
}
$app->login($credentials);
// Beside a redirection, writing out a text...
global $mainframe;
$mainframe->redirect(JRoute::_("<redirect-to-link>"),JText::_("You have logged in automatically."));
}
else {
// This is just a redirection...
global $mainframe;
$mainframe->redirect(JRoute::_("<redirect-to-link>"));
}
哦,哇!解決了我的問題。謝謝。 :) – 2012-03-21 03:03:09