]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showapplication.php
add lat, lon, location and remove closing tag from geocode.php
[quix0rs-gnu-social.git] / actions / showapplication.php
index f2ff8b90029b5f108171566451cb9b7dff770994..a6ff425c7c5f285c3becb776c012db2d1d2701df 100644 (file)
@@ -92,6 +92,7 @@ class ShowApplicationAction extends OwnerDesignAction
 
         if ($cur->id != $this->owner->id) {
             $this->clientError(_('You are not the owner of this application.'), 401);
+            return false;
         }
 
         return true;
@@ -194,10 +195,13 @@ class ShowApplicationAction extends OwnerDesignAction
         $defaultAccess = ($this->application->access_type & Oauth_application::$writeAccess)
             ? 'read-write' : 'read-only';
         $profile = Profile::staticGet($this->application->owner);
-        $userCnt = 0; // XXX: count how many users use the app
+
+        $appUsers = new Oauth_application_user();
+        $appUsers->application_id = $this->application->id;
+        $userCnt = $appUsers->count();
 
         $this->raw(sprintf(
-            _('Created by %1$s - %2$s access by default - %3$d users.'),
+            _('created by %1$s - %2$s access by default - %3$d users'),
               $profile->getBestName(),
               $defaultAccess,
               $userCnt
@@ -211,15 +215,9 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->elementStart('ul');
         $this->elementStart('li', 'entity_edit');
         $this->element('a',
-            array('href' =>
-                common_local_url(
-                    'editapplication',
-                    array(
-                        'nickname' => $this->owner->nickname,
-                        'id' => $this->application->id
-                    )
-                )
-            ), 'Edit');
+                       array('href' => common_local_url('editapplication',
+                                                        array('id' => $this->application->id))),
+                       'Edit');
         $this->elementEnd('li');
 
         $this->elementStart('li', 'entity_reset_keysecret');
@@ -228,8 +226,7 @@ class ShowApplicationAction extends OwnerDesignAction
             'class' => 'form_reset_key',
             'method' => 'POST',
             'action' => common_local_url('showapplication',
-                array('nickname' => $cur->nickname,
-                      'id' => $this->application->id))));
+                                         array('id' => $this->application->id))));
 
         $this->elementStart('fieldset');
         $this->hidden('token', common_session_token());
@@ -268,18 +265,14 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->elementEnd('dl');
 
         $this->element('p', 'note',
-            _('Note: We support hmac-sha1 signatures. We do not support the plaintext signature method.'));
+            _('Note: We support HMAC-SHA1 signatures. We do not support the plaintext signature method.'));
         $this->elementEnd('div');
 
         $this->elementStart('p', array('id' => 'application_action'));
         $this->element('a',
-            array(
-                'href' => common_local_url(
-                    'apps',
-                    array('nickname' => $this->owner->nickname)),
-                'class' => 'more'
-            ),
-            'View your applications');
+            array('href' => common_local_url('oauthappssettings'),
+                  'class' => 'more'),
+                  'View your applications');
         $this->elementEnd('p');
     }
 
@@ -332,4 +325,3 @@ class ShowApplicationAction extends OwnerDesignAction
     }
 
 }
-