场景:用户点击Login with Facebook
链接,但实际上用户没有在数据库中注册。网址的代码是:
<a href="<?php echo $this->authlib->fbloginURL(site_url() . 'auth/facebooklogin'); ?>">
在auth/facebooklogin()
函数中,我正在检查这种情况,如果用户没有注册,我想打开一个注册模式。
facebooklogin()
检查和重定向的代码片段:
if(is_null( $this->authlib->has_account( $fb_id ) ) ) // User has no account
redirect('/auth/register_modal');
该register_modal()
函数只是加载我要显示的新视图:
function register_modal()
{
$this->load->view('include/header');
$this->load->view('auth/register_modal');
$this->load->view('include/footer');
}
现在出于讨论的目的,我modal dialog
是:
<div class="modal hide" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Login to MyWebsite.com</h3>
</div>
<div class="modal-body">
<form method="post" action='' name="login_form">
<p><input type="text" class="span3" name="eid" id="email" placeholder="Email"></p>
<p><input type="password" class="span3" name="passwd" placeholder="Password"></p>
<p><button type="submit" class="btn btn-primary">Sign in</button>
<a href="#">Forgot Password?</a>
</p>
</form>
</div>
<div class="modal-footer">
New To MyWebsite.com?
<a href="#" class="btn btn-primary">Register</a>
</div>
</div>
这不起作用。. 我想知道我做错了什么?所有相关的引导文件都加载到头文件中。