]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/userauthorization.php
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
[quix0rs-gnu-social.git] / actions / userauthorization.php
index 11c74eeb45e48fcee6babcc950c71418dcf661bf..ed17ceec977723ecd20899d380a645f183eeea20 100644 (file)
@@ -86,7 +86,7 @@ class UserauthorizationAction extends Action
         $this->element('p', null, _('Please check these details to make sure '.
                                     'that you want to subscribe to this user\'s notices. '.
                                     'If you didn\'t just ask to subscribe to someone\'s notices, '.
-                                    'click "Cancel".'));
+                                    'click "Reject".'));
     }
 
     function showContent()
@@ -330,7 +330,13 @@ class UserauthorizationAction extends Action
     {
         $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar');
         copy($url, $temp_filename);
-        return $profile->setOriginal($temp_filename);
+        $imagefile = new ImageFile($profile->id, $temp_filename);
+        $filename = Avatar::filename($profile->id,
+                                     image_type_to_extension($imagefile->type),
+                                     null,
+                                     common_timestamp());
+        rename($temp_filename, Avatar::path($filename));
+        return $profile->setOriginal($filename);
     }
 
     function showAcceptMessage($tok)
@@ -469,19 +475,19 @@ class UserauthorizationAction extends Action
         }
         # optional stuff
         $fullname = $req->get_parameter('omb_listenee_fullname');
-        if ($fullname && strlen($fullname) > 255) {
+        if ($fullname && mb_strlen($fullname) > 255) {
             throw new OAuthException("Full name '$fullname' too long.");
         }
         $homepage = $req->get_parameter('omb_listenee_homepage');
-        if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) {
+        if ($homepage && (!common_valid_http_url($homepage) || mb_strlen($homepage) > 255)) {
             throw new OAuthException("Invalid homepage '$homepage'");
         }
         $bio = $req->get_parameter('omb_listenee_bio');
-        if ($bio && strlen($bio) > 140) {
+        if ($bio && mb_strlen($bio) > 140) {
             throw new OAuthException("Bio too long '$bio'");
         }
         $location = $req->get_parameter('omb_listenee_location');
-        if ($location && strlen($location) > 255) {
+        if ($location && mb_strlen($location) > 255) {
             throw new OAuthException("Location too long '$location'");
         }
         $avatar = $req->get_parameter('omb_listenee_avatar');
@@ -577,10 +583,10 @@ class UserauthorizationAction extends Action
     {
         $signature_method = $this->getSignatureMethod($req);
         $signature = $req->get_parameter('oauth_signature');
-        $valid_sig = $signature_method->checkSignature($req,
-                                                       $consumer,
-                                                       $token,
-                                                       $signature);
+        $valid_sig = $signature_method->check_signature($req,
+                                                        $consumer,
+                                                        $token,
+                                                        $signature);
         if (!$valid_sig) {
             throw new OAuthException("Invalid signature");
         }