X-Git-Url: https://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=bin%2Fuserinfo;h=7499a90db1dbc2af445ec3aaf3b3ecb329573d64;hb=8ef30d247348e78ddac9117f58c0069dc947c941;hp=a0dbbdecb0e3c90376fd6f64c50dea48f3ebc50b;hpb=1d84bf53fde880886b6aee02111c1c8958f5a15b;p=oss%2Fvjournal.git diff --git a/bin/userinfo b/bin/userinfo index a0dbbde..7499a90 100644 --- a/bin/userinfo +++ b/bin/userinfo @@ -27,22 +27,25 @@ If user is not logged in, returns following structure: { state: "notlogged", providers: [ - {name: "Live journal",icon:"/avatars/lj.gif",format: "%s.livejournal.com"} + {name: "Live journal",icon:"/avatars/lj.gif",id: "lj"} ... } =cut use VJournal::Session; +use VJournal::ProviderList; use JSON; use CGI; my $cgi=new CGI; -my $session = VJourna::Session->new($cgi); +my $session = VJournal::Session->new($cgi); my $out={}; if (!defined $session) { # User is not authenticated. Return list of providers; $out->{state}="notlogged"; + $sites=VJournal::ProviderList->new; + $out->{providers}=[ $sites->menu ] ; $session=$cgi; } else { if ($session->isowner()) { @@ -62,6 +65,6 @@ if (!defined $session) { } } -$session->header(-content_type=>"text/json",-charset=>utf-8); -print $encode_json($out); +print $session->header(-content_type=>"text/json",-charset=>"utf-8"); +print encode_json($out);