http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60794
Revision: 60794 Author: demon Date: 2010-01-07 17:25:50 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59183#c4712, these were proof of concept and can go away. Resolves fixmes on r59162, r59183, r59184 Removed Paths: ------------- trunk/extensions/ContributionReporting/cc-reporting.js trunk/extensions/ContributionReporting/cc-reporting.php Deleted: trunk/extensions/ContributionReporting/cc-reporting.js =================================================================== --- trunk/extensions/ContributionReporting/cc-reporting.js 2010-01-07 13:57:22 UTC (rev 60793) +++ trunk/extensions/ContributionReporting/cc-reporting.js 2010-01-07 17:25:50 UTC (rev 60794) @@ -1,25 +0,0 @@ - -runOnloadHook = function(){ - sendReq("cc-reporting.php?load=1&utm_src=" + document.payment.utm_source.value); -} - -//replace "validate_form" call with this -submitForm = function(){ - sendReq("cc-reporting.php?submit=1&utm_src="+ document.payment.utm_source.value); - return validate_form(document.payment); -} - -sendReq = function(sendRequest){ - if (window.XMLHttpRequest) - { - xhttp=new XMLHttpRequest(); - } - else // Internet Explorer 5/6 - { - xhttp=new ActiveXObject("Microsoft.XMLHTTP"); - } - xhttp.open("GET",sendRequest ,false); - xhttp.send(""); - dummyVar=xhttp.responseXML; -} - Deleted: trunk/extensions/ContributionReporting/cc-reporting.php =================================================================== --- trunk/extensions/ContributionReporting/cc-reporting.php 2010-01-07 13:57:22 UTC (rev 60793) +++ trunk/extensions/ContributionReporting/cc-reporting.php 2010-01-07 17:25:50 UTC (rev 60794) @@ -1,48 +0,0 @@ -<?php - -//handle request -if(isset ($_REQUEST['load'])){ - handleLoad(); -} -else if(isset ($_REQUEST['submit'])){ - handleSubmit(); -} - -//handle load -function handleLoad(){ - $cc_id = randomCookie(); - - //already have a cookie? use it, else set randomly generated one - if(isset($_COOKIE['cc-cookie'])){ - $cc_id = $_COOKIE['cc-cookie']; - } - else{ - //set cookie to expire in maybe about a year or so... 300 days - setcookie('cc-cookie', $cc_id, time() + (60 * 60 * 24 * 300), '/', "payments.wikimedia.org"); - } - - //add into DB - $cc_id = addslashes($cc_id); - $utm_src = isset($_REQUEST['utm_src']) ? - addslashes($_REQUEST['utm_src']) : "unknown"; - $sql = "INSERT IGNORE INTO cc-track (cookie_id, utm_src, contribs) VALUES ('$cc_id','$utm_src', 0)"; -} - -//handle submit -function handleSubmit(){ - - //for people with cookies turned off, track them via "NULL" cookie - $cc_id = "NULL"; - if(isset($_COOKIE['cc-cookie'])){ - $cc_id = $_COOKIE['cc-cookie']; - } - - //update in DB - $cc_id = addslashes($cc_id); - $sql = "UPDATE cc-track SET contribs=contribs+1 WHERE cookie_id = '$cc_id'"; -} - -//random cookie -function randomCookie(){ - return md5(mt_rand() + time()); -} \ No newline at end of file _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs