/** * Add meta tags 'qid' and 'lmts' for * last modified timestamp * The javascript will be able to query the server * to check for the new answers for this qid since that lmts * Some of these meta tags will be used by JavaScript * to determine if viewer has permissions to comment * * @return object $this */ protected function addMetaTags() { $this->addMetaTag('lmts', $this->Question['i_lm_ts']); $this->addMetaTag('qid', $this->Question['_id']); $this->addMetaTag('asker_id', $this->Question->getOwnerId()); $this->addMetaTag('etag', $this->Question['i_etag']); $this->addMetaTag('min_com_rep', $this->Registry->Ini->POINTS->COMMENT); $this->addMetaTag('comment', $this->Registry->Viewer->isAllowed('comment')); try { if (false !== ($maxImgSize = PermissionHelper::getMaxFileSize($this->Registry, $this->Registry->Viewer))) { $this->addMetaTag('imgupload', $maxImgSize); } } catch (\Lampcms\AccessException $e) { // do nothing. This means image upload not allowed for this user or for this site } return $this; }
/** * Add extra meta tags to indicate * that user has or does not have * blogger and tumblr Oauth keys * * @return object $this */ protected function addMetas() { $this->addMetaTag('tm', null !== $this->Registry->Viewer->getTumblrToken()); $this->addMetaTag('blgr', null !== $this->Registry->Viewer->getBloggerToken()); $this->addMetaTag('linkedin', null !== $this->Registry->Viewer->getLinkedInToken()); try { if (false !== ($maxImgSize = PermissionHelper::getMaxFileSize($this->Registry, $this->Registry->Viewer))) { $this->addMetaTag('imgupload', $maxImgSize); } } catch (\Lampcms\AccessException $e) { // do nothing. This means image upload not allowed for this user or for this site } return $this; }
/** * Check to make sure Viewer has permission * to upload images * Permission is based on user group and reputation * * @return ImageUploadParser * @throws \Lampcms\AccessException */ protected function checkPermission() { if (false === PermissionHelper::getMaxFileSize($this->Registry, $this->User)) { throw new AccessException('@@Image upload not allowed@@'); } return $this; }