hi,
i think it would be better to overwrite the pagesize in the user config load process.
while grepping throu the code i came accross $USER->get_prefs() which returns the user preferences array.
it is called two times in main.inc:
@101: rcmail_startup(): $CONFIG = array_merge($CONFIG, (array)$USER->get_prefs());
and
@617: rcmail_login() $CONFIG = array_merge($CONFIG, (array)$USER->get_prefs());
so i would patch the $USER->get_prefs() method to check for limitations such as page_size.
but my additional thought is: why the heck is this code redundant? :) shouldn't one create a method in main.inc (or somewhere else) which takes care of merging, checking and enforcing config/preferences values?
cheers, raoul
Ondrej Zlosky wrote:
Hi,
I have just a small patch which seems reasonable to me. In 0.1stable release is an option to limit max_pagesize but it seems it is working only for new settings and users cannot save new value bigger than that. But when user already has bigger value in database (from older releases) then value max_pagesize from config file is not used.
So this is my solution.
--- ../webmail_01_stable/program/include/main.inc 2008-02-27 14:39:22.000000000 +0100 +++ program/include/main.inc 2008-03-07 11:28:10.000000000 +0100 @@ -278,7 +278,11 @@
// set pagesize from config if (isset($CONFIG['pagesize']))
- $IMAP->set_pagesize($CONFIG['pagesize']);
- if ($CONFIG['pagesize'] > $CONFIG['max_pagesize']) {
$IMAP->set_pagesize($CONFIG['max_pagesize']);
- } else {
$IMAP->set_pagesize($CONFIG['pagesize']);
- } }
Regards
-- Ondrej Zlosky ondrej.zlosky@gmail.com mailto:ondrej.zlosky@gmail.com
List info: http://lists.roundcube.net/dev/