Permalink
Browse files

facebook stuff

  • Loading branch information...
simhacker@gmail.com
simhacker@gmail.com committed Mar 6, 2011
1 parent e60415c commit 149f2e8cb21dbe5b85c3a75382bcb7f7d28173e0
@@ -497,7 +497,7 @@ def createEngine(self):
user = GetCurrentUser()
print "Session creatEngine got user", user
print "Session createEngine got user", user
if user:
@@ -1530,7 +1530,7 @@ def handleMessage_cancelScreenCapture(self, session, messageDict, user):
def saveUserCity(self):
user = GetCurrentUser()
print "MicropolisTurboGearsEngine saveUserCity user", user.current_city_id, user
#print "MicropolisTurboGearsEngine saveUserCity user", user
if user:
@@ -215,7 +215,7 @@
width,
rows));
// Swizzle the bytes from Flash's RGBA order to Cairo's RGBA order.
// Swizzle the bytes from Flash's RGBA order to Cairo's ABGR order.
var n = chunk.length;
var i;
for (i = 0; i < n; i += 4) {
@@ -1545,6 +1545,47 @@ def facebookCanvas(
}
########################################################################
# facebookDeauthorize
#
# Facebook page admin interface.
#
@expose()
def facebookDeauthorize(
self,
signed_request='',
*args,
**kw):
print "\nFACEBOOKDEAUTHROIZE", request.method, "ARGS", args, "KW", kw
if not signed_request:
print "FACEBOOKDEAUTHROIZE ERROR: missing signed_request"
return ""
data = ParseSignedRequest(signed_request)
if not data:
print "FACEBOOKDEAUTHROIZE ERROR: invalid signed_request", signed_request
return ""
print data
user_id = data.get(u'user_id', '')
if not user_id:
print "FACEBOOKDEAUTHROIZE ERROR: missing user_id in signed request data", data
return ""
user = User.query.filter_by(facebook_user_id=user_id).first()
if not user:
print "FACEBOOKDEAUTHROIZE ERROR: unknown user_id", user_id
return ""
# TODO: Remember that the user is de-authorized.
print "FACEBOOKDEAUTHROIZE deauthorized user_id", user_id, "user", user
return ""
########################################################################
# facebookPageAdmin
#
@@ -53,8 +53,7 @@
<th class="adminHeader"><nobr>email</nobr></th>
<th class="adminHeader"><nobr>third party id</nobr></th>
<th class="adminHeader"><nobr>nick name</nobr></th>
<th class="adminHeader"><nobr>credits</nobr></th>
<th class="adminHeader"><nobr>donation</nobr></th>
<th class="adminHeader"><nobr>credits paid</nobr></th>
<th class="adminHeader"><nobr>karma</nobr></th>
<th class="adminHeader"><nobr>groups</nobr></th>
<th class="adminHeader"><nobr>created</nobr></th>
@@ -86,7 +85,7 @@
<nobr>
<a
href="/server/adminCity?user_id=${user.user_id}"
>${len(user.cities)} / ${user.city_slots}</a>
>${len(user.cities)} / ${user.save_slots}</a>
</nobr>
</td>
<td class="adminData">
@@ -119,10 +118,7 @@
<nobr>${user.nick_name}</nobr>
</td>
<td class="adminData">
<nobr>${user.credits}</nobr>
</td>
<td class="adminData">
<nobr>${user.donation}</nobr>
<nobr>${user.credits_paid}</nobr>
</td>
<td class="adminData">
<nobr>${user.karma}</nobr>
@@ -56,11 +56,22 @@
/>
<br class="clearBreak"/>
<py:if
test="not user_id"
>
Please
<a
href="javascript:addApp('${quote_js(facebook_permissions)}')"
>add Micropolis</a>
to save your city and play with your friends.
</py:if>
Please
<a
href="javascript:hello()"
>tell your friends</a>,
and buy
<!--!
<a
href="javascript:orderProduct('micropoleans_1000')"
>one thousand</a>
@@ -75,6 +86,7 @@
<a
href="javascript:orderProduct('protection')"
>city protection</a>,
-->
<a
href="javascript:orderProduct('karma_1000')"
>1000</a>,
@@ -95,16 +107,6 @@
>open source project</a>.
<br/>
<py:if
test="not user_id"
>
Please
<a
href="javascript:addApp('${quote_js(facebook_permissions)}')"
>add Micropolis</a>
to save your city and play with your friends.
</py:if>
</td>
</tr>

0 comments on commit 149f2e8

Please sign in to comment.