forked from gitbot/uguu
slim down
parent
1d15881dee
commit
74d3554fa6
|
@ -31,7 +31,7 @@ define('UGUU_ADMIN_USER', 'admin');
|
||||||
define('UGUU_ADMIN_PASS', '$2y$12$.NHW25QBD/XPSYkNe6tEtObwEXsJeiQIo3xWidU.21ECkFMK.SE8C%');
|
define('UGUU_ADMIN_PASS', '$2y$12$.NHW25QBD/XPSYkNe6tEtObwEXsJeiQIo3xWidU.21ECkFMK.SE8C%');
|
||||||
|
|
||||||
/** Log IP of uploads */
|
/** Log IP of uploads */
|
||||||
define('LOG_IP', 'no');
|
define('LOG_IP', 'false');
|
||||||
|
|
||||||
/** Anti-dupe files */
|
/** Anti-dupe files */
|
||||||
define('UGUU_DUPE', 'false');
|
define('UGUU_DUPE', 'false');
|
||||||
|
|
|
@ -105,7 +105,7 @@ function uploadFile($file)
|
||||||
// Check if a file with the same hash and size (a file which is the same)
|
// Check if a file with the same hash and size (a file which is the same)
|
||||||
// does already exist in the database; if it does, return the proper link
|
// does already exist in the database; if it does, return the proper link
|
||||||
// and data. PHP deletes the temporary file just uploaded automatically.
|
// and data. PHP deletes the temporary file just uploaded automatically.
|
||||||
if(UGUU_DUPE == 'true'){
|
if(UGUU_DUPE){
|
||||||
$q = $db->prepare('SELECT filename, COUNT(*) AS count FROM files WHERE hash = (:hash) '.
|
$q = $db->prepare('SELECT filename, COUNT(*) AS count FROM files WHERE hash = (:hash) '.
|
||||||
'AND size = (:size)');
|
'AND size = (:size)');
|
||||||
$q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);
|
$q->bindValue(':hash', $file->getSha1(), PDO::PARAM_STR);
|
||||||
|
@ -150,7 +150,7 @@ function uploadFile($file)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add it to the database
|
// Add it to the database
|
||||||
if(LOG_IP == 'yes'){
|
if(LOG_IP){
|
||||||
$q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
|
$q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ip) VALUES (:hash, :orig, :name, :size, :date, :ip)');
|
||||||
}else{
|
}else{
|
||||||
$ip = '0';
|
$ip = '0';
|
||||||
|
|
Loading…
Reference in New Issue