當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CI_Input類代碼示例

本文整理匯總了PHP中CI_Input的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Input類的具體用法?PHP CI_Input怎麽用?PHP CI_Input使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CI_Input類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validate

 /**
  * Validate that the given username and password are valid
  *
  * @param string  $user     Username
  * @param string  $pass     Password
  * @param boolean $isMd5    Flag to indicate whether incoming password 
  *                          is plaintext or md5
  *
  * @return boolean
  */
 public function validate($user, $userPass, $isMd5 = false, CI_Input $input = null)
 {
     $ret = $this->getUserByUsername($user);
     // make sure we're using an md5 format, passwords are hashed md5s (yes, really)
     $pass = $isMd5 ? $userPass : md5($userPass);
     // did we get a row and do the passwords match?
     if (isset($ret[0])) {
         if (password_verify($pass, $ret[0]->password)) {
             return true;
         } else {
             // may be the password in the database was stored when CI's
             // global_xss_filtering was set to true. We can only test for
             // this if the password passed in was not md5'd.
             if (false === $isMd5) {
                 $pass = $input->xss_clean($userPass);
                 $pass = md5($pass);
                 if (password_verify($pass, $ret[0]->password)) {
                     // it was! Let's store the actually $userPass
                     $password = password_hash(md5($userPass), PASSWORD_DEFAULT);
                     $this->db->where('username', $user);
                     $this->db->update('user', array('password' => $password));
                     return true;
                 }
             }
         }
     }
     return false;
 }
開發者ID:asgrim,項目名稱:joind.in,代碼行數:38,代碼來源:user_model.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('user_model');
     $this->load->helper('url_helper');
     $input = new CI_Input();
     $this->params = array_merge($input->get(), $input->post());
     $this->checkLogin();
 }
開發者ID:ammilly,項目名稱:family,代碼行數:9,代碼來源:Family.php

示例3: employee_login

 function employee_login(CI_Input $input)
 {
     $ci = get_instance();
     $ci->load->model('Employees');
     $result = $ci->Employees->employee_login($input->post('employeenumber'), $input->post('password'));
     if (isset($result) && count($result) != 0) {
         $ci->session->set_userdata(array('employeenumber' => $result[0]->EmployeeNumber, 'campaignid' => $result[0]->Campaignid, 'department' => $result[0]->Department, 'positionid' => $result[0]->PositionID));
         employee_redirect($result[0]->Department);
     } else {
         return "Employee is either inactive or does not exist.";
     }
 }
開發者ID:hfugen112678,項目名稱:webforms,代碼行數:12,代碼來源:my_login_helper.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     //$this->load = load_class('Loader', 'core');
     //$this->load->initialize();
     $this->load->model('user_model');
     //$/this->load->helper('url_helper');
     //$this->user_model = new User_Model();
     //load_class('');
     $input = new CI_Input();
     $this->params = array_merge($input->get(), $input->post());
 }
開發者ID:ammilly,項目名稱:family,代碼行數:12,代碼來源:MyHook.php

示例5: __construct

 function __construct()
 {
     parent::CI_Input();
     /* allow $_GET */
     $pos = strrpos($_SERVER['REQUEST_URI'], '?');
     $qry = is_int($pos) ? substr($_SERVER['REQUEST_URI'], ++$pos) : '';
     parse_str($qry, $_GET);
     /* allow $_GET */
 }
開發者ID:Rundiz,項目名稱:vee-manga-reader,代碼行數:9,代碼來源:MY_Input.php

示例6: index

 public function index()
 {
     $this->load->view('layout/header');
     $error = $this->session->flashdata('message');
     $this->load->view('element/message', ['success' => $error]);
     $filter = $this->input->get(['from', 'till', 'groups']);
     $from = $filter['from'] ?: date('Y-m-01', strtotime('-1 month'));
     $till = $filter['till'] ?: date('Y-m-t');
     $responseData = [];
     $step = 500;
     $offset = 0;
     do {
         $response = $this->moneyzaurus->transactionsList($offset, $step, $from, $till, null, null, null);
         if ($response['code'] == 200 && $response['data']['success']) {
             $count = $response['data']['count'];
             $responseData = array_merge($responseData, $response['data']['data']);
             $offset += $step;
         } else {
             break;
         }
     } while ($count >= $step);
     $filterGroups = $filter['groups'] ?: [];
     $data = $this->prepareChartData($responseData, $filterGroups, $from, $till);
     $this->load->view('page/chart', ['data' => $data, 'from' => $from, 'till' => $till]);
     $this->load->view('layout/footer');
 }
開發者ID:andrejsstepanovs,項目名稱:moneyzaurus-ci,代碼行數:26,代碼來源:Chart.php

示例7: processResponseData

 private function processResponseData(array $response)
 {
     if (!$this->input->is_ajax_request()) {
         redirect('/');
     }
     $this->output->set_content_type('application/json');
     if ($response['code'] == 200) {
         if ($response['data']['success']) {
             $this->output->set_output(json_encode($response['data']['data']));
         }
     }
 }
開發者ID:andrejsstepanovs,項目名稱:moneyzaurus-ci,代碼行數:12,代碼來源:Ajax.php

