Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
306 additions
and
35 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
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 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,80 @@ | ||
<?php | ||
|
||
$name=$_REQUEST["username"]; | ||
$token=$_REQUEST["token"]; | ||
$machineId=$_REQUEST["machineId"]; | ||
$projectId=$_REQUEST["projectId"]; | ||
|
||
//echo var_dump($_FILES); | ||
|
||
$thumbnailFile=$_FILES["thumbnail"]; | ||
$projectFile=$_FILES["project"]; | ||
|
||
if (!$name) { | ||
echo "{\"string\":Username not provided.}"; | ||
exit; | ||
} | ||
if (!$token) { | ||
echo "{\"string\":Token not provided.}"; | ||
exit; | ||
} | ||
if (!$machineId) { | ||
echo "{\"string\":Machine ID not provided.}"; | ||
exit; | ||
} | ||
if (!$projectId) { | ||
echo "{\"string\":Project Id not provided.}"; | ||
exit; | ||
} | ||
|
||
// Load help class | ||
require_once("properties.php"); | ||
|
||
// Load properties | ||
$dbProperties = new Properties(); | ||
$propertiesFile = fopen("db.properties", "rb"); | ||
$dbProperties->load($propertiesFile); | ||
|
||
// Connect to the DB | ||
$username=$dbProperties->getProperty("user"); | ||
$password=$dbProperties->getProperty("pass"); | ||
$database=$dbProperties->getProperty("db"); | ||
$mysqli = new mysqli(localhost,$username,$password,$database); | ||
|
||
// Verify that the user is logged in | ||
$sql = " | ||
SELECT user_id | ||
FROM diylc_user | ||
WHERE name = \"".addslashes($name)."\" AND token= \"".addslashes($token)."\" AND machine_id = \"".addslashes($machineId)."\""; | ||
|
||
if (!$result = $mysqli->query($sql)) { | ||
echo "{\"string\":Error while looking up the user.}"; | ||
exit; | ||
} | ||
|
||
if ($row = $result->fetch_assoc()) { | ||
$userId = $row["user_id"]; | ||
|
||
// Update the existing project in the database | ||
$sql= " | ||
UPDATE diylc_project | ||
SET deleted = 1 | ||
WHERE project_id=".addslashes($projectId)." AND owner_user_id=".$userId; | ||
|
||
//echo "{\"string\":\"".$sql."\"}"; | ||
//exit; | ||
|
||
if (!$result = $mysqli->query($sql) || $mysqli->affected_rows == 0) { | ||
echo "{\"string\":\"Error while deleting the project from the database. ".$mysqli->error."\"}"; | ||
exit; | ||
} else { | ||
echo "{\"string\":Success}"; | ||
|
||
} | ||
} else { | ||
echo "{\"string\":User is not logged in.}"; | ||
} | ||
|
||
$mysqli->close(); | ||
|
||
?> |
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,3 +1,3 @@ | ||
{"list":{"org.diylc.announcements.Announcement":[ | ||
{"title":"Welcome note","date":"2016-10-25","text":"Thank you for trying out the latest and greatest DIYLC beta version.<br>Please note that all project submitted during beta testing stage will be deleted<br> once the we are ready for the release for a fresh start.<br>Enjoy surfing the cloud and please send your feedback to bancika@gmail.com"}, | ||
{"title":"Welcome note","date":"2016-11-12","text":"Thank you for trying out the latest and greatest DIYLC.<br>The new version brings \"Project Cloud\" feature I worked on over the last few months.<br>Enjoy surfing the cloud and please send your feedback to bancika@gmail.com"}, | ||
]}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<html> | ||
<body> | ||
<form method="POST" action="http://www.diy-fever.com/diylc/api/upload.php" enctype="multipart/form-data"> | ||
Username: <input type="text" name="username" value="testUser3"> | ||
<br> | ||
MachineId: <input type="text" name="machineId" value="tttjg"> | ||
<br> | ||
Token: <input type="text" name="token" value="testUser35800ffaabb0b92.58166942"> | ||
<br> | ||
Name: <input type="text" name="projectName" value=""> | ||
<br> | ||
Category: <input type="text" name="category" value="TestCat"> | ||
<br> | ||
Description: <input type="text" name="description" value="The quick brown fox jumps over the lazy dog."> | ||
<br> | ||
Version: <input type="text" name="diylcVersion" value="3.0.0"> | ||
<br> | ||
Keywords: <input type="text" name="keywords" value=""> | ||
<br> | ||
Thumb: <input type="file" name="thumbnail" id="thumbnail"> | ||
<br> | ||
Project: <input type="file" name="project" id="project"> | ||
<br> | ||
<input type="submit" name="submit" value="Submit"> | ||
</form> | ||
</body> | ||
</html> |
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
Oops, something went wrong.