Hi,
*attachment type*
the newly introduced extension based mime-ing does not work, an old code
fragment got back...:
https://svn.roundcube.net/trunk/roundcubemail/program/steps/mail/attachment…
instead of
'mimetype' => rc_mime_content_type($filepath,
$_FILES['_attachments']['type'][$i])
should be this
'mimetype' => rc_mime_content_type($filepath,
$_FILES['_attachments']['name'][$i], $_FILES['_attachments']['type'][$i])
*undocumented plugin hook*
http://trac.roundcube.net/wiki/Plugin_Hooks
$attachment = $RCMAIL->plugins->exec_hook('upload_attachment', $attachment);
Bye,
Balazs
_______________________________________________
List info: http://lists.roundcube.net/dev/
Is there a "proper" way for Roundcube plugins to be accessing/writing to
session data? I was assuming that $_SESSION would be okay, but it seems
that if you are putting data in $_SESSION before the authenticate hook
it will be killed by $RCMAIL->kill_session(); on line 76 of index.php.
Having debugged it through xdebug, it seems as if the session data is
being killed by rc.
Here is what I am seeing:
- library is called from plugin "startup" hook. This forces an unauth'd
session to redirect to url of login service to establish authentication
credentials
- once auth'd it redirects back to the Roundcube url with
$_SESSION['phpCAS'] set
- again plugin "startup" hook is called, but $_SESSION['phpCAS'] exists
so session is authenticated so startup hook sets $startup['action'] =
'login'
- index.php evaluates ($RCMAIL->action=='login' &&
$RCMAIL->task=='mail') to true and executes $RCMAIL->kill_session(); on
line 76 of index.php
- $_SESSION['phpCAS'] gets nuked
Is there a way of saving and restoring phpCAS so that when authenticate
hook is called it will exist in $_SESSION?
_______________________________________________
List info: http://lists.roundcube.net/dev/
This diff for rcube_ldap.php allows users to define an array
'search_base_dn' in an ldap config. This is for users that may have to
deal with poor LDAP data (like you would see from someone who can
install Windows Server 2008 so they think they're an IT admin expert).
I freely and openly admit that I am NOT an expert programmer (or expert
anything really). This patch "worked for me" for my specific
implementation. It shouldn't break anything for people with a single
search base defined in 'base_dn'.
Example:
.... // regular ldap configuration options
'search_base_dn' => array(
'OU=Administration,DC=company,DC=org',
'OU=Finance,DC=company,DC=org'),
.... // continue regular ldap options
Note that the diff results below are against the rcube_ldap.php in 0.3b.
TA
55,56d54
< if (! isset($this->prop['search_base_dn']))
< $this->prop['search_base_dn'] = $p['base_dn'];
259a258,260
> if ($this->sort_col && $this->prop['scope'] !== "base")
> @ldap_sort($this->conn, $this->ldap_result, $this->sort_col);
>
264,280c265
< $entries = array();
< $entries['count'] = 0;
< if (is_array($this->ldap_result)) {
< // merge multiple ldap results into a single array
< foreach ($this->ldap_result as $ldr) {
< $single_result_entries = ldap_get_entries($this->conn, $ldr);
< for ($srindex=0; $srindex < $single_result_entries['count'];
$srindex++) {
< $entries[] = $single_result_entries[$srindex];
< $entries['count']++;
< }
< }
< } else {
< $entries = ldap_get_entries($this->conn, $this->ldap_result);
< }
< uasort($entries, array($this, 'sort_entries'));
< // array_merge will reindex the array after it is sorted by uasort
< $entries = array_merge($entries);
---
> $entries = ldap_get_entries($this->conn, $this->ldap_result);
288,292d272
< // this is used by uasort to sort the merged ldap results
< function sort_entries($a, $b) {
< return (strcmp ($a[$this->sort_col][0],$b[$this->sort_col][0]));
< }
<
363,370c343
< if (is_array($this->ldap_result)) {
< // sum counts for all ldap results
< foreach ($this->ldap_result as $ldr) {
< $count += ldap_count_entries($this->conn, $ldr);
< }
< } else {
< $count = ldap_count_entries($this->conn, $this->ldap_result);
< }
---
> $count = ldap_count_entries($this->conn, $this->ldap_result);
380,387c353
< if (is_array($this->ldap_result)) {
< // sum counts for all ldap results
< foreach ($this->ldap_result as $ldr) {
< $count += ldap_count_entries($this->conn, $ldr);
< }
< } else {
< $count = ldap_count_entries($this->conn, $this->ldap_result);
< }
---
> $count = ldap_count_entries($this->conn, $this->ldap_result);
580d545
< if ($this->filter == $this->prop['filter']) return false;
583,591d547
< if (is_array($this->prop['search_base_dn'])) {
< $conns = array();
< $bdindex = 0;
< foreach ($this->prop['search_base_dn'] as $basednval) {
< $conns[$bdindex++]=$this->conn;
< }
< } else {
< $conns = $this->conn;
< }
593c549
< $this->ldap_result = $function($conns,
$this->prop['search_base_dn'], $this->filter,
array_values($this->fieldmap), 0, 0);
---
> $this->ldap_result = $function($this->conn,
$this->prop['base_dn'], $this->filter, array_values($this->fieldmap), 0, 0);
640a597
>
_______________________________________________
List info: http://lists.roundcube.net/dev/
Here is the id_ID translation update for message.inc, please check this out.
--- 8< --- detachments --- 8< ---
The following attachments have been detached and are available for viewing.
http://detached.gigo.com/rc/RK/tV9Ohsm1/messages.inc
Only click these links if you trust the sender, as well as this message.
--- 8< --- detachments --- 8< ---
_______________________________________________
List info: http://lists.roundcube.net/dev/
Hi,
walking through roundcube's code I've found some room for small improvements.
if you sum them all together you may get some nice performance improvement
(not very huge - but you can probably notice it)
what I'm talking of are mainly style questions... because there are functions
in php that do the same as another function, with the small difference that
function X is faster
for example print() is slower than echo()
also double-quotes (") are up to 25% slower than concatenating strings
with single quotes (') - which is a HUGE performance boost
I've found a site which lists some of those functions - check [1]
I quickly compared the list with roundcube's codebase
those are the main places where there is still room for improvement:
* use ' instead of " (where possible - for example 'this is a test' . "\n"
would still be faster than "this is a test\n" - but you cannot replace
'"\n" by '\n')
* multiple parameters for echo - but most people prefer concatenating
over this multiple argument feature (I have to admit: I also prefer
string concatenation)
* pre-increment instead of post-increment (should be quite easy to do this,
since you need post-increment only in very few cases)
* unset() should be used more often (bigger task)
* use require() instead of require_once() - this is probably a bigger task too
one small note about [1]: afaik switch/case is faster than if/else
that site says the opposite
some of those things can be put into roundcube's codebase quite easily
maybe you can create some "Junior Jobs" section in your wiki, so bored
devs may write patches (which of course should be reviewed by an
experienced dev)
however, feel free to discuss this
oh, and I know: this whole mail is not mean for today's development...
but more something for the future
Regards,
Martin
[1] http://progtuts.info/55/php-optimization-tips/
_______________________________________________
List info: http://lists.roundcube.net/dev/
Hi,
I always read about localization updates on your mailing list
I started asking myself how translators know that they have
to translate something which was recently added?
do they check the interface and see "oh, there's text which is
not translated yet"?
or do they compare their locale with en_US ?
anyway, wouldn't it be easier if some (maybe I :)) wrote
some small PHP script that could easily compare multiple
localized include-files with each other?
if you want something like this feel free to tell me
Regards,
Martin
_______________________________________________
List info: http://lists.roundcube.net/dev/
Thanks Thomas!
The hook has meanwhile changed to "render_mailboxlist".
It works great on the mailbox list within the task "mail". It does not work on the subscription table.
Regards,
Roland
_______________________________________________
List info: http://lists.roundcube.net/dev/
Hi,
I’ve attached the patch for the completed pt_BR localization.
Att.
- Denis
--- 8< --- detachments --- 8< ---
The following attachments have been detached and are available for viewing.
http://detached.gigo.com/rc/Bf/a6SuCK11/pt_BR.patch
Only click these links if you trust the sender, as well as this message.
--- 8< --- detachments --- 8< ---
_______________________________________________
List info: http://lists.roundcube.net/dev/