summaryrefslogtreecommitdiff
path: root/www-ssl/inc/ShowUserPicture.php
diff options
context:
space:
mode:
authorcookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-15 17:07:27 +0000
committercookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-15 17:07:27 +0000
commitf446caee58e93823242b1dd76631783f198af5b1 (patch)
tree4ac4b0a497f4029bbfd07dff48317fb0f9a237cb /www-ssl/inc/ShowUserPicture.php
parentae10c6c89592d02a2e2ab8dff4c3764cb10f99da (diff)
bilder von user koennen in db abgelegt werden
git-svn-id: svn://svn.cccv.de/engel-system@210 29ba0400-6e00-0410-a75a-ca02368028f8
Diffstat (limited to 'www-ssl/inc/ShowUserPicture.php')
-rw-r--r--www-ssl/inc/ShowUserPicture.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/www-ssl/inc/ShowUserPicture.php b/www-ssl/inc/ShowUserPicture.php
new file mode 100644
index 00000000..218b2a24
--- /dev/null
+++ b/www-ssl/inc/ShowUserPicture.php
@@ -0,0 +1,52 @@
+<?PHP
+
+include ("./inc/config.php");
+include ("./inc/error_handler.php");
+include ("./inc/config_db.php");
+if( !isset($_SESSION)) session_start();
+include ("./inc/secure.php");
+
+
+// Parameter check
+if( !isset($_GET["UID"]) )
+ $_GET["UID"]= "-1";
+
+$SQL= "SELECT * FROM `UserPicture` WHERE `UID`='". $_GET["UID"]. "'";
+$res = mysql_query( $SQL, $con);
+
+if( mysql_num_rows($res) == 1)
+{
+ //genügend rechte
+ if( !isset($_SESSION['UID']) || $_SESSION['UID'] == -1)
+ {
+ header( "HTTP/1.0 403 Forbidden");
+ die( "403 Forbidden");
+ }
+ // ist das bild sichtbar?
+ if( mysql_result($res, 0, "show")=="N" )
+ {
+ $SQL= "SELECT * FROM `UserPicture` WHERE `UID`='-1'";
+ $res = mysql_query( $SQL, $con);
+ if( mysql_num_rows($res) != 1)
+ {
+ header( 'HTTP/1.0 404 Not Found');
+ die( "404 Not Found");
+ }
+ }
+
+ /// bild aus db auslesen
+ $bild = mysql_result($res, 0, "Bild");
+
+ // ausgabe bild
+ header( "Accept-Ranges: bytes");
+ header( "Content-Length: ". strlen($bild));
+ header( "Content-type: ". mysql_result($res, 0, "ContentType"));
+ echo $bild;
+}
+else
+{
+ header( 'HTTP/1.0 404 Not Found');
+ die( "404 Not Found");
+}
+
+?>