Example #1
0
 public function index()
 {
     //	Page title
     //	==========
     $this->data['page']->title = $this->_shop_name;
     // --------------------------------------------------------------------------
     //	Categories
     //	==========
     $this->data['categories'] = $this->shop_category_model->get_all_nested();
     dumpanddie($this->data['categories']);
     //	Tags
     //	====
     $this->data['tags'] = array('tags');
     //	Featured Products
     //	=================
     $this->data['products_featured'] = array('featured products');
     // --------------------------------------------------------------------------
     $this->load->view('structure/header', $this->data);
     $this->load->view($this->_skin->path . 'views/front/index', $this->data);
     $this->load->view('structure/footer', $this->data);
 }
Example #2
0
 function lastquery($die = TRUE)
 {
     $_last_query = get_instance()->db->last_query();
     // --------------------------------------------------------------------------
     if ($die) {
         dumpanddie($_last_query);
     } else {
         dump($_last_query);
     }
 }
Example #3
0
 /**
  * Verify the connection request
  *
  * @access	private
  * @param	none
  * @return	void
  **/
 private function _connect_verify()
 {
     //	Check the state
     $_code = $this->input->get('code');
     $_state = $this->input->get('state');
     $_session_state = $this->session->userdata('li_state');
     if ($_state !== $_session_state) {
         //	Possible CSRF
         //	TODO
         dumpanddie('bad state');
     } else {
         //	Check integrity of state
         $_state = $this->encrypt->decode($_session_state, APP_PRIVATE_KEY);
         $_state = explode('|', $_state);
         //	Same IP?
         if ($this->input->ip_address() != $_state[2]) {
             //	TODO
             dumpanddie('bad IP');
         }
         //	Hash ok?
         $_hash = md5($_state[0] . $_state[1] . $_state[2] . APP_PRIVATE_KEY);
         if ($_hash != $_state[3]) {
             //	TODO
             dumpanddie('bad hash');
         }
     }
     //$this->session->unset_userdata( 'li_state' );
     // --------------------------------------------------------------------------
     //	Errors?
     if ($this->input->get('error')) {
         $this->_connect_fail();
         return;
     }
     // --------------------------------------------------------------------------
     //	Request an access token
     $_params = array();
     $_params['nailsLIConnectReturnTo'] = $this->_return_to;
     $_params['nailsLIConnectReturnToFail'] = $this->_return_to_fail;
     $_params = array_filter($_params);
     $_callback = site_url('auth/li/connect/verify') . '?' . http_build_query($_params);
     $_access_token = $this->li->get_access_token($_callback, $_code);
     // --------------------------------------------------------------------------
     if (!empty($_access_token->access_token)) {
         //	Fetch the user's ID
         $_me = $this->li->get('people/~:(id,firstName,lastName,email-address)');
         if (empty($_me->id)) {
             $this->_connect_fail();
             return;
         } else {
             $_access_token->user_id = $_me->id;
             $_access_token->first_name = $_me->firstName;
             $_access_token->last_name = $_me->lastName;
             $_access_token->email = $_me->emailAddress;
         }
         $this->_connect_success($_access_token);
     } else {
         $this->_connect_fail();
     }
 }
 /**
  * @param string $sAddress  The address to look up
  * @return \Nails\GeoCode\Result\LatLng
  */
 public function lookup($sAddress)
 {
     dumpanddie('@todo');
 }
Example #5
0
 protected function _payment_eway()
 {
     dumpanddie('TODO: eWay interface');
 }
Example #6
0
 /**
  * Generates a properly hashed expiring url
  *
  * @access	public
  * @param	string	$bucket		The bucket which the image resides in
  * @param	string	$object		The object to be served
  * @param	string	$expires	The length of time the URL should be valid for, in seconds
  * @return	string
  **/
 public function url_expiring($object, $bucket, $expires)
 {
     dumpanddie('TODO: If cloudfront is configured, then generate a secure url and pass pack, if not serve through the processing mechanism. Maybe.');
     //	Hash the expirey time
     $_hash = get_instance()->encrypt->encode($bucket . '|' . $object . '|' . $expires . '|' . time() . '|' . md5(time() . $bucket . $object . $expires . APP_PRIVATE_KEY), APP_PRIVATE_KEY);
     $_hash = urlencode($_hash);
     $_out = 'cdn/serve?token=' . $_hash;
     $_out = site_url($_out);
     return $this->_url_make_secure($_out);
 }