init commit
This commit is contained in:
33
backup/upload.php
Normal file
33
backup/upload.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// GLOBALS
|
||||
global $ServerSecret;
|
||||
$ServerSecret = 'e0VV7kkkYwK2';
|
||||
|
||||
// ARGS
|
||||
if (!isset($_GET['UserID']) OR !isset($_GET['ClientSecret'])) {
|
||||
return;
|
||||
}
|
||||
elseif ($_GET['ClientSecret'] != $GLOBALS['ServerSecret']) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$UserID = $_GET['UserID'];
|
||||
}
|
||||
|
||||
// VARS
|
||||
$filepath = $_FILES["file"]["tmp_name"];
|
||||
$OriginalFilename = $_FILES["file"]["name"];
|
||||
#$UsernameDir = "/var/www/zino/pkrstarsbot/upload/$UserID";
|
||||
$UsernameDir = "/home/pkrstarsbot/upload/$UserID";
|
||||
|
||||
// Make UserDir if not existent
|
||||
if (!file_exists($UsernameDir)) {
|
||||
mkdir($UsernameDir, 0755, true);
|
||||
#chown($UsernameDir, 'pkrstarsbot');
|
||||
}
|
||||
|
||||
// Move uploaded file to UserDir
|
||||
move_uploaded_file($filepath, "$UsernameDir/$OriginalFilename");
|
||||
#chgrp("$UsernameDir/$OriginalFilename","pkrstarsbot")
|
||||
#chown("$UsernameDir/$OriginalFilename", 'pkrstarsbot');
|
||||
?>
|
||||
Reference in New Issue
Block a user