Exemple #1
0
    /**
     * Outputs frontpage HTML
     *
     * @return       Nothing
     */
    function uploadMedia()
	{
		global $Itemid, $smartyvs, $j15, $j16;
		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = &JComponentHelper::getParams( 'com_users' );

		// check for upload limit (temporary hack)
		//$db->SetQuery( 'SELECT count(*) FROM #__hwdvidsvideos WHERE user_id = '.$my->id );
  		//$videoCount = $db->loadResult();
		//echo $db->getErrorMsg();
		//if ($videoCount > 50) {
		//	global $mainframe;
		//	$mainframe->enqueueMessage("You have reached your maximum upload limit and can not upload any more videos.");
		//	$mainframe->redirect( JURI::root().'index.php?option=com_hwdvideoshare&task=frontpage&Itemid='.$Itemid );
		//}

		$sessid = session_id();
		if (empty($sessid)) {
			session_start();
		}

		$localUploadAccess = hwd_vs_access::checkAccess($c->gtree_upld, $c->gtree_upld_child, 4, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORUPLD, _HWDVIDS_ALERT_UPLD_NOT_AUTHORIZED, "exclamation.png", 0, "core.frontend.upload.local", 1);
		$thirdPartyUploadAccess = hwd_vs_access::checkAccess($c->gtree_ultp, $c->gtree_ultp_child, 4, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORUPLD, _HWDVIDS_ALERT_UPLD_NOT_AUTHORIZED, "exclamation.png", 0, "core.frontend.upload.tp", 1);

		if (!$localUploadAccess && !$thirdPartyUploadAccess)
		{
			if ($my->id == 0)
			{
				$smartyvs->assign("showconnectionbox", 1);
			}
			hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_UPLD_NOT_AUTHORIZED, "exclamation.png", 0);
			return;
		}

		$videotype = JRequest::getCmd( 'videotype' );

		if ($j15)
		{
			$db->SetQuery( 'SELECT count(*) FROM #__plugins WHERE published = 1 AND folder = "hwdvs-thirdparty"');
		}
		if ($j16)
		{
			$db->SetQuery( 'SELECT count(*) FROM #__extensions WHERE type = "plugin" AND folder = "hwdvs-thirdparty" AND enabled = 1');
		}

  		$thirdpartycount = $db->loadResult();
		echo $db->getErrorMsg();

		$checksecurity = "0";
		if ((empty($videotype)) && ($thirdpartycount > 0) && ($c->disablelocupld == 0) && $localUploadAccess) {
			$uploadpage = "0";
		} else if ((empty($videotype)) && (!$thirdPartyUploadAccess)) {
			$uploadpage = "1";
		} else if ( (empty($videotype)) && (!$thirdpartycount || $thirdpartycount == 0) && ($c->disablelocupld == 0) ) {
			$uploadpage = "1";
		} else if ( (empty($videotype)) && ($thirdpartycount > 0) && ($c->disablelocupld == 1)) {
			$uploadpage = "thirdparty";
		} else if ( (empty($videotype)) && (!$thirdpartycount || $thirdpartycount == 0) && ($c->disablelocupld == 1)) {
        	hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_NOUPLDMETH, "exclamation.png", 0);
			return;
		} else if ($videotype == "00") {
			$uploadpage = "1";
		} else if ($videotype == "local") {
			$uploadpage = "2";
			$checksecurity = "1";
		} else {
			$uploadpage = "thirdparty";
		}

		$title 				= Jrequest::getVar( 'title', _HWDVIDS_UNKNOWN );
		$description 		= Jrequest::getVar( 'description', _HWDVIDS_UNKNOWN );
		$category_id 		= JRequest::getInt( 'category_id', 0, 'post' );
		$tags 				= Jrequest::getVar( 'tags', _HWDVIDS_UNKNOWN );
		$public_private 	= JRequest::getWord( 'public_private' );
		$allow_comments 	= JRequest::getInt( 'allow_comments', 0 );
		$allow_embedding 	= JRequest::getInt( 'allow_embedding', 0 );
		$allow_ratings 		= JRequest::getInt( 'allow_ratings', 0 );
		$hwdvspassword 		= JRequest::getVar( 'hwdvspassword', "" );
		if (!empty($hwdvspassword))
		{
			$md5password = md5($hwdvspassword);
		}
		else
		{
			$md5password = null;
		}

		$security_code = JRequest::getCmd( 'security_code', '' );

		if ($c->disablecaptcha == "1") {
			$checksecurity = "0";
		}

		if ($checksecurity == "1") {
			if(($_SESSION['security_code'] == $security_code) && (!empty($_SESSION['security_code'])) ) {
					// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
					hwd_vs_html::uploadmedia($uploadpage, $videotype, $checksecurity, $title, $description, $category_id, $tags, $public_private, $allow_comments, $allow_embedding, $allow_ratings, $md5password);
					unset($_SESSION['security_code']);
			} else {
				// Insert your code for showing an error message here
        		hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_ERRSC, "exclamation.png", 0);
				return;
			}
		} else {
			hwd_vs_html::uploadMedia($uploadpage, $videotype, $checksecurity, $title, $description, $category_id, $tags, $public_private, $allow_comments, $allow_embedding, $allow_ratings, $md5password);
		}
	}
	/**
     * Generates the Download Video Button
     *
     * @param array  $row  the video sql data
     * @param int    $original  link to original video or converted flv video (0/1)
     * @return       $code
     */
	function generateDownloadVideoLink( $row )
	{
		global $hwdvsItemid, $smartyvs;
		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();
		$usersConfig = &JComponentHelper::getParams( 'com_users' );

		$code = null;
		if ($row->video_type == "local" || $row->video_type == "mp4"  || $row->video_type == "swf"  || $row->video_type == "seyret" || ($row->video_type == "remote" && substr($row->video_id, 0, 6) !== "embed|"))
		{
			if ($c->showdlor == "1")
			{
				$smartyvs->assign("showDownloadButton", 1);
				$smartyvs->assign("print_downloadOption", 1);

				if (!hwd_vs_access::checkAccess($c->gtree_dnld, $c->gtree_dnld_child, 4, 0, _HWDVIDS_TITLE_NOACCESS, "You need to login to download videos.", "You do not have permission to download videos.", "exclamation.png", 0, "core.frontend.download", 1))
				{
					return "You do not have permission to download videos";
				}

				// setup antileech system expiration
				$dlink_generic = hwd_vs_tools::generateAntileechExpiration($row->id, 'local', '');

				$code.= "<form name=\"downloadVideo\" action=\"$dlink_generic\" method=\"post\">
						 <select name=\"deliver\">
						 <option value=\"original\">Original Video</option>
						 <option value=\"flv\">Standard Definition (FLV)</option>";
				if ($c->uselibx264 == "1")
				{
				$code.= "<option value=\"h264\">High Definition (MP4)</option>";
				}
				if ($c->ipod320 == "on")
				{
				$code.= "<option value=\"ipod340\">iPod 320 (MP4)</option>";
				}
				if ($c->ipod640 == "on")
				{
				$code.= "<option value=\"ipod620\">iPod 640 (MP4)</option>";
				}
//				if ($c->ogg == "on")
//				{
//				$code.= "<option value=\"ogg\">Ogg Theora (OGG)</option>";
//				}
				$code.= "</select>
						 <input type=\"submit\" value=\"Download\" />
						 </form>";
			}
		}
		return $code;
	}
