user->isAuthenticationCorrect($username, $password); if ($user_id) { if (!$TeKe->facebook->isAccountConnectedWithFacebook($user_id)) { $TeKe->facebook->connectAccountWithFacebook($user_id, $facebook_id); $TeKe->user->load($user_id); unset($_SESSION["user"]); $_SESSION["user"] = $user->id; } else { $TeKe->add_system_message(_("This account is already connected with different facebook account."), "error"); $forward_to .= "facebook_connect"; } } else { $TeKe->add_system_message(_("Wrong username or password"), "error"); $forward_to .= "facebook_connect"; } } else { $TeKe->add_system_message(_("At least one of the parameters is empty."), "error"); $forward_to .= "facebook_connect"; } forward($forward_to); ?>