function oauth_common_permissions_form in OAuth 1.0 7.4
Same name and namespace in other branches
- 6.3 oauth_common.authorizations.inc \oauth_common_permissions_form()
- 7.3 oauth_common.authorizations.inc \oauth_common_permissions_form()
1 call to oauth_common_permissions_form()
- oauth_common_form_authorization in ./
oauth_common.authorizations.inc - Provide a form to edit and add authorizations.
File
- ./
oauth_common.authorizations.inc, line 183 - Functions related to a user's authorization section
Code
function oauth_common_permissions_form($account, &$form, $consumer, $context, $default_services = array(
'*',
)) {
$tvars = array(
'@appname' => $consumer->name,
'@user' => $account->name,
'@sitename' => variable_get('site_name', ''),
);
if ($context) {
foreach ($context->authorization_levels as $name => $level) {
$auth_opt = array(
'#type' => 'checkbox',
'#title' => t($level['title'], $tvars),
'#description' => t($level['description'], $tvars),
'#default_value' => in_array($name, $default_services),
);
$form['authorization']['levels'][$name] = $auth_opt;
}
}
}