oauth_client = new tmhOAuth( $config ); $code = $this->oauth_client->apponly_request(array( 'without_bearer' => true, 'method' => 'POST', 'url' => $config['host'], 'params' => array( 'oauth_callback' => $_SERVER['REQUEST_URI'], ), )); $this->oauth_url = $config['host']; //echo '
$config: '.print_r ( $_SERVER['REQUEST_URI'] , true ).'
'; } public function getUsers( $filters = array() ) { $code = $this->oauth_client->request( 'POST', $this->oauth_client->url($this->oauth_url, ''), array('moodle' => $_SERVER['HTTP_HOST'], 'query' => 'moodle/users') ); return $code==200?( $this->oauth_client->response['response'] ) : NULL; } public function getCgaps( $filters = array() ) { $code = $this->oauth_client->request( 'POST', $this->oauth_client->url($this->oauth_url, ''), array('moodle' => $_SERVER['HTTP_HOST'], 'query' => 'moodle/cgaps' ) ); return $code==200?( $this->oauth_client->response['response'] ) : NULL; } public function getAlumnesCgaps( $cgaps ) { $code = $this->oauth_client->request( 'POST', $this->oauth_client->url($this->oauth_url, ''), array('moodle' => $_SERVER['HTTP_HOST'], 'query' => 'moodle/cgaps.users', 'cgaps' => $cgaps ) ); return $code==200?( $this->oauth_client->response['response'] ) : NULL; } }