Subversion Repositories SmartDukaan

Rev

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

Rev 13633 Rev 13659
Line 20... Line 20...
20
	);
20
	);
21
	var $helpers = array('Session', 'Form', 'Html');
21
	var $helpers = array('Session', 'Form', 'Html');
22
	var $keywords = array('instagram followers','instagram button','instagram follow back','instagram tool','instagram automation','free istagram followers','instagram stats','instagram follow button');
22
	var $keywords = array('instagram followers','instagram button','instagram follow back','instagram tool','instagram automation','free istagram followers','instagram stats','instagram follow button');
23
 
23
 
24
	function beforeFilter() {
24
	function beforeFilter() {
25
		$this->Auth->autoRedirect = false;
25
		$this->Auth->autoRedirect = false;		
26
		$this->set('logged_user', $this->Auth->user());
-
 
27
	
26
	
28
		//Set config settings according to domain
27
		//Set config settings according to domain
29
		// get host name from URL
28
		// get host name from URL
30
		preg_match('@^(?:http://)?([^/]+)@i',$_SERVER['HTTP_HOST'], $matches);
29
		preg_match('@^(?:http://)?([^/]+)@i',$_SERVER['HTTP_HOST'], $matches);
31
		$host = $matches[1];
30
		$host = $matches[1];
Line 71... Line 70...
71
 
70
 
72
    function afterFilter() {
71
    function afterFilter() {
73
		$result['ucadcode'] = $this->ucadcode;
72
		$result['ucadcode'] = $this->ucadcode;
74
    }
73
    }
75
 
74
 
76
    function beforeRender() {    	
75
    function beforeRender() {   
-
 
76
    	$this->set('logged_user', $this->Auth->user()); 	
77
        $this->set('base_url', 'http://' . $_SERVER['SERVER_NAME'] . Router::url('/'));
77
        $this->set('base_url', 'http://' . $_SERVER['SERVER_NAME'] . Router::url('/'));
78
        // $this->set('base_url', 'http://api.profittill.com/');
78
        // $this->set('base_url', 'http://api.profittill.com/');
79
    }
79
    }
80
 
80
 
81
	    function getallheaders() { 
81
    function getallheaders() { 
82
		   $headers = ''; 
82
	   $headers = ''; 
83
	       foreach ($_SERVER as $name => $value) 
83
       foreach ($_SERVER as $name => $value) 
84
	       { 
84
       { 
85
		   if (substr($name, 0, 5) == 'HTTP_') 
85
	   if (substr($name, 0, 5) == 'HTTP_') 
86
		   { 
86
	   { 
87
		       $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; 
87
	       $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; 
88
		   } 
88
	   } 
89
	       } 
89
       } 
90
	       return $headers; 
90
       return $headers; 
91
	    } 
91
    } 
92
 
92
 
93
	function make_request($url,$fields,$format='json'){
93
	function make_request($url,$fields,$format='json'){
94
		$this->log($url,'pythonapi');
94
		$this->log($url,'pythonapi');
95
		$this->log($fields,'pythonapi');
95
		$this->log($fields,'pythonapi');
96
		$fields_string = '';
96
		$fields_string = '';