summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-12 19:42:18 -0800
committerZach Copley <zach@status.net>2010-01-24 16:36:01 -0800
commitae46bc5fff21120ef867fb8ab59833a8f26adf47 (patch)
tree32e3a2cbccb6343b9dc6c141b7867c6e82c38cfb /classes
parentefd84cadc03f005fd04c76ac35fb8d40f3680644 (diff)
Started work on interface for displaying connected OAuth apps
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 25d908dbf..687215b11 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -352,6 +352,29 @@ class Profile extends Memcached_DataObject
return $profile;
}
+ function getApplications($offset = 0, $limit = null)
+ {
+ $qry =
+ 'SELECT oauth_application_user.* ' .
+ 'FROM oauth_application_user ' .
+ 'WHERE profile_id = %d ' .
+ 'ORDER BY created DESC ';
+
+ if ($offset > 0) {
+ if (common_config('db','type') == 'pgsql') {
+ $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+ } else {
+ $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ }
+ }
+
+ $application = new Oauth_application();
+
+ $cnt = $application->query(sprintf($qry, $this->id));
+
+ return $application;
+ }
+
function subscriptionCount()
{
$c = common_memcache();