/**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get profile frame
     $this->frame = new UserProfileFrame($this);
     if (!$this->frame->getUser()->shareWhitelist) {
         throw new IllegalLinkException();
     }
     $this->userID = $this->frame->getUserID();
 }
 /**
  * @see Page::show()
  */
 public function show()
 {
     // set active menu item
     UserProfileMenu::getInstance()->setActiveMenuItem('wcf.user.profile.menu.link.infraction');
     // check permission
     if (!USER_CAN_SEE_HIS_WARNINGS || WCF::getUser()->userID != $this->frame->getUserID()) {
         WCF::getUser()->checkPermission('admin.user.infraction.canWarnUser');
     }
     parent::show();
 }
 /**
  * @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();
 }
 /**
  * @see Page::show()
  */
 public function show()
 {
     // set active menu item
     UserProfileMenu::getInstance()->setActiveMenuItem('wcf.user.profile.menu.link.profile');
     // update profile hits
     if ($this->frame->getUserID() != WCF::getUser()->userID && !WCF::getSession()->spiderID) {
         $sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\tSET\tprofileHits = profileHits + 1\n\t\t\t\tWHERE\tuserID = " . $this->frame->getUserID();
         WCF::getDB()->registerShutdownUpdate($sql);
         // save visitor
         if (WCF::getUser()->userID && !WCF::getUser()->invisible) {
             $sql = "INSERT INTO\t\t\twcf" . WCF_N . "_user_profile_visitor\n\t\t\t\t\t\t\t\t\t(ownerID, userID, time)\n\t\t\t\t\tVALUES\t\t\t\t(" . $this->frame->getUserID() . ", " . WCF::getUser()->userID . ", " . TIME_NOW . ")\n\t\t\t\t\tON DUPLICATE KEY UPDATE\t\ttime = VALUES(time)";
             WCF::getDB()->registerShutdownUpdate($sql);
         }
     }
     parent::show();
 }