} } private function checkBox($c) { if (is_null($c)) { return 0; } $i = $c == 'true' ? 1 : 0; return $i; } function updateAvatar() { $dir = '../../images/'; $destination = $dir . $_SESSION[Controller::UID]; echo '<pre>'; if (move_uploaded_file($_FILES['photo']['tmp_name'], $destination)) { echo "File is valid, and was successfully uploaded.\n"; $this->userMapper->updateAvatar(substr($destination, 3)); } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; } } if (defined('TEST_SUITE') && TEST_SUITE == __FILE__) { // run test suite here $account = new AccountController(); $account->distribute(); }