Файл: databasr/application/controllers/Login.php
Строк: 36
<?php
class Login extends CI_Controller
{
public function index()
{
$this->template->view('login/index');
}
public function auth()
{
$post = $this->input->post();
$config['hostname'] = "localhost";
$config['username'] = $post['username'];
$config['password'] = $post['password'];
$config['database'] = $post['database'];
$config['dbdriver'] = "mysqli";
$config['dbprefix'] = "";
$config['pconnect'] = false;
$config['db_debug'] = false;
$db = $this->load->database($config, TRUE);
// store connection config
$this->session->set_userdata($config);
redirect(site_url());
}
public function logout()
{
$this->session->sess_destroy();
redirect(site_url("login"));
}
}