Subversion Repositories SmartDukaan

Rev

Rev 15767 | Rev 16234 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15767 Rev 15848
Line 362... Line 362...
362
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
362
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
363
		curl_setopt($ch, CURLOPT_POST, true);
363
		curl_setopt($ch, CURLOPT_POST, true);
364
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); // note the PUT here
364
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); // note the PUT here
365
 
365
 
366
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
366
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
367
		curl_setopt($ch, CURLOPT_HEADER, true);
367
		// curl_setopt($ch, CURLOPT_HEADER, true);
368
 
368
 
369
		curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
369
		curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
370
		    'Content-Type: application/json',                                                                                
370
		    'Content-Type: application/json',                                                                                
371
		    'Content-Length: ' . strlen($data_string)                                                                       
371
		    'Content-Length: ' . strlen($data_string)                                                                       
372
		));       
372
		));       
373
 
373
 
374
		// execute the request
374
		// execute the request
375
 
375
 
376
		$output = curl_exec($ch);
376
		$output = curl_exec($ch);
377
		$result = $this->request->data['value'];
377
		// $result = $this->request->data['value'];
378
		$this->log("[response] ".print_r($output,1),'api');
378
		$this->log("[response] ".print_r($output,1),'api');
379
		curl_close($ch);
379
		curl_close($ch);
380
		// $this->set(array(
380
		// $this->set(array(
381
		    // 'result' => $result,
381
		    // 'result' => $result,
382
		    // '_serialize' => array('result')
382
		    // '_serialize' => array('result')
383
		// ));
383
		// ));
384
		// $this->render('/Elements/json');
384
		// $this->render('/Elements/json');
-
 
385
		$result = json_decode($output,1);
385
		return $result;
386
		return $result;
386
	}
387
	}
387
 
388
 
388
	function getAutoLoginUrl($userId,$next) {
389
	function getAutoLoginUrl($userId,$next) {
389
		$saholicoffline = Configure::read('saholicoffline');
390
		$saholicoffline = Configure::read('saholicoffline');