Exemple #3
0
    /**
     * Outputs frontpage HTML
     *
     * @return       Nothing
     */
    function editGroup()
	{
		global $mosConfig_live_site, $mainframe, $Itemid;
		$c = hwd_vs_Config::get_instance();
		$db = & JFactory::getDBO();
		$my = & JFactory::getUser();
		$acl= & JFactory::getACL();

		if (!hwd_vs_access::checkAccess($c->gtree_grup, $c->gtree_grup_child, 4, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORGRUP, _HWDVIDS_ALERT_GRUP_NOT_AUTHORIZED, "exclamation.png", 0, "core.frontend.group")) {return;}

		$groupid = JRequest::getInt( 'groupid', 0 );

		$row = new hwdvids_group($db);
		$row->load( $groupid );

		//check valid user
		if ($row->adminid != $my->id) {
			$mainframe->enqueueMessage(_HWDVIDS_ALERT_NOPERM);
			$mainframe->redirect( JURI::root() . 'index.php?option=com_hwdvideoshare&task=groups&Itemid='.$Itemid );
		}

		//Videos that are approved(converted) and published in this group
		$query = 'SELECT user.*, mem.memberid'
				. ' FROM #__hwdvidsgroup_membership AS `mem`'
				. ' LEFT JOIN #__hwdvidsgroups AS `group` ON mem.groupid = group.id'
				. ' LEFT JOIN #__users AS `user` ON user.id = mem.memberid'
				. ' WHERE mem.groupid = '.$row->id
				;
		$db->SetQuery($query);
		$grp_members = $db->loadObjectList();
		echo $db->getErrorMsg();

		hwd_vs_html::editGroupInfo($row, $grp_members);
  	}
$limitstart  = JRequest::getInt( 'limitstart', 0 );
$task        = JRequest::getCmd( 'task', 'frontpage' );

hwdvsInitialise::getJVersion();
if ($task !== "deliverThumb")
{
	hwdvsInitialise::isModerator();
	hwdvsInitialise::itemid();
	hwdvsInitialise::mobiles();
	hwdvsInitialise::background();
	hwdvsInitialise::language();
	if (!hwdvsInitialise::template()) {return;}
	hwdvsInitialise::revenueManager();
	hwdvsInitialise::mysqlQuery();
	hwdvsInitialise::definitions();
	if (!hwd_vs_access::checkAccess($c->gtree_core, $c->gtree_core_child, 1, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORACCESS, _HWDVIDS_ALERT_NOT_AUTHORIZED, 'exclamation.png', 0)) {return;}
	if ($c->loadmootools == "on")
	{
		JHTML::_('behavior.mootools');
	}
}

// Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');

// Create the controller
$controller = new UserController();

// Perform the Request task
$controller->execute($task);