/**
  * generate the user image, put it in the users folder and return it
  * @access public
  * @return void
  */
 public function generate_image()
 {
     $filename = $this->params['filename'];
     $login = basename($filename, '.png');
     $user = User::$objects->get_or_404('login = ?', array($login));
     $path = userImage_path($user);
     $image = generate_userImage($user, $path);
     $this->render_image($image->image);
     $image->destroy();
 }
/**
 * set the user image file to be generated again
 * @param User $user  user
 * @access public
 * @return void
 */
function must_regenerate_userImage($user)
{
    $path = userImage_path($user);
    if (file_exists($path)) {
        unlink($path);
    }
}