当前位置: 首页>>代码示例>>PHP>>正文


PHP auth::__construct方法代码示例

本文整理汇总了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;
 }
开发者ID:marttkip,项目名称:erp_hotel,代码行数:8,代码来源:charts.php

示例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']);
     }
 }
开发者ID:EwanZhang,项目名称:FamilyTree,代码行数:9,代码来源:user.php

示例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();
     }
 }
开发者ID:antoalexnta,项目名称:FamilyTree-1,代码行数:15,代码来源:user.php

示例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;
     }
 }
开发者ID:korolariya,项目名称:kulinar,代码行数:42,代码来源:upload.php


注:本文中的auth::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。