mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[feature/avatars] Support proper avatar deletion, stub ACP
Fixing avatar deletion in the UCP and ACP, and stubbing the ACP configuration page. I'll admit I kind of got caught carried away, so this really should be a couple separate commits. PHPBB3-10018
This commit is contained in:
committed by
Cullen Walsh
parent
611a1d647a
commit
84099e5bc1
@@ -114,4 +114,12 @@ abstract class phpbb_avatar_driver
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
**/
|
||||
public function delete($user_row)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -121,6 +121,22 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function delete($user_row)
|
||||
{
|
||||
$ext = substr(strrchr($user_row['user_avatar'], '.'), 1);
|
||||
$filename = $this->phpbb_root_path . $this->config['avatar_path'] . '/' . $this->config['avatar_salt'] . '_' . $user_row['user_id'] . '.' . $ext;
|
||||
|
||||
if (file_exists($filename))
|
||||
{
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
*/
|
||||
|
@@ -47,6 +47,20 @@ class phpbb_avatar_manager
|
||||
$this->load_valid_drivers();
|
||||
}
|
||||
|
||||
// Legacy stuff...
|
||||
switch ($avatar_type)
|
||||
{
|
||||
case AVATAR_LOCAL:
|
||||
$avatar_type = 'local';
|
||||
break;
|
||||
case AVATAR_UPLOAD:
|
||||
$avatar_type = 'upload';
|
||||
break;
|
||||
case AVATAR_REMOTE:
|
||||
$avatar_type = 'remote';
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset(self::$valid_drivers[$avatar_type]))
|
||||
{
|
||||
if ($new || !is_object(self::$valid_drivers[$avatar_type]))
|
||||
|
Reference in New Issue
Block a user