application/core/Common_Service_Controller.php
/**
     * Check user header informatiom before login or signup user
     * param like deviceId, device type
    */
Check user header informatiom before login or signup user
param like deviceId, device type
Check user header informatiom before login or signup user param like deviceId device type
public function check_user_header(){
        $this->request_headers = $this->_head_args;
        $headers = $this->request_headers;
        $headers      = array_change_key_case($headers, CASE_LOWER);
        if(!isset($headers['device-id']) || !isset($headers['device-type']) || !isset($headers['device-timezone'])) {
            $this->auth_error_msg(HEADERS_MISSING, get_response_message(110), BAD_REQUEST);
        }
        extract($headers);
        if($headers['device-id'] == "")
        {
           $this->response($this->token_error_msg(1,513,"INVALID_PARAM_VALUE"), BAD_REQUEST); 
        }
        if($headers['device-timezone'] == "")
        {
           $this->response($this->token_error_msg(1,514,"INVALID_PARAM_VALUE"), BAD_REQUEST); 
        }
        $list = array(1, 2, 3);
        if(!in_array($headers['device-type'], $list))
        {
           $this->response($this->token_error_msg(1,515,"INVALID_PARAM_VALUE"), BAD_REQUEST); 
        }
        if($headers['device-timezone'] == "")
        {
           $this->response($this->token_error_msg(1,516,"INVALID_PARAM_VALUE"), BAD_REQUEST); 
        }
        $res = array('device_id'=>$headers['device-id'],'device_type'=>$headers['device-type'],'device_timezone'=>$headers['device-timezone']);
        return $res ;
    }
public function check_user_header ( ) { $ this -> request_headers = $ this -> _head_args ; $ headers = $ this -> request_headers ; $ headers = array_change_key_case ( $ headers , CASE_LOWER ) ; if ( ! isset ( $ headers [ 'device-id' ] ) || ! isset ( $ headers [ 'device-type' ] ) || ! isset ( $ headers [ 'device-timezone' ] ) ) { $ this -> auth_error_msg ( HEADERS_MISSING , get_response_message ( 110 ) , BAD_REQUEST ) ; } extract ( $ headers ) ; if ( $ headers [ 'device-id' ] == " " ) { $ this -> response ( $ this -> token_error_msg ( 1 , 513 , " INVALID_PARAM_VALUE " ) , BAD_REQUEST ) ; } if ( $ headers [ 'device-timezone' ] == " " ) { $ this -> response ( $ this -> token_error_msg ( 1 , 514 , " INVALID_PARAM_VALUE " ) , BAD_REQUEST ) ; } $ list = array ( 1 , 2 , 3 ) ; if ( ! in_array ( $ headers [ 'device-type' ] , $ list ) ) { $ this -> response ( $ this -> token_error_msg ( 1 , 515 , " INVALID_PARAM_VALUE " ) , BAD_REQUEST ) ; } if ( $ headers [ 'device-timezone' ] == " " ) { $ this -> response ( $ this -> token_error_msg ( 1 , 516 , " INVALID_PARAM_VALUE " ) , BAD_REQUEST ) ; } $ res = array ( 'device_id' => $ headers [ 'device-id' ] , 'device_type' => $ headers [ 'device-type' ] , 'device_timezone' => $ headers [ 'device-timezone' ] ) ; return $ res ; }
Check user header informatiom before login or signup user
 param like deviceId, device type
Check user header informatiom before login or signup user param like deviceId device type
/*
         * Convert all keys to lower case as some server manipulates header keys
         * Header keys should always be treated as case insensitive
         */ // check device type if other than 1, 2 and 3