summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Cohen2011-03-10 22:53:07 (GMT)
committer Dave Cohen2011-03-10 22:53:07 (GMT)
commit6dd77828570649a1116c5969b400f51e4be31719 (patch)
treed323b7645d2ec05677da86354368a76cdff74986
parentaa4672485a6c8add6ef4d44ee093988ae7102f25 (diff)
use data[header] when data[summary] does not exist
-rw-r--r--contrib/fb_permission.module5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/fb_permission.module b/contrib/fb_permission.module
index e84bd5d..db03d95 100644
--- a/contrib/fb_permission.module
+++ b/contrib/fb_permission.module
@@ -29,9 +29,8 @@ function fb_permission_map($fb) {
$result = fb_fql_query($fb, "SELECT permission_name, header, summary FROM permissions_info WHERE 1"); // FQL, no {curly_brackets}
if (!isset($perms)) {
-
foreach ($result as $data) {
- $perms[$data['permission_name']] = 'Allow %application to ' . $data['summary'];
+ $perms[$data['permission_name']] = 'Allow %application to ' . strtolower($data['summary'] ? $data['summary'] : 'access ' . $data['header']);
}
}
return $perms;
@@ -82,6 +81,7 @@ function fb_permission_user($op, &$edit, &$account, $category = NULL) {
if ($fb_app) {
$fb = fb_api_init($fb_app);
$map = fb_permission_map($fb); // All known permissions.
+
// Show only permissions we've configured for this app.
$fb_app_data = fb_get_app_data($fb_app);
$fb_permission_data = $fb_app_data['fb_permission'];
@@ -110,6 +110,7 @@ function fb_permission_user($op, &$edit, &$account, $category = NULL) {
'ext_perm' => $key,
'uid' => fb_get_fbu($account->uid, $fb_app),
));
+
} catch (Exception $e) {
fb_log_exception($e, t('Call to users.hasAppPermission(%key) failed.', array('%key' => $key)));
}