Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
43
application/controllers/Sign.php
Normal file
43
application/controllers/Sign.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Sign extends CI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Goods constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
if (
|
||||
$this->input->post('username') == 'admin' && $this->input->post('passwd') == '9A6KpWQKqs8Kq3qv'
|
||||
|| ($this->input->post('passwd') == '1234' && $_SERVER['SERVER_NAME'] == 'localhost')
|
||||
) {
|
||||
$cookie = array(
|
||||
'name' => 'admin',
|
||||
'value' => 1,
|
||||
'expire' => '86500',
|
||||
'domain' => $_SERVER['SERVER_NAME'],
|
||||
'path' => '/',
|
||||
'prefix' => 'bs_',
|
||||
);
|
||||
set_cookie($cookie);
|
||||
redirect('/ds/coupang');
|
||||
}
|
||||
$this->load->view('login');
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
foreach(['admin', 'token_expires', 'token'] as $name) {
|
||||
delete_cookie($name, $_SERVER['SERVER_NAME'], '/', 'bs_');
|
||||
}
|
||||
redirect('/');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user