} } else { $passwordError = "Your passwords didn't match! Give it another shot."; } } else { if ($mod && $mod === 'delete') { if ($id && $token === $_SESSION['token'] && $user->getAttribute('user_id') === $id) { if ($user->delete()) { header('Location: ' . WEB_ROOT . '/logout'); exit; } } $deleteError = 'There was a problem deleting your account.'; } } $renderer->setTitle('Your info here'); $renderer->setKeywords(array('your', 'info', 'here')); $renderer->setDescription('Manage your account'); $renderer->addContent('account.tpl', array('user' => $user, 'filesCount' => count($files->getElements()), 'passwordError' => $passwordError, 'deleteError' => $deleteError, 'token' => $_SESSION['token'], 'passwordMessage' => $passwordMessage)); break; case 'files': $files = new Files(); $files->orderby('created DESC'); $files->getBy(array('_user_id' => $user->getAttribute('user_id'))); if ($mod && $mod === 'json') { header('Content-Type: application/json'); echo $files->getJSON(); exit; } else { if ($mod && $mod === 'delete') { header('Content-Type: application/json');