slartyblartfast (slartyblartfast) wrote in changelog,
slartyblartfast
slartyblartfast
changelog

[ljcom] r7078: LJGI-18: Bml's for iGoogle gadgets

Committer: mchernyshev
LJGI-18: Bml's for iGoogle gadgets
- In login_ok.bml added "defaultuserpic" value as a node if userpic exists.

A   trunk/htdocs/gadgets/login_ok.bml
Added: trunk/htdocs/gadgets/login_ok.bml
===================================================================
--- trunk/htdocs/gadgets/login_ok.bml	                        (rev 0)
+++ trunk/htdocs/gadgets/login_ok.bml	2009-02-24 09:06:54 UTC (rev 7078)
@@ -0,0 +1,24 @@
+<?_code
+    use strict;
+    use XML::Simple;
+    use vars qw(%GET %POST);
+
+    BML::noparse();
+    BML::finish();
+
+    my $u = LJ::get_remote();
+    if ($u && LJ::isu($u)) {
+        my $params = { user => [ $u->user ] };
+        my $userpic = $u->userpic;
+        $params->{defaultuserpic} = [ $userpic->url ] if $userpic;
+
+        BML::set_content_type("text/xml; charset=utf-8");
+        return
+            XMLout( $params,
+                RootName => 'success', XMLDecl => '<?xml version="1.0" encoding="utf-8" ?>' );
+    } else {
+        BML::set_content_type("text/html; charset=utf-8");
+        return BML::redirect("$LJ::SITEROOT/gadgets/login_fail.bml?reason=not+logged+in");
+    }
+ 
+_code?>

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments