db_file = '/home/bohwaz/svn/misc/apps/fotoo/hosting/datas.db'; // Path to where the pictures are stored. #$config->storage_path = '/home/bohwaz/svn/misc/apps/fotoo/hosting/i/'; // URL of the webservice index. #$config->base_url = 'http://misc.svn/apps/fotoo/hosting/'; // URL to where the pictures are stored. Filename is added at the end. #$config->storage_url = 'http://misc.svn/apps/fotoo/hosting/i/'; // URL to the picture information page, hash is added at the end. #$config->image_page_url = 'http://misc.svn/apps/fotoo/hosting/?'; // Max image width, bigger images will be resized. #$config->max_width = 1920; // Max image height, bigger images will be resized. #$config->max_height = 1200; // Thumb width, used for creating thumbnails. #$config->thumb_width = 320; // Thumb height, used for creating thumbnails. #$config->thumb_height = 240; // Title of the service. #$config->title = 'Fotoo Image Hosting service'; // CSS style used on the pages. /* $config->style = ' body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; background: #fff; color: #000; } input, textarea { color: #000; background: #fff; border: 1px solid #000; -moz-border-radius: 3px; border-radius: 3px; } h1, #footer, #page, #header { text-align: center; font-size: 1em; max-width: 60em; margin: 0 auto; } h1 a { font-size: 2em; color: #000; } #header a { color: #666; } #header { color: #999; font-size: 0.9em; } .error { color: red; } form dl dt { font-weight: bold; padding: 0.4em 0; width: 25%; float: left; clear: left; text-align: right; margin-bottom: 1em; } form dl dd { margin-left: 30%; text-align: left; margin-bottom: 1em; } #f_preview_item { margin-top: 1em; } input#f_name, input#f_file { padding: 0.3em; width: 25em; } dd.private { padding: 0.4em; } dd.private input { padding: 0.2em; margin-right: 1em; } p.submit { width: 36em; } p.submit img { display: none; } p.submit input { padding: 0.3em; font-size: 1.2em; cursor: pointer; font-weight: bold; text-decoration: underline; } p.uploading input { display: none; } p.uploading img { display: inline; } #footer { margin-top: 2em; border-top: 1px solid #ccc; padding: 0.5em; text-align: center; } .examples textarea, .examples input { width: 95%; padding: 0.3em; font-family: Sans-serif; font-size: 11px; } .examples dt { font-weight: bold; padding: 1em 0 0.5em; } a img { border: none; } p.thumb img { background-image: url("bg.png"); border: 1px solid #999; } p.info { color: #999; font-size: 0.9em; } p.info a { color: #666; } table.list { width: 100%; } table.list td { width: 20%; height: 12em; margin: 1em; vertical-align: bottom; padding: 0; overflow: hidden; } table.list td a { font-weight: bold; color: #000; } table.list td .thumb img { background: url("bg.png"); border: 1px solid #999; max-width: 10em; max-height: 9em; } table.list td.thumb { background: url("bg.png"); border: 1px solid #999; } table.list td.thumb div { background: no-repeat center center; width: 100%; height: 12em; } table.list td.thumb a.trick { display: block; width: 100%; height: 10.5em; } table.list td.thumb a { color: #fff; text-shadow: #000 0 0 5px; } .pagination { list-style-type: none; text-align: center; } .pagination li { display: inline; margin: 0.5em; } .pagination a { color: #666; } .pagination .selected a { font-weight: bold; font-size: 1.3em; color: #000; } .admin { margin: 3em 0; } .admin a { color: red; font-size: 1.3em; border: 2px outset #ccc; padding: 5px; } '; */ // Maximum uploaded file size (in bytes). By default it's the maximum // size allowed by the PHP configuration. See the FAQ for more // informations. #$config->max_file_size = 8388608; // Allow upload of files? You can use this to restrict upload access. See // the FAQ for more informations. $config->allow_upload = true; function check_upload_access() { $username = 'bohwaz'; $password = 'abcd'; if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) && $_SERVER['PHP_AUTH_USER'] == $username && $_SERVER['PHP_AUTH_PW'] == $password) { return true; } else { header('WWW-Authenticate: Basic realm="FotooHosting"'); header('HTTP/1.0 401 Unauthorized'); die("Unauthorized access forbidden!"); } } // Enable admin interface? this allows for deleting pictures and displays private pictures $config->enable_admin = 'check_admin_access'; function check_admin_access () { global $config; $secret = 'mypassword'; $secret = sha1($secret . $_SERVER['REMOTE_ADDR']); if (isset($_GET['logout'])) { setcookie('admin', '', time() + (3600 * 24 * 90)); header('Location: '.$config->base_url); exit; } if (!empty($_COOKIE['admin']) && $_COOKIE['admin'] == $secret) { return true; } if (!empty($_GET['login'])) { if (sha1($_GET['login'] . $_SERVER['REMOTE_ADDR']) == $secret) { setcookie('admin', $secret, time() + (3600 * 24 * 90)); header('Location: '.$config->base_url); exit; } else { die("Wrong password!"); } } return false; } // Number of images to display on each page in the pictures list. #$config->nb_pictures_by_page = 20; ?>