Remove subdomain file serving support

This commit is contained in:
Les De Ridder 2017-02-16 15:14:00 +01:00
parent 57cf11a558
commit 274042d17d
No known key found for this signature in database
GPG Key ID: 5EC132DFA85DB372
3 changed files with 2 additions and 15 deletions

View File

@ -3,10 +3,6 @@
define("CONFIG_SITE_NAME", "Uguu");
//Site root URL
define("CONFIG_ROOT_URL", "http://path.to.uguu");
//Enable this if you use a subdomain for serving uploaded files
define("CONFIG_SUBUPLOAD_URL_ENABLED", "false");
//Only define this if the above is set to true
define("CONFIG_SUBUPLOAD_URL", "http://a.uguu.se");
//Path to uploaded files
define("CONFIG_FILES_PATH", "/path/to/uguu/public/files/");
//Path to Uguu's files

View File

@ -45,12 +45,7 @@ function save_file ($file, $name, $arg, $type){
move_uploaded_file($file,CONFIG_FILES_PATH.$file_name);
//Check if html or plain text should be returned
if($type==='tool'){
//Return url+filename to the user (plain text)
if(CONFIG_SUBUPLOAD_URL_ENABLED == "true"){
echo CONFIG_SUBUPLOAD_URL.'/'.urlencode($file_name);
}else{
echo CONFIG_ROOT_URL.'/files/'.urlencode($file_name);
}
echo CONFIG_ROOT_URL.'/'.urlencode($file_name);
exit(0);
}elseif($type==='normal'){
//Return url+filename to the user (HTML)

View File

@ -7,11 +7,7 @@ $tpl = new RainTPL;
$title = "Temp File Hosting";
$tpl->assign("title", $title);
$tpl->draw("header");
if(CONFIG_SUBUPLOAD_URL_ENABLED == 'true'){
$tpl->assign("url_filename", CONFIG_SUBUPLOAD_URL.'/'.$n);
}else{
$tpl->assign("url_filename", CONFIG_ROOT_URL.'/'.$n);
}
$tpl->assign("url_filename", CONFIG_ROOT_URL.'/'.$n);
$tpl->assign("retention_time", CONFIG_MAX_RETENTION_TEXT);
$tpl->draw("upload-done");
$tpl->draw("footer");