/**
  * Constructor
  *
  * @param \phpbb\request\request_interface $phpbb_request
  */
 public function __construct(\phpbb\request\request_interface $phpbb_request)
 {
     $get_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::GET);
     $post_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::POST);
     $server_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::SERVER);
     $files_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::FILES);
     $cookie_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::COOKIE);
     parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
 }
Exemple #2
0
 /**
  * Returns the cached current_uri object or creates and caches it if it is
  * not already created. In each case the query string is updated based on
  * the $query parameter.
  *
  * @param	string	$service_name	The name of the service
  * @param	string	$query			The query string of the current_uri
  *									used in redirects
  * @return	\OAuth\Common\Http\Uri\UriInterface
  */
 protected function get_current_uri($service_name, $query)
 {
     if ($this->current_uri) {
         $this->current_uri->setQuery($query);
         return $this->current_uri;
     }
     $uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
     $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER));
     $current_uri->setQuery($query);
     $this->current_uri = $current_uri;
     return $current_uri;
 }
Exemple #3
0
 /**
  * Returns the cached current_uri object or creates and caches it if it is
  * not already created. In each case the query string is updated based on
  * the $query parameter.
  *
  * @param	string	$service_name	The name of the service
  * @param	string	$query			The query string of the current_uri
  *									used in redirects
  * @return	\OAuth\Common\Http\Uri\UriInterface
  */
 protected function get_current_uri($service_name, $query)
 {
     if ($this->current_uri) {
         $this->current_uri->setQuery($query);
         return $this->current_uri;
     }
     $uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
     $super_globals = $this->request->get_super_global(\phpbb\request\request_interface::SERVER);
     if (!empty($super_globals['HTTP_X_FORWARDED_PROTO']) && $super_globals['HTTP_X_FORWARDED_PROTO'] === 'https') {
         $super_globals['HTTPS'] = 'on';
         $super_globals['SERVER_PORT'] = 443;
     }
     $current_uri = $uri_factory->createFromSuperGlobalArray($super_globals);
     $current_uri->setQuery($query);
     $this->current_uri = $current_uri;
     return $current_uri;
 }
Exemple #4
0
 public function rfd_api_pre_create_topic(phpbbEvent $event)
 {
     $data = $event->get_data();
     $forum_id = $data['forum_id'];
     $errors = $data['errors'];
     $post = $this->request->get_super_global(\phpbb\request\request::POST);
     $type = $post['trader_type'];
     //TODO:: resolve the trader_type parameter
     if ($this->manager->getForumStatus($forum_id)) {
         $type = $this->manager->validateForumType($forum_id, $type, true);
         // Expose error if trader_type is not supported by the forum
         if (is_null($type)) {
             $errors[] = 'This forum does not support that trader type';
             $data['errors'] = $errors;
             $event->set_data($data);
         } else {
             $this->request->overwrite('prefixfield', $type, \phpbb\request\request_interface::POST);
         }
     }
 }