deleted avatars

fixed deleting avatars while user deleting
This commit is contained in:
2015-02-14 12:12:51 +01:00
parent 12cd5888c5
commit 79034dd314
3 changed files with 2 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -227,6 +227,8 @@ class AdminController extends Controller
if (!isset($_POST['rejected'])) if (!isset($_POST['rejected']))
{ {
$this->getModel('UsersModel')->deleteUser($_GET['id']); $this->getModel('UsersModel')->deleteUser($_GET['id']);
if ($user_info['avatar'] != null) //delete user's avatar
unlink('./'.$user_info['avatar']);
$this->getView('MainView')->forum_message('Profile deleted. Redirecting to users list...', 'index.php?mode=admin&submode=users'); $this->getView('MainView')->forum_message('Profile deleted. Redirecting to users list...', 'index.php?mode=admin&submode=users');
$lockv = true; $lockv = true;
} }