-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from lucideus-repo/dev
New vulnerabilities and modules introduced.
- Loading branch information
Showing
66 changed files
with
15,363 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
Header set Access-Control-Allow-Origin "*" | ||
Header set Access-Control-Allow-Headers "*" | ||
Header set Access-Control-Allow-Methods "*" | ||
Header set Access-Control-Allow-Credentials "true" | ||
Header set Access-Control-Allow-Credentials "true" | ||
RewriteEngine On | ||
RewriteCond %{HTTP:Authorization} ^(.*) | ||
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] | ||
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM php:7.2.7-fpm-alpine | ||
COPY . /var/www/html | ||
RUN apk update && apk add bash | ||
WORKDIR /var/www/html | ||
RUN docker-php-ext-install mysqli \ | ||
&& chown -Rf www-data:www-data /var/www/html | ||
|
||
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /tmp/ | ||
RUN chmod -R 777 /var/www/html | ||
RUN chmod +x /tmp/wait-for-it.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
defined('BASEPATH') or exit('No direct script access allowed'); | ||
require APPPATH . '/libraries/REST_Controller.php'; | ||
|
||
class ContactUs extends CI_Controller | ||
{ | ||
public function aa(){ | ||
$this->load->helper('request_response'); | ||
$headers = request_parse(); | ||
|
||
|
||
echo json_encode($headers); | ||
} | ||
|
||
public function index() | ||
{ | ||
$this->load->helper('global_methods'); | ||
$this->load->helper('request_response'); | ||
$headers = getRequestHeaders(); | ||
$data = file_get_contents('php://input'); | ||
if (isJson($data)) { | ||
$post = json_decode(file_get_contents('php://input'), true); | ||
$data = array('status_code' => 'ALLOK1'); | ||
foreach ($post['requestBody'] as $key => $value) { | ||
$data[$key] = $value; | ||
} | ||
$data = $data['data']; | ||
|
||
if (array_key_exists("name", $data)) { | ||
$message = 'Thanks for contacting us ' . $data["name"] . '. We will get back to you soon!'; | ||
echo prepare_response( | ||
"Success", | ||
"CTS001", | ||
$message, | ||
time(), | ||
array() | ||
); | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
"CTS002", | ||
"Error while submitting the response", | ||
time(), | ||
array() | ||
); | ||
|
||
} | ||
} elseif (array_key_exists("accept", $headers) && $headers["accept"] == 'application/xml') { | ||
|
||
$xmlfile = file_get_contents('php://input'); | ||
$dom = new DOMDocument(); | ||
$dom->loadXML($xmlfile, LIBXML_NOENT | LIBXML_DTDLOAD); | ||
$xmlData = simplexml_import_dom($dom); | ||
if (isset($xmlData->name)) { | ||
$name = $xmlData->name; | ||
$message = 'Thanks for contacting us ' . $name . '. We will get back to you soon!'; | ||
echo prepare_response( | ||
"Success", | ||
"CTS001", | ||
$message, | ||
time(), | ||
array() | ||
); | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
"CTS002", | ||
"Error while submitting the response", | ||
time(), | ||
array() | ||
); | ||
} | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
"CTS002", | ||
"Error while submitting the response", | ||
time(), | ||
array() | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
defined('BASEPATH') or exit('No direct script access allowed'); | ||
require APPPATH . '/libraries/REST_Controller.php'; | ||
|
||
class EditUser extends CI_Controller | ||
{ | ||
|
||
public function editUserDetails() | ||
{ | ||
$this->load->helper('request_response'); | ||
$status = new status_codes(); | ||
|
||
$parsed = request_parse(); | ||
if ($parsed['status_code'] != 'ALLOK1') { | ||
echo prepare_response( | ||
'Failed', | ||
$parsed['status_code'], | ||
$parsed['message'], | ||
time(), | ||
(object)array() | ||
); | ||
} else { | ||
$this->load->helper('session'); | ||
// check for valid user session | ||
$token = get_sessionId($parsed); | ||
if ($token != null) { | ||
$account_id = is_valid_session($token); | ||
if ($account_id != null) { | ||
$this->load->model('Model_edit_account'); | ||
$is_valid_param = $this->Model_edit_account->validateEditUserApiParameter($account_id, $parsed["data"]); | ||
if ($is_valid_param['status_code'] == "ALLOK1") { | ||
$this->Model_edit_account->editUserData($account_id, $parsed["data"]); | ||
echo prepare_response( | ||
"Success", | ||
$status::EditSuccess['status_code'], | ||
$status::EditSuccess['message'], | ||
time(), | ||
(object)array() | ||
); | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
$is_valid_param['status_code'], | ||
$is_valid_param['message'], | ||
time(), | ||
(object)array() | ||
); | ||
} | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
$status::InvalidSession['status_code'], | ||
$status::InvalidSession['message'], | ||
time(), | ||
(object)array() | ||
); | ||
} | ||
} else { | ||
echo prepare_response( | ||
"Failed", | ||
$status::RequestParameterNotSet['status_code'], | ||
$status::RequestParameterNotSet['message'], | ||
time(), | ||
(object)array() | ||
); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.