authenticate("write"); if (!$gallery->checkAuthenticatedUser()) { $gallery->error("You do not have permission to upload photos to this account"); } $size = $_FILES['file']['size']; $filename = $_FILES['file']['tmp_name']; $title = stripslashes($_REQUEST['title']); $description = stripslashes($_REQUEST['description']); $tags = stripslashes($_REQUEST['tags']); $privacy = $_REQUEST['privacy']; if (!empty($filename) && is_uploaded_file($filename) && $size > 0) { $isPublic = 0; $isFriend = 0; $isFamily = 0; switch ($privacy) { case "public": $isPublic = 1; break; case "friends": $isFriend = 1; break; case "family": $isFamily = 1; break; case "friendsfamily": $isFriend = 1; $isFamily = 1; break; } $id = $gallery->uploadPhoto($filename, $title, $description, $tags, $isPublic, $isFriend, $isFamily); } header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/index.php'); ?>