I'm new to this list, but I've been using Roundcube for several years. Currently I'm working on a IMAP ACL plugin that integrates into the new folder manager. Or is someone else already working on it?
However, I'm somewhat lost with writing a nice looking UI, so for now it is very basic. But for me it works (tested with Dovecot 2.0.8 and Cyrus 2.3.16). For screenshots see http://i53.tinypic.com/2en6iis.png and http://i53.tinypic.com/2gt3fw7.png
Please drop me a note if it's ok to post the plugin to this list for testing and suggestions ;-)
Attached patch fixes some bugs in Roundcube's ACL handling and allows the plugin to parse the RIGHTS= capability.
Holger
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/Hx/XXfh3mVD/rcube_imap_generic.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On 02.01.2011 15:04, Holger Mauermann wrote:
I'm new to this list, but I've been using Roundcube for several years. Currently I'm working on a IMAP ACL plugin that integrates into the new folder manager. Or is someone else already working on it?
This is planned as core feature, so maybe would be better to write this as part of core code not as a plugin.
However, I'm somewhat lost with writing a nice looking UI, so for now it is very basic. But for me it works (tested with Dovecot 2.0.8 and Cyrus 2.3.16). For screenshots see http://i53.tinypic.com/2en6iis.png and http://i53.tinypic.com/2gt3fw7.png
Not bad, but Sharing section should be a Tab in folder info page. Also, defining rights for shared folder would be better with checkboxes.
Attached patch fixes some bugs in Roundcube's ACL handling and allows the plugin to parse the RIGHTS= capability.
Applied partially in r4384. $capability should stay private. I think, we should extend getCapability().
Am 03.01.2011 08:18, schrieb A.L.E.C:
Not bad, but Sharing section should be a Tab in folder info page.
Already tried that, but there seems to be a bug in Roundcube. When clicking on any tab in the folder manager the tab content disappears...
Also, defining rights for shared folder would be better with checkboxes.
We need eleven checkboxes... this would clutter the UI ;-)
I'll think about a select field with some predefined rights (read only, read+write, ...)
Applied partially in r4384. $capability should stay private. I think, we should extend getCapability().
Following patch allows to do a getCapability('RIGHTS='), which is the official capability name as of http://www.iana.org/assignments/imap4-capabilities.
--- program/include/rcube_imap_generic.php (revision 4384) +++ program/include/rcube_imap_generic.php (working copy) @@ -3224,6 +3224,7 @@ private function parseCapability($str, $trusted=false) { $str = preg_replace('/^* CAPABILITY /i', '', $str);
$str = preg_replace('/\bRIGHTS=[kxte]{4}\b/i', 'RIGHTS=', $str);
$this->capability = explode(' ', strtoupper($str));
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On 03.01.2011 16:39, Holger Mauermann wrote:
Am 03.01.2011 08:18, schrieb A.L.E.C:
Not bad, but Sharing section should be a Tab in folder info page.
Already tried that, but there seems to be a bug in Roundcube. When clicking on any tab in the folder manager the tab content disappears...
I'll take a look.
Also, defining rights for shared folder would be better with checkboxes.
We need eleven checkboxes... this would clutter the UI ;-)
I'll think about a select field with some predefined rights (read only, read+write, ...)
Not bad idea, but we'll need "custom rights" item on the list which will popup an extended rights selection window. However, we can create a table and use short column descriptions for rights to make the whole screen (table) narrower.
--- program/include/rcube_imap_generic.php (revision 4384) +++ program/include/rcube_imap_generic.php (working copy) @@ -3224,6 +3224,7 @@ private function parseCapability($str, $trusted=false) { $str = preg_replace('/^* CAPABILITY /i', '', $str);
$str = preg_replace('/\bRIGHTS=[kxte]{4}\b/i', 'RIGHTS=', $str);
I don't understand this.
Am 03.01.2011 17:10, schrieb A.L.E.C:
--- program/include/rcube_imap_generic.php (revision 4384) +++ program/include/rcube_imap_generic.php (working copy) @@ -3224,6 +3224,7 @@ private function parseCapability($str, $trusted=false) { $str = preg_replace('/^* CAPABILITY /i', '', $str);
$str = preg_replace('/\bRIGHTS=[kxte]{4}\b/i', 'RIGHTS=', $str);
I don't understand this.
If the IMAP server supports RFC 4314 it must include RIGHTS= followed by the letters k, x, t and e in its CAPABILITY response. However, they can appear in any order. Currently e.g. getCapability('RIGHTS=kxte') returns false if the server response was 'CAPABILITY .. RIGHTS=etxk ..' or so, because then $capability contains 'RIGHTS=etxk' too.
Above regex simply strips out k, x, t and e and puts only 'RIGHTS=' in $capability so it's possible to test for RFC 4314 support with getCapability('RIGHTS=').
Holger _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Mon, 03 Jan 2011 18:19:59 +0100, Holger Mauermann wrote:
Above regex simply strips out k, x, t and e and puts only 'RIGHTS=' in $capability so it's possible to test for RFC 4314 support with getCapability('RIGHTS=').
Right. However, I was hinking about something more useful:
--- rcube_imap_generic.php (wersja 4384) +++ rcube_imap_generic.php (kopia robocza) @@ -371,11 +371,44 @@ return false; }
if (empty($this->capability) || $name == '') {
return false;
}
if (in_array($name, $this->capability)) {
return true;
}
else if (strpos($name, '=')) {
return false;
}
$result = array();
foreach ($this->capability as $cap) {
$entry = explode('=', $cap);
if ($entry[0] == $name) {
$result[] = $entry[1];
}
}
return !empty($result) ? $result : false;
* Capabilities checker
*
* @param string $name Capability name
*
* @return mixed Capability values array for key=value pairs,
true/false for others
*/
$result = $this->hasCapability($name);
if (!empty($result)) {
return $result;
}
else if ($this->capability_readed) {
return false;
}
@@ -390,11 +423,7 @@
$this->capability_readed = true;
if (in_array($name, $this->capability)) {
return true;
}
return false;
return $this->hasCapability($name);
}
function clearCapability()
On Mon, 03 Jan 2011 17:10:54 +0100, A.L.E.C wrote:
Not bad, but Sharing section should be a Tab in folder info page.
Already tried that, but there seems to be a bug in Roundcube. When clicking on any tab in the folder manager the tab content disappears...
I'll take a look.
Fixed in r4385.
Am 03.01.2011 21:30, schrieb A.L.E.C:
Fixed in r4385.
Thanks!
Just stumbled over another small bug, here's a fix:
--- program/steps/settings/edit_folder.inc (revision 4386) +++ program/steps/settings/edit_folder.inc (working copy) @@ -248,7 +248,7 @@ $content = $table->show(); } else {
$content = $tag['content'];
$content = $form['content'];
}
return $content;
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Am 03.01.2011 20:33, schrieb A.L.E.C:
Right. However, I was hinking about something more useful:
Index: rcube_imap_generic.php
--- rcube_imap_generic.php (wersja 4384) +++ rcube_imap_generic.php (kopia robocza) @@ -371,11 +371,44 @@ return false; }
- function getCapability($name)
- private function hasCapability($name)
...
This works. Please commit to trunk :-)
Holger _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
Am 02.01.2011 15:04, schrieb Holger Mauermann:
Currently I'm working on a IMAP ACL plugin that integrates into the new folder manager.
I think it's ready for public testing now. Get the plugin from here http://www.mauermann.org/files/rc_imap_acl.tar.gz and remember that it needs at least Roundcube r4388 to work.
Feedback welcome. But don't blame me if bad things happen ;-)
Holger _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Wednesday 05 January 2011 12:36:01 Holger Mauermann wrote:
I think it's ready for public testing now. Get the plugin from here http://www.mauermann.org/files/rc_imap_acl.tar.gz and remember that it needs at least Roundcube r4388 to work.
Feedback welcome. But don't blame me if bad things happen ;-)
Beautiful plugin. Thank you. Working as expected with Dovecot 2.0.8. _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
Am 03.01.2011 08:18, schrieb A.L.E.C:
On 02.01.2011 15:04, Holger Mauermann wrote:
Currently I'm working on a IMAP ACL plugin that integrates into the new folder manager. Or is someone else already working on it?
This is planned as core feature, so maybe would be better to write this as part of core code not as a plugin.
I think that modifying ACLs should not go into core. Some administrators may prefer to not expose this functionality to users even if the server supports it.
Attached are some changes to the folder manager. It mainly prevents users from renaming or moving a folder in the 'Properties' tab if it's restricted by ACL.
Holger
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/TC/KaBx8QGK/roundcube.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Am 08.01.2011 15:33, schrieb Holger Mauermann:
This is planned as core feature, so maybe would be better to write this as part of core code not as a plugin.
I think that modifying ACLs should not go into core. Some administrators may prefer to not expose this functionality to users even if the server supports it.
Attached are some changes to the folder manager. It mainly prevents users from renaming or moving a folder in the 'Properties' tab if it's restricted by ACL.
Any comments from the roundcube developers?
Holger _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
On 11.01.2011 09:25, Holger Mauermann wrote:
Attached are some changes to the folder manager. It mainly prevents users from renaming or moving a folder in the 'Properties' tab if it's restricted by ACL.
Any comments from the roundcube developers?
I'll work on this after 0.5-stable release, which is planned in this week.