]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' of git.gnu.io:gnu/gnu-social into nightly
authorabjectio <abjectio@kollektivet0x242.no>
Tue, 26 May 2015 20:25:49 +0000 (22:25 +0200)
committerabjectio <abjectio@kollektivet0x242.no>
Tue, 26 May 2015 20:25:49 +0000 (22:25 +0200)
classes/Conversation.php
classes/Local_group.php
htaccess.sample
lib/profileaction.php

index 343668cc49d95e6632488c77f87668ed690aaecf..537c214a4c21991b54a20fea942a5c6a0ff2c325 100644 (file)
@@ -108,7 +108,13 @@ class Conversation extends Managed_DataObject
 
     static public function getUrlFromNotice(Notice $notice, $anchor=true)
     {
-        $conv = self::getKV('id', $notice->conversation);
+        $conv = new Conversation();
+        $conv->id = $notice->conversation;
+        $conv->find(true);
+        if (!$conv instanceof Conversation) {
+            common_debug('Conversation does not exist for notice ID: '.$notice->id);
+            throw new NoResultException($conv);
+        }
         return $conv->getUrl($anchor ? $notice->id : null);
     }
 
index c0dcf02e4be3e86b7f5a14fe15cf1bd677575322..9e95102d8503753a034bc28ee9fd53da391436cd 100644 (file)
@@ -40,16 +40,19 @@ class Local_group extends Managed_DataObject
 
     public function getProfile()
     {
-        $group = $this->getGroup();
-        if (!$group instanceof User_group) {
-            return null;    // TODO: Throw exception when other code is ready
-        }
-        return $group->getProfile();
+        return $this->getGroup()->getProfile();
     }
 
     public function getGroup()
     {
-        return User_group::getKV('id', $this->group_id);
+        $group = new User_group();
+        $group->id = $this->group_id;
+        $group->find(true);
+        if (!$group instanceof User_group) {
+            common_log(LOG_ERR, 'User_group does not exist for Local_group: '.$this->group_id);
+            throw new NoResultException($group);
+        }
+        return $group;
     }
 
     function setNickname($nickname)
index f7513cc0c7dd54153a80600ea16eacd168c443c5..af6e19784d1aa3f720571594b92a2b5f216a0b3b 100644 (file)
 </IfModule>
 
 <FilesMatch "\.(ini)">
-  # For mod_access_compat in Apache <2.4
-  #Order allow,deny
-
-  # Use this instead for Apache >2.4 (mod_authz_host)
-  # Require all denied
+    <IfVersion < 2.3>
+        Order allow,deny
+        Deny from all
+    </IfVersion>
+    <IfVersion >= 2.3>
+        Require all denied
+    </IfVersion>
 </FilesMatch>
index 592364009781a73ecc3c5e83cd3e1fcfa7e3c1a6..bd5bb5a148d2290524d97e972e152f6dcc1b9672 100644 (file)
@@ -66,6 +66,10 @@ abstract class ProfileAction extends ManagedAction
             $this->user = User::getKV('nickname', $nickname);
 
             if (!$this->user) {
+                $group = Local_group::getKV('nickname', $nickname);
+                if ($group instanceof Local_group) {
+                    common_redirect($group->getProfile()->getUrl());
+                }
                 // TRANS: Client error displayed when calling a profile action without specifying a user.
                 $this->clientError(_('No such user.'), 404);
             }