/**
  * @see	Page::readData()
  */
 public function readData()
 {
     $this->entry = new UserGuestbookEntry($this->entryID ? $this->entryID : null, array());
     $this->entryList = new UserGuestbookEntryList();
     $this->userPermissions = UserGuestbookUtil::getUserPermissions($this->frame->getUser());
     $this->modPermissions = UserGuestbookUtil::getModeratorPermissions($this->frame->getUser());
     $this->entryList->sqlConditions = 'entry.ownerID = ' . $this->frame->getUserID();
     if (!USER_GUESTBOOK_SHOW_DELETED_ENTRY_NOTE || !$this->modPermissions['canReadDeletedEntry']) {
         $this->entryList->sqlConditions = 'AND entry.isDeleted = 0';
     }
     $this->entryList->sqlOrderBy = 'entry.time DESC, entry.entryID DESC';
     $this->verifyData();
     $this->verifyPermissions();
     if ($this->entry->entryID) {
         $this->calculatePageNo();
     }
     parent::readData();
     $this->entryList->sqlOffset = $this->startIndex - 1;
     $this->entryList->sqlLimit = $this->itemsPerPage;
     $this->entryList->readObjects();
     $this->entryList->readOwners();
     $this->entryList->readAuthors();
 }
 /**
  * Checks if the user has the permission to view the specified resources.
  */
 public function verifyPermissions()
 {
     $this->userPermissions = UserGuestbookUtil::getUserPermissions($this->entry->getOwner());
     $this->modPermissions = UserGuestbookUtil::getModeratorPermissions($this->entry->getOwner());
     if (!$this->userPermissions['canUseGuestbook'] || !$this->userPermissions['canViewGuestbook'] || !$this->entry->getOwner()->canViewProfile()) {
         throw new PermissionDeniedException();
     }
     if (!$this->entry->getOwner()->getPermission('user.guestbook.canUseGuestbook')) {
         throw new IllegalLinkException();
     }
     if ($this->entry->isDeleted && !$this->modPermissions['canReadDeletedEntry']) {
         throw new PermissionDeniedException();
     }
 }