some more work to get acl data into populate_acl
This commit is contained in:
parent
bfebf9636b
commit
94b21245bc
6 changed files with 36 additions and 9 deletions
|
@ -283,12 +283,34 @@ function get_acl_permissions($user = null) {
|
|||
}
|
||||
|
||||
|
||||
function populate_acl($user = null,$celeb = false,$show_jotnets = true,$show_mail = false) {
|
||||
function populate_acl($user = null,$celeb = false,$show_jotnets = false) {
|
||||
|
||||
$perms = get_acl_permissions($user);
|
||||
|
||||
$jotnets = '';
|
||||
if($show_jotnets) {
|
||||
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
||||
|
||||
$mail_enabled = false;
|
||||
$pubmail_enabled = false;
|
||||
|
||||
if(! $mail_disabled) {
|
||||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
$mail_enabled = true;
|
||||
if(intval($r[0]['pubmail']))
|
||||
$pubmail_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($mail_enabled) {
|
||||
$selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
|
||||
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
|
||||
. t("Post to Email") . '</div>';
|
||||
}
|
||||
|
||||
call_hooks('jot_networks', $jotnets);
|
||||
}
|
||||
|
||||
|
@ -342,6 +364,7 @@ function populate_acl($user = null,$celeb = false,$show_jotnets = true,$show_mai
|
|||
'$allowgid' => json_encode($perms['allow_gid']),
|
||||
'$denycid' => json_encode($perms['deny_cid']),
|
||||
'$denygid' => json_encode($perms['deny_gid']),
|
||||
'$networks' => $show_jotnets,
|
||||
'$emailcc' => t('CC: email addresses'),
|
||||
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
||||
'$jotnets' => $jotnets,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue