mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 04:38:27 +01:00
Bugtracker #4354 - admin can upload new avatar for user
This commit is contained in:
parent
1ba47a0c75
commit
596e0cb65e
@ -12,8 +12,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/upload_handler.php,v $
|
||||
| $Revision: 1.11 $
|
||||
| $Date: 2007-12-11 21:17:59 $
|
||||
| $Revision: 1.12 $
|
||||
| $Date: 2008-03-17 20:45:29 $
|
||||
| $Author: e107steved $
|
||||
+---------------------------------------------------------------+
|
||||
*/
|
||||
@ -451,13 +451,21 @@ function file_upload($uploaddir, $avatar = FALSE, $fileinfo = "", $overwrite = "
|
||||
if($uploaddir == e_THEME) {$upload_storagetype = 1;}
|
||||
$options['save_to_db'] = ($upload_storagetype == "2" && $avatar == FALSE);
|
||||
|
||||
if (strpos($avatar,'=') !== FALSE)
|
||||
{
|
||||
list($avatar,$param) = explode('=',$avatar,2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$param = USERID;
|
||||
}
|
||||
switch ($avatar)
|
||||
{
|
||||
case 'attachment' :
|
||||
$avatar = "attachment+".$fileinfo;
|
||||
break;
|
||||
case 'avatar' :
|
||||
$avatar = 'prefix+ap_'.USERID.'_'; // Prefix unique to user
|
||||
$avatar = 'prefix+ap_'.$param.'_'; // Prefix unique to user
|
||||
$options['overwrite'] = TRUE; // Allow update of avatar with same file name
|
||||
break;
|
||||
}
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/usersettings.php,v $
|
||||
| $Revision: 1.23 $
|
||||
| $Date: 2008-01-17 22:17:41 $
|
||||
| $Revision: 1.24 $
|
||||
| $Date: 2008-03-17 20:45:29 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
|
||||
@ -306,7 +306,7 @@ if (isset($_POST['updatesettings']))
|
||||
require_once(e_HANDLER."upload_handler.php");
|
||||
require_once(e_HANDLER."resize_handler.php");
|
||||
|
||||
if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar"))
|
||||
if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar=".$udata['user_id']))
|
||||
{
|
||||
foreach ($uploaded as $upload)
|
||||
{ // Needs the latest upload handler (with legacy and 'future' interfaces) to work
|
||||
|
Loading…
x
Reference in New Issue
Block a user