• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CI_Input类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CI_Input的典型用法代码示例。如果您正苦于以下问题:PHP CI_Input类的具体用法?PHP CI_Input怎么用?PHP CI_Input使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CI_Input类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: post

 public function post($index = NULL, $xss_clean = NULL, $default_value = NULL)
 {
     $value = parent::post($index, $xss_clean);
     if (empty($value) && $default_value !== NULL) {
         $value = $default_value;
     }
     return $value;
 }
开发者ID:abhinaykrupa,项目名称:1s,代码行数:8,代码来源:MY_Input.php


示例17: ajax

 public function ajax($function)
 {
     if (!$this->input->is_ajax_request() || !method_exists($this, $function)) {
         show_404();
         return false;
     }
     $this->{$function}();
     return true;
 }
开发者ID:Speennaker,项目名称:tanyaprykhodko,代码行数:9,代码来源:MY_base_controller.php


示例18: post

 function post($index = '', $xss_clean = FALSE)
 {
     // this will be true if post() is called without arguments
     if ($index === '') {
         return $_SERVER['REQUEST_METHOD'] === 'POST';
     }
     // otherwise do as normally
     return parent::post($index, $xss_clean);
 }
开发者ID:priyasyal,项目名称:hwsports,代码行数:9,代码来源:MY_Input.php


示例19: elseif

 function MY_Input()
 {
     parent::__construct();
     if ($this->server('REQUEST_METHOD') == 'DELETE') {
         parse_str(file_get_contents('php://input'), $this->delete);
         $this->delete = $this->_clean_input_data($this->delete);
     } elseif ($this->server('REQUEST_METHOD') == 'PUT') {
         parse_str(file_get_contents('php://input'), $this->put);
         $this->put = $this->_clean_input_data($this->put);
     }
 }
开发者ID:khaledaSabina,项目名称:php-codeigniter-tips-tricks,代码行数:11,代码来源:MY_Input.php


示例20: getAllTransactions

 private function getAllTransactions($months)
 {
     $filter = $this->input->get(['from', 'till', 'groups']);
     $from = $filter['from'] ?: date('Y-m-01', strtotime('-' . (int) $months . ' 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);
     return $responseData;
 }
开发者ID:andrejsstepanovs,项目名称:moneyzaurus-ci,代码行数:20,代码来源:Manager.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CI_Lang类代码示例发布时间:2022-05-23
下一篇:
PHP CI_Form_validation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap