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:
@@ -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.
|
||||
|
@@ -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++;
|
||||
}
|
||||
|
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user