1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-11 21:15:09 +02:00

Avatar path corrections.

This commit is contained in:
Cameron
2013-04-19 22:50:41 -07:00
parent 42c47b7742
commit 1500effbd7
13 changed files with 78 additions and 86 deletions

View File

@@ -105,7 +105,7 @@ if (count($allowed_types) == 0)
//echo "Allowed filetypes = ".implode(', ',array_keys($allowed_types)).'<br />';
// avatar check.
$public = array(e_UPLOAD, e_UPLOAD.'avatars');
$public = array(e_UPLOAD, e_AVATAR_UPLOAD);
$exceptions = array(".","..","/","CVS","avatars","Thumbs.db",".ftpquota",".htaccess","php.ini",".cvsignore",'e107.htaccess');
//TODO use $file-class to grab list and perform this check.

View File

@@ -2032,10 +2032,11 @@ if (isset($_POST['submit_show_delete_multi']))
*/
if (isset($_POST['submit_show_deleteall']))
{
$handle = opendir(e_UPLOAD."avatars/");
$handle = opendir(e_AVATAR_UPLOAD);
$dirlist = array();
while ($file = readdir($handle)) {
if (!is_dir(e_UPLOAD."avatars/{$file}") && $file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') {
while ($file = readdir($handle))
{
if (!is_dir(e_AVATAR_UPLOAD.$file) && $file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') {
$dirlist[] = $file;
}
}
@@ -2050,7 +2051,7 @@ if (isset($_POST['submit_show_deleteall']))
$image_name = basename($image_name);
$image_todb = $tp->toDB($image_name);
if (!$sql->db_Count('user', '(*)', "WHERE user_image='-upload-{$image_todb}' OR user_sess='{$image_todb}'")) {
unlink(e_UPLOAD."avatars/".$image_name);
unlink(e_AVATAR_UPLOAD.$image_name);
$imgList .= '[!br!]'.$image_name;
$count++;
}

View File

@@ -1151,7 +1151,7 @@ function update_706_to_800($type='')
$root_media = str_replace(basename(e_MEDIA)."/","",e_MEDIA);
$user_media_dirs = array("images","avatars", "avatars/default", "avatars/uploaded", "files","temp","videos","icons");
$user_media_dirs = array("images","avatars", "avatars/default", "avatars/upload", "files","temp","videos","icons");
// check for old paths and rename.
if(is_dir($root_media."images") || is_dir($root_media."temp"))
@@ -1185,9 +1185,9 @@ function update_706_to_800($type='')
if ($just_check) return update_needed('Avatar paths require updating.');
foreach($avatar_images as $av)
{
$apath = (strstr($av['path'],'public/')) ? 'uploaded/' : 'default/';
$apath = (strstr($av['path'],'public/')) ? e_AVATAR_UPLOAD : e_AVATAR_DEFAULT;
@rename($av['path'].$av['fname'],e_MEDIA."avatars/".$apath. $av['fname']);
@rename($av['path'].$av['fname'], $apath. $av['fname']);
}
}