aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/RedDAV/RedDirectory.php21
-rw-r--r--include/acl_selectors.php2
-rw-r--r--mod/connedit.php21
-rw-r--r--view/theme/redbasic/css/style.css9
-rwxr-xr-xview/tpl/acl_selector.tpl13
5 files changed, 55 insertions, 11 deletions
diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php
index 87bdf8f13..8d8af5bd3 100644
--- a/include/RedDAV/RedDirectory.php
+++ b/include/RedDAV/RedDirectory.php
@@ -363,6 +363,27 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
}
/**
+ * @brief delete directory
+ */
+
+ public function delete() {
+ logger('delete file ' . basename($this->red_path), LOGGER_DEBUG);
+
+ if ((! $this->auth->owner_id) || (! perm_is_allowed($this->auth->owner_id, $this->auth->observer, 'write_storage'))) {
+ throw new DAV\Exception\Forbidden('Permission denied.');
+ }
+
+ if ($this->auth->owner_id !== $this->auth->channel_id) {
+ if (($this->auth->observer !== $this->data['creator']) || intval($this->data['is_dir'])) {
+ throw new DAV\Exception\Forbidden('Permission denied.');
+ }
+ }
+
+ attach_delete($this->auth->owner_id, $this->folder_hash);
+ }
+
+
+ /**
* @brief Checks if a child exists.
*
* @param string $name
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index cb2266473..4d44ec12e 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -231,6 +231,7 @@ function populate_acl($defaults = null,$show_jotnets = true) {
$jotnets = '';
if($show_jotnets) {
+logger('jot_networks');
call_hooks('jot_networks', $jotnets);
}
@@ -243,6 +244,7 @@ function populate_acl($defaults = null,$show_jotnets = true) {
'$allowgid' => json_encode($allow_gid),
'$denycid' => json_encode($deny_cid),
'$denygid' => json_encode($deny_gid),
+ '$jnetModalTitle' => t('Other networks and post services'),
'$jotnets' => $jotnets,
'$aclModalTitle' => t('Permissions'),
'$aclModalDismiss' => t('Close')
diff --git a/mod/connedit.php b/mod/connedit.php
index 877c12dc7..ad311f9a4 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -177,16 +177,21 @@ function connedit_post(&$a) {
if(($_REQUEST['pending']) && intval($orig_record[0]['abook_pending'])) {
$new_friend = true;
- if(! $abook_my_perms) {
- $abook_my_perms = get_channel_default_perms(local_channel());
+ // @fixme it won't be common, but when you accept a new connection request
+ // the permissions will now be that of your permissions role and ignore
+ // any you may have set manually on the form. We'll probably see a bug if somebody
+ // tries to set the permissions *and* approve the connection in the same
+ // request. The workaround is to approve the connection, then go back and
+ // adjust permissions as desired.
- $role = get_pconfig(local_channel(),'system','permissions_role');
- if($role) {
- $x = get_role_perms($role);
- if($x['perms_accept'])
- $abook_my_perms = $x['perms_accept'];
- }
+ $abook_my_perms = get_channel_default_perms(local_channel());
+
+ $role = get_pconfig(local_channel(),'system','permissions_role');
+ if($role) {
+ $x = get_role_perms($role);
+ if($x['perms_accept'])
+ $abook_my_perms = $x['perms_accept'];
}
}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index e83610f51..17cc833ed 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1382,6 +1382,15 @@ a.rconnect:hover, a.rateme:hover, div.rateme:hover {
border-radius: $radiuspx;
}
+#jotnets-wrapper {
+ background-color: rgb(238, 238, 238);
+ font-size: 120%;
+ border-radius: 4px;
+ padding: 7px 10px;
+ cursor: pointer;
+ margin-bottom: 10px;
+}
+
.acl-list-item {
width: 48%; /* fallback if browser does not support calc() */
width: calc(50% - 10px);
diff --git a/view/tpl/acl_selector.tpl b/view/tpl/acl_selector.tpl
index c7e039cd5..63a2900f4 100755
--- a/view/tpl/acl_selector.tpl
+++ b/view/tpl/acl_selector.tpl
@@ -6,13 +6,20 @@
<h4 class="modal-title">{{$aclModalTitle}}</h4>
</div>
<div class="modal-body">
+ {{if $jotnets}}
+ <div class="jotnets-wrapper" role="tab" id="jotnets-wrapper">
+ <a data-toggle="collapse" href="#jotnets-collapse" aria-expanded="false" aria-controls="jotnets-collapse">{{$jnetModalTitle}} <span class="caret"></span></a>
+ </div>
+ <div id="jotnets-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="acl-select">
+ {{$jotnets}}
+ <div class="clear"></div>
+ </div>
+ {{/if}}
+
<div id="acl-wrapper">
<button id="acl-showall" class="btn btn-block btn-default"><i class="icon-globe"></i> {{$showall}}</button>
<input type="text" id="acl-search" placeholder="&#xf002;">
- {{if $jotnets}}
- {{$jotnets}}
- {{/if}}
<div id="acl-list">
<div id="acl-list-content"></div>