Example #1
0
 /**
  * Set attachment to moderated if the forum dictates it so
  *
  * @return	object
  */
 protected function &fetch_attachdm()
 {
     $attachdata =& parent::fetch_attachdm();
     $state = (!isset($this->foruminfo['moderateattach']) or (!$this->foruminfo['moderateattach'] or can_moderate($this->foruminfo['forumid'], 'canmoderateattachments'))) ? 'visible' : 'moderation';
     $attachdata->set('state', $state);
     return $attachdata;
 }
Example #2
0
	/**
	* Set contentid here as an info instead of in verify_permissions so that the editor doesn't load all of the contents existing attachments
	*
	* @return	object
	*/
	protected function &fetch_attachdm()
	{
		$attachdata =& parent::fetch_attachdm();
		$attachdata->set_info('contentid', $this->values['groupid']);

		$should_moderate = (
			$this->registry->options['groups_pictures_moderation']
				OR
			!($this->registry->userinfo['permissions']['socialgrouppermissions'] & $this->registry->bf_ugp_socialgrouppermissions['groupfollowforummoderation'])
		);

		$state = ($should_moderate AND !can_moderate(0, 'canmoderatepictures')) ? 'moderation' : 'visible';
		$attachdata->set('state', $state);

		return $attachdata;
	}
Example #3
0
	/**
	 * Verifies permissions to attach content to posts
	 *
	 * @param	object	vB_Upload
	 * @param	array		Information about uploaded attachment
	 *
	 * @return	integer
	 */
	protected function process_upload($upload, $attachment, $imageonly = false)
	{
		$attachmentid = parent::process_upload($upload, $attachment, $imageonly);

		if (!vB::$vbulletin->GPC['values']['f'])
		{
			vB::$vbulletin->input->clean_array_gpc('r', array(
				'values' => vB_Input::TYPE_ARRAY
			));

		}

		if ($attachmentid AND vB::$vbulletin->GPC_exists['values'] AND isset(vB::$vbulletin->GPC['values']['f']))
		{
			$this->contentid = vB::$vbulletin->GPC['values']['f'];
			vB::$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "attachment SET contentid = " . $this->contentid	. " WHERE attachmentid = $attachmentid" );
		}
		return $attachmentid;
	}
Example #4
0
	/**
	* Verifies permissions to attach content to posts
	*
	* @param	object	vB_Upload
	* @param	array		Information about uploaded attachment
	*
	* @return	integer
	*/
	protected function process_upload($upload, $attachment, $imageonly = false)
	{
		if (
			($attachmentid = parent::process_upload($upload, $attachment, $imageonly))
				AND
			$this->registry->userinfo['userid'] != $this->bloginfo['userid']
				AND
			can_moderate_blog('caneditcomments')
		)
		{
			$this->bloginfo['attachmentid'] = $attachmentid;
			require_once(DIR . '/includes/blog_functions_log_error.php');
			log_moderator_action($this->bloginfo, 'attachment_uploaded');
		}

		return $attachmentid;
	}