Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 519 → Rev 518

/_taios.php
223,58 → 223,6
return $newstr;
}
 
function acceptFile($fname)
{
if (!ALLOW_FILES)
{
$page->drawError("This system doesn't allow file uploading.");
return false;
}
$this->checkLoggedIn();
if ($this->getLoggedInUser()->accessID >= 2)
{
$page->drawError('You do not have permission to access this page.');
}
$allowedExts = array("gif", "jpeg", "jpg", "png", "tga");
$temp = explode(".", $_FILES[$fname]["name"]);
$extension = end($temp);
if ((($_FILES[$fname]["type"] == "image/gif")
|| ($_FILES[$fname]["type"] == "image/jpeg")
|| ($_FILES[$fname]["type"] == "image/jpg")
|| ($_FILES[$fname]["type"] == "image/pjpeg")
|| ($_FILES[$fname]["type"] == "image/x-png")
|| ($_FILES[$fname]["type"] == "image/png")
|| ($_FILES[$fname]["type"] == "image/tga"))
&& ($_FILES[$fname]["size"] < 200000) // file size limit (bytes)
&& in_array($extension, $allowedExts))
{
if ($_FILES[$fname]["error"] > 0)
{
$page->drawError("File Upload Error: " . $_FILES[$fname]["error"]);
}
else
{
$lname = "upload/" . $this->rndString(12) . "." . $extension;
while (file_exists($lname))
{
$lname = "upload/" . $this->rndString(12) . "." . $extension;
}
move_uploaded_file($_FILES[$fname]["tmp_name"], $lname);
return $lname;
}
}
else
{
$page->drawError("Invalid file");
}
return false;
}
 
function redirect($u)
{
header('Location: ' . $u);
/blog/add-post-img.php
File deleted
/_config.dummy.php
3,8 → 3,6
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'taios');
define('MYSQL_PASSWORD', 'dummy');
define('ALLOW_FILES', false);
define('ROOT_PATH', 'http://wolves.org/~dummy/taios/');
define('RECAPTCHA_PUBLICKEY', 'dummy');
define('RECAPTCHA_PRIVATEKEY', 'dummy');