]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / mod / profile.php
index e7135515ff11fcb0405571f9079b7c6e06c69675..827166f92731135c093061981eec72176c43393b 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once('include/contact_widgets.php');
+require_once('include/redir.php');
 
 
 function profile_init(&$a) {
@@ -11,7 +12,7 @@ function profile_init(&$a) {
        if($a->argc > 1)
                $which = $a->argv[1];
        else {
-               $r = q("select nickname from user where blocked = 0 and account_expired = 0 and verified = 1 order by rand() limit 1");
+               $r = q("select nickname from user where blocked = 0 and account_expired = 0 and account_removed = 0 and verified = 1 order by rand() limit 1");
                if(count($r)) {
                        goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']);
                }
@@ -28,6 +29,9 @@ function profile_init(&$a) {
                $which = $a->user['nickname'];
                $profile = $a->argv[1];         
        }
+       else {
+               auto_redir($a, $which);
+       }
 
        profile_load($a,$which,$profile);