Commit f69f4a81 authored by Gabriel Genois's avatar Gabriel Genois

...

parent 7030e430
default]
name=Default
runtime=host
config-opts=
run-opts=
prefix=/home/me/.cache/gnome-builder/install/dsfr/host
app-id=
postbuild=
prebuild=
default=true
/app_keys.json
/api_keys.json
/data/*
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -7,7 +7,7 @@
public $file_data_ext = 'data';
public $result = array();
public $iKey = 1;
public $rKey = json_decode(file_get_contents("./api_keys.json"), true);
public $rKey = array();
public $get_param = "q";
public function do_upload()
{
......@@ -49,12 +49,14 @@
}
public function init()
{
$this->rKey = json_decode(file_get_contents(dirname( __FILE__ )."/api_keys.json"), true);
//print_r($this->rKey);
if(isset($_FILES[$this->form_element]))
{
if ($this->iKey) {
if(isset($_POST['key']))
if(isset($_POST['api_key']))
{
if(in_array($_POST['key'], $this->rKey))
if(in_array($_POST['api_key'], $this->rKey))
{
$this->do_upload();
}
......
<form action="/dsfr/" method="post" enctype="multipart/form-data">
<form action="/local/dsfr/" method="post" enctype="multipart/form-data">
<input name="upload[]" type="file" multiple="multiple" id="upload" /><br />
<input name="key" type="text" value="abc" /><br />
<input name="api_key" type="text" value="abc" /><br />
<input type="submit" name="s" value="send" />
</form>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment