madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[ljcom] r11786: LJSUP-11929: don't displayed vk username...

Committer: sbelyaev
LJSUP-11929: don't displayed vk username in settings
U   trunk/htdocs/manage/settings/vkontakte.bml
Modified: trunk/htdocs/manage/settings/vkontakte.bml
===================================================================
--- trunk/htdocs/manage/settings/vkontakte.bml	2012-04-25 08:42:16 UTC (rev 11785)
+++ trunk/htdocs/manage/settings/vkontakte.bml	2012-04-25 09:15:12 UTC (rev 11786)
@@ -59,13 +59,20 @@
         my $vk_token = $params_returned->{'access_token'};
         my $vkuid = $params_returned->{'user_id'};
 
-        my $vk_userdata = LJ::Client::Vkontakte->call( 'getProfiles', {
+        my $vk_response = LJ::Client::Vkontakte->call( 'getProfiles', {
                 'uids' => $vkuid,
                 'Synthetic fields' => 'domain',
                 'access_token' => $vk_token,
             } );
 
-        $vk_userdata = (ref $vk_userdata eq 'ARRAY' ) ? $vk_userdata->[0] : $vk_userdata;
+        
+        my $vk_userdata = $vk_response;
+        if ($vk_response->{'response'}) {
+            $vk_userdata = $vk_response->{'response'};
+        }
+        
+        $vk_userdata = $vk_userdata->[0];
+
         my $name = $vk_userdata->{'first_name'} . ' '
                  . $vk_userdata->{'last_name'} ;
 

Tags: bml, ljcom, madeon, sbelyaev
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