[Mapbender-commits] r5462 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Jan 30 03:25:06 EST 2010


Author: christoph
Date: 2010-01-30 03:25:03 -0500 (Sat, 30 Jan 2010)
New Revision: 5462

Modified:
   trunk/mapbender/http/plugins/mb_twitter.php
   trunk/mapbender/http/plugins/mb_twitter_signin.js
   trunk/mapbender/http/plugins/mb_twitter_update.js
Log:


Modified: trunk/mapbender/http/plugins/mb_twitter.php
===================================================================
--- trunk/mapbender/http/plugins/mb_twitter.php	2010-01-29 15:30:22 UTC (rev 5461)
+++ trunk/mapbender/http/plugins/mb_twitter.php	2010-01-30 08:25:03 UTC (rev 5462)
@@ -19,8 +19,9 @@
 
 switch ($ajaxResponse->getMethod()) {
 	case "isSignedIn" :
-		echo Mapbender::session()->get("oauth_token");die;
-		if (Mapbender::session()->get("oauth_token") !== false) {
+//		echo Mapbender::session()->get("oauth_token");die;
+		$token = $ajaxResponse->getParameter("token");
+		if (!is_null($token)) {
 			$ajaxResponse->setSuccess(true);
 			$ajaxResponse->setResult(array("signedIn" => true)); 
 			$ajaxResponse->setMessage(_mb("Signed in."));

Modified: trunk/mapbender/http/plugins/mb_twitter_signin.js
===================================================================
--- trunk/mapbender/http/plugins/mb_twitter_signin.js	2010-01-29 15:30:22 UTC (rev 5461)
+++ trunk/mapbender/http/plugins/mb_twitter_signin.js	2010-01-30 08:25:03 UTC (rev 5462)
@@ -48,6 +48,45 @@
 	signedIn: false
 });
 
+var getArray = [];
+var getString = document.location.search.substr(1,document.location.search.length);
+if (strGET === '') {
+	return [];
+}
+
+var gArr = strGET.split('&');
+for (i = 0; i < gArr.length; ++i) {
+	var v = '';
+	vArr = gArr[i].split('=');
+        if (vArr.length > 1) {
+		v = vArr[1];
+	}
+        getArray[unescape(vArr[0])] = unescape(v);
+}
+
+
+var getOauthToken = function () {
+	var getString = document.location.search.substr(1,document.location.search.length);
+	if (getString === '') {
+		return null;
+	}	
+
+	var gArr = getString.split('&');
+	for (i = 0; i < gArr.length; ++i) {
+		var v = '';
+		vArr = gArr[i].split('=');
+        	if (vArr.length > 1) {
+			v = vArr[1];
+		}
+		var key = unescape(vArr[0]);
+		if (key === "oauth_token") {
+			return unescape(v);
+		}
+	}
+	return null;
+}
+
+
 Mapbender.events.init.register(function () {
 
 	// check if signed in
@@ -55,6 +94,7 @@
 		url: "../plugins/mb_twitter.php",
 		method: "isSignedIn",
 		parameters: {
+			token: getOauthToken()
 		},
 		callback: function (obj, result, message) {
 			if (!result) {

Modified: trunk/mapbender/http/plugins/mb_twitter_update.js
===================================================================
--- trunk/mapbender/http/plugins/mb_twitter_update.js	2010-01-29 15:30:22 UTC (rev 5461)
+++ trunk/mapbender/http/plugins/mb_twitter_update.js	2010-01-30 08:25:03 UTC (rev 5462)
@@ -35,9 +35,6 @@
 						var avail = 140 - chars;
 						$charsLeft.text(avail);
 					});
-
-					
-					// open status input
 					return false;
 	 			});
 			});



More information about the Mapbender_commits mailing list