0byt3m1n1
Path:
/
data
/
applications
/
aps
/
tikiwiki
/
7.0-0
/
standard
/
htdocs
/
[
Home
]
File: tiki-show_user_avatar.php
<?php // (c) Copyright 2002-2011 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id: tiki-show_user_avatar.php 33195 2011-03-02 17:43:40Z changi67 $ require 'tiki-setup.php'; $access->check_feature('feature_userPreferences'); global $userprefslib, $tikidomain; include_once ('lib/userprefs/userprefslib.php'); // application to display an image from the database with // option to resize the image dynamically creating a thumbnail on the fly. // you have to check if the user has permission to see this gallery if (!isset($_REQUEST["user"])) { die; } $info = $userprefslib->get_user_avatar_img($_REQUEST["user"]); $type = $info["avatarFileType"]; $content = $info["avatarData"]; if (empty($content) && isset($_REQUEST['always'])) { $content = file_get_contents('pics/noavatar.png'); } header("Content-type: $type"); echo $content; if( $prefs['users_serve_avatar_static'] == 'y' ) { require 'lib/mime/mimeextensions.php'; $ext = $mimeextensions[$type]; $image = "temp/public/$tikidomain/avatar_{$_REQUEST['user']}.$ext"; file_put_contents( $image, $info['avatarData'] ); chmod($image, 0644); }