Admin_UserController::getImageAction PHP Метод

getImageAction() публичный Метод

public getImageAction ( )
    public function getImageAction()
    {
        if ($this->getParam("id")) {
            if ($this->getUser()->getId() != $this->getParam("id")) {
                $this->checkPermission("users");
            }
            $id = $this->getParam("id");
        } else {
            $id = $this->getUser()->getId();
        }
        $userObj = User::getById($id);
        $thumb = $userObj->getImage();
        header("Content-type: image/png", true);
        while (@ob_end_flush()) {
        }
        flush();
        readfile($thumb);
        exit;
    }