示例8: index

 public function index()
 {
     $items = $this->input->post('items');
     $data = $this->vaola->prepareData($items);
     try {
         $this->vaola->sync($data);
         $message = 'Saved';
     } catch (\Exception $exc) {
         $message = $exc->getMessage();
     }
     $args = ['message' => $message, 'boxes' => count($data)];
     $this->load->view('layout/header.php');
     $this->load->view('page/save', $args);
     $this->load->view('layout/footer.php');
 }
開發者ID:andrejsstepanovs,項目名稱:inventur,代碼行數:15,代碼來源:Save.php

示例9: index

 public function index()
 {
     $this->load->view('layout/header');
     $error = $this->session->flashdata('message');
     $this->load->view('element/message', ['success' => $error]);
     $offset = 0;
     $limit = 100;
     $filter = $this->input->get(['item', 'group', 'price', 'from', 'till']);
     $response = $this->moneyzaurus->transactionsList($offset, $limit, $filter['from'], $filter['till'], $filter['item'], $filter['group'], $filter['price'] * 100);
     if ($response['code'] == 200) {
         if ($response['data']['success']) {
             $this->load->view('page/data', ['count' => $response['data']['count'], 'data' => $response['data']['data'], 'filter' => $filter]);
         }
     }
     $this->load->view('layout/footer');
 }
開發者ID:andrejsstepanovs,項目名稱:moneyzaurus-ci,代碼行數:16,代碼來源:Data.php

示例10: showError

 function MY_Controller()
 {
     parent::Controller();
     //當前用戶信息初始化
     $this->load->library('User', null, 'userLib');
     $userInfo = $this->userLib->getUserInfo();
     $this->user = $userInfo;
     if (!$this->user) {
         showError($this->userLib->error, '/');
     }
     /* if (in_array($this->user['userId'], array(694,3767,3868))) {
            showError('測試賬號禁止進去正式地址');
        } */
     //加載菜單,全局使用
     $this->load->library('Navbar', $this->user);
     $this->navbarList = $this->navbar->getNavbarList();
     //公告內容
     $this->load->model('HelperNoticeModel');
     $this->viewData['noticeData'] = $this->HelperNoticeModel->getLatest($this->user['userRole']);
     if ($this->viewData['noticeData']) {
         $this->navbarList[] = array('Help', 'noticeCheck', 'title' => '公告');
     }
     //當前選中菜單默認為當前控製器
     $this->navbarFocus = $this->input->get('c');
     //當前默認選中的菜單項
     $this->navChildFocus = $this->input->get('c') . '_' . $this->input->get('m');
     //當前主題
     $this->theme = $this->config->item('theme');
     //加載認證類,全局可以調用
     $this->load->library('Auth', $this->user);
     //麵包屑導航
     $this->viewData['breadcrumb'][] = array('url' => printUrl('Main', 'index'), 'title' => '首頁');
     //加載時段模型
     $this->load->model('timeUnitModel');
 }
開發者ID:zhaojianhui129,項目名稱:qirmp2016,代碼行數:35,代碼來源:MY_Controller.php

示例11: post

	function post($index = '', $xss_clean = FALSE)
	{
		if($index === '')
			return ($_SERVER['REQUEST_METHOD'] === 'POST');

		return parent::post($index, $xss_clean);
	}
開發者ID:JDougherty,項目名稱:Network-Management-System,代碼行數:7,代碼來源:MY_Input.php

示例12: post

 function post($index = '', $xss_clean = FALSE)
 {
     if ($index === '') {
         $return = $_POST ? TRUE : FALSE;
         return $return;
     }
     return parent::post($index, $xss_clean);
 }
開發者ID:RVRKC,項目名稱:Hackathon_2015,代碼行數:8,代碼來源:MY_Input.php

示例13: post

 public function post($index = null, $xss_clean = TRUE)
 {
     if (!$xss_clean) {
         //if asked for raw post data -eg. post('key', false)-, return raw data. Use with caution.
         return $this->_POST_RAW[$index];
     }
     return parent::post($index, $xss_clean);
 }
開發者ID:acutedeveloper,項目名稱:openreach-connected-ci,代碼行數:8,代碼來源:MY_Input.php

示例14: get

 /**
  * @param null $index
  * @param bool $xss_clean
  * @param null $default_value
  * @return array|null|string
  */
 function get($index = NULL, $xss_clean = FALSE, $default_value = NULL)
 {
     $ret_val = parent::get($index, $xss_clean);
     if ($ret_val === false && isset($default_value)) {
         $ret_val = $default_value;
     }
     return $ret_val;
 }
開發者ID:janladaking,項目名稱:CodeIgniter,代碼行數:14,代碼來源:MY_Input.php

示例15: register

 public function register()
 {
     $data = $this->input->post(['email', 'password']);
     $response = $this->moneyzaurus->userRegister($data['email'], $data['password']);
     if ($response['code'] == 200) {
         if (!$response['data']['success']) {
             $this->session->set_flashdata('message', $response['data']['message']);
             redirect('');
         }
         $message = sprintf('Hi %s', $response['data']['data']['email']);
         $this->session->set_flashdata('message', $message);
         if ($this->loginCustomer($data['email'], $data['password'])) {
             redirect('/transaction');
         }
     }
     redirect('');
 }
開發者ID:andrejsstepanovs,項目名稱:moneyzaurus-ci,代碼行數:17,代碼來源:Login.php


注:本文中的CI_Input類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。