]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix user count
authorZach Copley <zach@status.net>
Wed, 13 Jan 2010 17:52:25 +0000 (17:52 +0000)
committerZach Copley <zach@status.net>
Mon, 25 Jan 2010 00:36:05 +0000 (16:36 -0800)
actions/showapplication.php

index bd333713685c9b4e69d46d5198aae403a276c699..b21b994aa23af13f5f2db476f77d11652d8c3fd5 100644 (file)
@@ -194,10 +194,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
@@ -222,7 +225,7 @@ class ShowApplicationAction extends OwnerDesignAction
             'class' => 'form_reset_key',
             'method' => 'POST',
             'action' => common_local_url('showapplication',
-                array('id' => $this->application->id))));
+                                         array('id' => $this->application->id))));
 
         $this->elementStart('fieldset');
         $this->hidden('token', common_session_token());