Initial commit as of 2018-10-16
This commit is contained in:
36
application/core/MY_Controller.php
Normal file
36
application/core/MY_Controller.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class MY_Controller extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct(...$names)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('cookie');
|
||||
|
||||
$lang = isset($_SESSION['site_lang']) ? $_SESSION['site_lang'] : 'de';
|
||||
$_SESSION['site_lang'] = $lang;
|
||||
|
||||
foreach($this->lang->is_loaded as $loadedName => $loadedLang) {
|
||||
if($loadedLang != $lang) {
|
||||
$this->lang->load($loadedName, 'de'); // Fallback
|
||||
$this->lang->load($loadedName, $lang);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($names as $name) {
|
||||
$this->lang->load($name, 'de');
|
||||
$this->lang->load($name, $lang);
|
||||
}
|
||||
|
||||
setlocale(LC_TIME, $lang);
|
||||
|
||||
$rememberMe = get_cookie('rememberMe');
|
||||
|
||||
if($rememberMe != NULL) {
|
||||
$token = get_cookie('token');
|
||||
var_dump($rememberMe, $token);
|
||||
}
|
||||
}
|
||||
}
|
11
application/core/index.html
Normal file
11
application/core/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user