本文整理汇总了PHP中auth::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::__construct方法的具体用法?PHP auth::__construct怎么用?PHP auth::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth
的用法示例。
在下文中一共展示了auth::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct()
{
parent::__construct();
$this->load->model('charts_model');
$this->load->model('dates_model');
$this->load->model('reports_model');
$this->days = 7;
}
示例2: __construct
public function __construct()
{
parent::__construct();
global $_SESSION;
if ($this->check_session() == true) {
//populate user data and set class variables to authenticated else normal
$this->populate_data($_SESSION['id']);
}
}
示例3: __construct
/**
* Constructor of the class
* @global type $_SESSION The Superglobal session variable
*/
public function __construct()
{
parent::__construct();
global $_SESSION;
if ($this->check_session() == true) {
//populate user data and set class variables to authenticated else normal
$this->populate_data($_SESSION['id']);
//Insert this recent activity time in the database
$this->update_lastlogin();
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
$msg = array();
if (isset($_POST['user'])) {
$user_p = json_decode($_POST['user']);
}
$user = json_decode($this->get_user_in());
$collation = $user_p->token == $user->token ? true : false;
if ($collation) {
$this->user_id = $user->user_id;
if (!empty($_FILES)) {
//Нужно еще сделать проверку на тип файлов
$tempPath = $_FILES['file']['tmp_name'];
$uploadPath = '../uploads' . DIRECTORY_SEPARATOR . $user->user_id . '_' . $_FILES['file']['name'];
move_uploaded_file($tempPath, $uploadPath);
//Запись изображения в базу
$insert_arr = array('user_id' => $this->user_id, 'path' => "{$uploadPath}");
$result = $this->mysql_insert('photos', $insert_arr);
$msg['answer'] = 'Файлы успешно загружены';
$msg['confirm'] = $collation;
$msg['record_in_db'] = $result;
$msg['status'] = 1;
$msg['msg'] = 'Изображения успешно загружены';
$msg['photo']['id'] = $this->last_id;
$msg['photo']['path'] = $uploadPath;
if (!$result) {
$msg['query'] = $this->query;
$msg['log'] = $this->log;
}
$this->answer = $msg;
} else {
$this->answer = array('answer' => 'No files');
}
} else {
$msg['status'] = 0;
$msg['msg'] = 'Пройдите авторизацию';
$msg['user_p'] = $user_p->token;
$msg['user'] = $user->token;
$this->answer = $msg;
}
}