diff --git a/mod/profile.php b/mod/profile.php
index 39d1b7c6a..5d1b04b33 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -135,10 +135,14 @@ function profile_content(&$a) {
$tpl = file_get_contents('view/jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
+ require_once('view/acl_selectors.php');
$tpl = file_get_contents("view/jot.tpl");
+
$o .= replace_macros($tpl,array(
'$baseurl' => $a->get_baseurl(),
+ '$lockstate' => 'unlock',
+ '$acl' => populate_acl(),
'$profile_uid' => $a->profile['profile_uid']
));
}
diff --git a/view/acl_selectors.php b/view/acl_selectors.php
new file mode 100644
index 000000000..7a69fdd5a
--- /dev/null
+++ b/view/acl_selectors.php
@@ -0,0 +1,70 @@
+\r\n";
+
+ $r = q("SELECT * FROM `group` WHERE `uid` = %d",
+ $_SESSION['uid']
+ );
+
+ if(count($r)) {
+ foreach($r as $rr) {
+ if((is_array($preselected)) && $in_array($rr['name'], $preselected))
+ $selected = " selected=\"selected\" ";
+ else
+ $selected = '';
+ $o .= "\r\n";
+ }
+
+ }
+ $o .= "\r\n";
+
+
+ return $o;
+}
+
+
+
+function contact_select($selname,$selclass,$preselected = false) {
+
+ $o = '';
+
+ $o .= "\r\n";
+
+ $r = q("SELECT `name` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 ",
+ $_SESSION['uid']
+ );
+
+ if(count($r)) {
+ foreach($r as $rr) {
+ if((is_array($preselected)) && $in_array($rr['name'], $preselected))
+ $selected = " selected=\"selected\" ";
+ else
+ $selected = '';
+ $o .= "\r\n";
+ }
+
+ }
+ $o .= "\r\n";
+
+
+ return $o;
+}
+
+
+function populate_acl() {
+
+ $o = '';
+
+ $o .= "Allow Groups: " . group_select('group_allow','group_allow');
+ $o .= "Allow Contacts: " . contact_select('contact_allow','contact_allow');
+ $o .= "
\r\n";
+ $o .= "Except Groups: " . group_select('group_deny','group_deny');
+ $o .= "Except Contacts: " . contact_select('contact_deny','contact_deny');
+ return $o;
+
+}
\ No newline at end of file
diff --git a/view/jot.tpl b/view/jot.tpl
index b6599feec..55ee5388c 100644
--- a/view/jot.tpl
+++ b/view/jot.tpl
@@ -12,7 +12,8 @@ What's on your mind?