HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/biologia/administrator/components/com_oziogallery3/views/rights/view.raw.php
<?php
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class OzioViewRights extends JViewLegacy
{
    function display($tpl = null)
    {
		$app = JFactory::getApplication();
		$app->setHeader('Access-Control-Allow-Origin', 'https://www.opensourcesolutions.es');				

		$document = JFactory::getDocument();
		$document->setMimeEncoding('application/json');
		
		$jinput = $app->input;

		$new_access= $jinput->post->get('new_access', '', 'RAW');
		if (!in_array($new_access,array('public','private','protected'))){
			die();
		}
		$url=$jinput->post->get('url', '', 'RAW');
		$access_token=$jinput->post->get('access_token', '', 'RAW');;
		if (empty($access_token)){
			die();
		}

		if (strpos($url,'https://picasaweb.google.com')!==0){
			die();
		}

		$xml="<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gphoto='http://schemas.google.com/photos/2007'>
		  <gphoto:access>".$new_access."</gphoto:access>
		</entry>";

		$url=$url."&access_token=".$access_token;

		$curl = curl_init($url);
		curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");
		curl_setopt($curl, CURLOPT_HEADER, false);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml',"GData-Version: 2","If-Match: *"));
		curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($curl, CURLOPT_VERBOSE, true);

		// Make the REST call, returning the result
		$response = curl_exec($curl);

		$resp=json_decode($response,true);

		echo json_encode(array("response"=>$resp));		

        //parent::display($tpl);
    }
}