aboutsummaryrefslogtreecommitdiffstats
path: root/mod/connedit.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-17 17:59:46 -0700
committerfriendica <info@friendica.com>2014-09-17 17:59:46 -0700
commit401409357238183702c1628a02ccef6cf0394d72 (patch)
tree3e44b80aaca8fb79c7571aba7bb66f31386eb4ca /mod/connedit.php
parentcd790447782c0a7deba56209afc2e6352e004743 (diff)
downloadvolse-hubzilla-401409357238183702c1628a02ccef6cf0394d72.tar.gz
volse-hubzilla-401409357238183702c1628a02ccef6cf0394d72.tar.bz2
volse-hubzilla-401409357238183702c1628a02ccef6cf0394d72.zip
implement permission roles - the backend should be done except for maybe a couple of small tweaks. Now we just need to define the rest of the roles and create a chooser for them. Adam started on this some time back but I don't know where that has gone.
Diffstat (limited to 'mod/connedit.php')
-rw-r--r--mod/connedit.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/connedit.php b/mod/connedit.php
index b2de42343..7ad719738 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -255,6 +255,28 @@ function connedit_content(&$a) {
return login();
}
+ $my_perms = 0;
+ $role = get_pconfig(local_user(),'system','permissions_role');
+ if($role) {
+ $x = get_role_perms($role);
+ if($x['perms_accept'])
+ $my_perms = $x['perms_accept'];
+ }
+ if($my_perms) {
+ $o .= "<script>function connectDefaultShare() {
+ \$('.abook-edit-me').each(function() {
+ if(! $(this).is(':disabled'))
+ $(this).removeAttr('checked');
+ });\n\n";
+ $perms = get_perms();
+ foreach($perms as $p => $v) {
+ if($my_perms & $v[1]) {
+ $o .= "\$('#me_id_perms_" . $p . "').attr('checked','checked'); \n";
+ }
+ }
+ $o .= "abook_perms_msg(); }\n</script>\n";
+ }
+
if(argc() == 3) {
$contact_id = intval(argv(1));