Когда я вхожу в админ-панель локально, она перенаправляет и загружает страницу входа снова, не открывает панель управления моей админ-панели, но когда я перемещаю свой файл в админ-панель живого сервера, работает отлично.
Код моей страницы входа в систему
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div class="login-box-body" class="text-center" style="margin:0 auto;padding:30px;background:#f0f0f0;border-radius:10px 10px 0 0;">
<div style="margin:0 auto;" class="text-center">
<img src="<?php echo base_url('upload/images/logo.png'); ?>" style="width:300px;" class="text-center img-responsive;" title="<?php echo $title_lg; ?>" />
</div>
</div>
<div class="login-box-body">
<p class="login-box-msg"><?php echo lang('auth_sign_session'); ?></p>
<div class="text-danger"><?php echo $message;?></div>
<?php echo form_open('auth/login');?>
<div class="form-group has-feedback">
<?php echo form_input($identity);?>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<?php echo form_input($password);?>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-8">
<div class="checkbox icheck">
<!-- <label>
<?php /*?> <?php echo form_checkbox('remember', '1', FALSE, 'id="remember"'); ?><?php echo lang('auth_remember_me'); ?><?php */?>
</label>-->
</div>
</div>
<div class="col-xs-4">
<?php /*?><?php echo form_submit('submit', lang('auth_login'), array('class' => 'btn btn-primary btn-block btn-flat'));?><?php */?>
<input type="submit" name="submit" value="Login" class="btn btn-primary btn-block btn-flat" style="background-color: #2f76bb;border-color: #2f76bb;">
</div>
</div>
<?php echo form_close();?>
код выше мой код страницы входа в систему
Мой код аутентификации
class Auth extends MY_Controller {
function __construct()
{
parent::__construct();
$this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));
$this->lang->load('auth');
}
function index()
{
if ( ! $this->ion_auth->logged_in())
{
redirect('auth/login', 'refresh');
}
else
{
redirect('/', 'refresh');
}
}
function login()
{
if ( ! $this->ion_auth->logged_in())
{
/* Load */
$this->load->config('admin/dp_config');
$this->load->config('common/dp_config');
/* Valid form */
$this->form_validation->set_rules('identity', 'Email', 'required|valid_email');
$this->form_validation->set_rules('password', 'Password', 'required');
/* Data */
$this->data['title'] = $this->config->item('title');
$this->data['title_lg'] = $this->config->item('title_lg');
$this->data['auth_social_network'] = $this->config->item('auth_social_network');
$this->data['forgot_password'] = $this->config->item('forgot_password');
$this->data['new_membership'] = $this->config->item('new_membership');
if ( $this->form_validation->run() == TRUE)
{
$remember = (bool) $this->input->post('remember');
if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember))
{
if ( ! $this->ion_auth->is_admin())
{
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect('/', 'refresh');
}
else
{
/* Data */
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
/* Load Template */
redirect('admin', 'refresh');
}
}
else
{
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect('auth/login', 'refresh');
}
}
else
{
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
$this->data['identity'] = array(
'name' => 'identity',
'id' => 'identity',
'type' => 'email',
'value' => $this->form_validation->set_value('identity'),
'class' => 'form-control',
'placeholder' => lang('auth_your_email')
);
$this->data['password'] = array(
'name' => 'password',
'id' => 'password',
'type' => 'password',
'class' => 'form-control',
'placeholder' => lang('auth_your_password')
);
if($this->session->flashdata('message'))
{
$this->data['forgot_password'] = TRUE;
}
/* Load Template */
$this->template->auth_render('auth/login', $this->data);
}
}
else
{
redirect('/', 'refresh');
}
}
Это мой код аутентификации.
Спасибо за аванс