]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile_photo.php
Renamed System::redirect() to $a->redirect()
[friendica.git] / mod / profile_photo.php
index 567a7f3a2512b3e05c79edb68a57546637a47f76..7006349a6413791537e09e2170c44922ae150820 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 use Friendica\App;
+use Friendica\BaseModule;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\System;
@@ -13,6 +14,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Photo;
 use Friendica\Model\Profile;
 use Friendica\Object\Image;
+use Friendica\Util\Security;
 
 function profile_photo_init(App $a)
 {
@@ -30,7 +32,7 @@ function profile_photo_post(App $a)
                return;
        }
 
-       check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
+       BaseModule::checkFormSecurityTokenRedirectOnError('/profile_photo', 'profile_photo');
 
        if (!empty($_POST['cropfinal']) && $_POST['cropfinal'] == 1) {
 
@@ -133,7 +135,7 @@ function profile_photo_post(App $a)
                        }
                }
 
-               goaway($url);
+               $a->redirect($url);
                return; // NOTREACHED
        }
 
@@ -166,7 +168,7 @@ function profile_photo_post(App $a)
        @unlink($src);
 
        $imagecrop = profile_photo_crop_ui_head($a, $ph);
-       goaway(System::baseUrl() . '/profile_photo/use/' . $imagecrop['hash']);
+       $a->redirect('profile_photo/use/' . $imagecrop['hash']);
 }
 
 function profile_photo_content(App $a)
@@ -186,7 +188,7 @@ function profile_photo_content(App $a)
        $imagecrop = [];
 
        if (isset($a->argv[1]) && $a->argv[1] == 'use' && $a->argc >= 3) {
-               // check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
+               // BaseModule::checkFormSecurityTokenRedirectOnError('/profile_photo', 'profile_photo');
 
                $resource_id = $a->argv[2];
                //die(":".local_user());
@@ -223,7 +225,7 @@ function profile_photo_content(App $a)
                                Worker::add(PRIORITY_LOW, "Directory", $url);
                        }
 
-                       goaway(System::baseUrl() . '/profile/' . $a->user['nickname']);
+                       $a->redirect('profile/' . $a->user['nickname']);
                        return; // NOTREACHED
                }
                $ph = new Image($r[0]['data'], $r[0]['type']);
@@ -246,7 +248,7 @@ function profile_photo_content(App $a)
                        '$title' => L10n::t('Upload Profile Photo'),
                        '$submit' => L10n::t('Upload'),
                        '$profiles' => $profiles,
-                       '$form_security_token' => get_form_security_token("profile_photo"),
+                       '$form_security_token' => BaseModule::getFormSecurityToken("profile_photo"),
                        '$select' => sprintf('%s %s', L10n::t('or'),
                                ($newuser) ? '<a href="' . System::baseUrl() . '">' . L10n::t('skip this step') . '</a>' : '<a href="' . System::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . L10n::t('select a photo from your photo albums') . '</a>')
                ]);
@@ -263,7 +265,7 @@ function profile_photo_content(App $a)
                        '$image_url' => System::baseUrl() . '/photo/' . $filename,
                        '$title'     => L10n::t('Crop Image'),
                        '$desc'      => L10n::t('Please adjust the image cropping for optimum viewing.'),
-                       '$form_security_token' => get_form_security_token("profile_photo"),
+                       '$form_security_token' => BaseModule::getFormSecurityToken("profile_photo"),
                        '$done'      => L10n::t('Done Editing')
                ]);
                return $o;
@@ -317,7 +319,6 @@ function profile_photo_crop_ui_head(App $a, Image $image)
        }
 
        $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), []);
-       $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), []);
 
        $imagecrop = [
                'hash'       => $hash,