<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');
@session_start();

class Admin extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }
    public function index()
    {
        if($_SESSION['admin'])
        {
            $this->load->model('service_model');
            $this->data['services'] = $this->service_model->getServices();
            //главная страница — Социальные службы
            $this->load->view('admin/home', $this->data);
        }
        else
        {
            $this->load->view('admin/header');
            $this->load->view('admin/login');
            $this->load->view('admin/footer');
        }

    }
    public function auth()
    {
        $post = $this->input->post();
        if (empty($post)) {
            return false;
        }
        $this->load->model('user_model');
        $post['login'] = md5($post['login']);
        $data = array('login' => $post['login'], 'password' => $post['password']);
        if ($this->user_model->auth($data)) {
            $_SESSION['admin'] = true;
            // редирект на главную
        } else {
            echo 'Ошибка авторизации';<commit_msg>routing<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');
@session_start();

class Admin extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }
    public function index()
    {
        if($_SESSION['admin'])
        {
            $this->load->model('service_model');
            $this->data['services'] = $this->service_model->getServices();
            //главная страница — Социальные службы
            $this->load->view('admin/header');
            $this->load->view('admin/home', $this->data);
            $this->load->view('admin/footer');

        }
        else
        {
            $this->load->view('admin/header');
            $this->load->view('admin/login');
            $this->load->view('admin/footer');
        }

    }
    public function auth()
    {
        $post = $this->input->post();
        if (empty($post)) {
            return false;
        }
        $this->load->model('user_model');
        $post['login'] = md5($post['login']);
        $data = array('login' => $post['login'], 'password' => $post['password']);
        if ($this->user_model->auth($data)) {
            $_SESSION['admin'] = true;
            // редирект на главную
        } else {
            echo 'Ошибка авторизации';
{'fraction_non_alphanumeric': 0.18007202881152462, 'fraction_numerical': 0.0008003201280512205, 'mean_word_length': 2.026634382566586, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '105867', 'n_tokens_mistral': 712, 'n_tokens_neox': 731, 'n_words': 127}