Anyone have experience in plugin coding for Roundcube?
I am in the process of creating a light weight plugin for adding a stay-logged-in checkbox on the login page. It doesn't use/add any DB columns or create extra cookies. It only modifies the existing two cookies that roundcube already sets by extending their expiration from session-only to several days.
The part i could use help with, is the template for adding the html checkbox is in javascript. I am not seeing how to get a value from config.inc.php into javascript. As of now i have to set the same value in both the php and javascript files. Or if there is a way to inject the HTML from the PHP instead of needing to use JS i would prefer that.
PHP: function loginTemplate($args) { $this->add_texts('localization', true); $this->include_script('stay_loggedin.js'); return $args; }
JAVASCRIPT: $(document).ready(function () { if (window.rcmail && window.rcmail.env.skin == 'elastic') { rcmail.addEventListener('init', function () { ... ... let days = ???_config.inc.php_VALUE_???; ... ... }); } });
Am 08.08.22 um 03:19 schrieb list@ptld.com:
Anyone have experience in plugin coding for Roundcube?
I am in the process of creating a light weight plugin for adding a stay-logged-in checkbox on the login page. It doesn't use/add any DB columns or create extra cookies. It only modifies the existing two cookies that roundcube already sets by extending their expiration from session-only to several days.
The part i could use help with, is the template for adding the html checkbox is in javascript. I am not seeing how to get a value from config.inc.php into javascript. As of now i have to set the same value in both the php and javascript files.
bnreaking news: you can echo <script>-tags and javascript from PHP
On 08-08-2022 12:53 am, Reindl Harald wrote: bnreaking news: you can echo <script>-tags and javascript from PHP
Yes, yes you can. Pretty common knowledge even a script kiddie would know.
However roundcube functions this way:
$this->include_script('stay_loggedin.js');
and wont accept PHP tags in the *.js file. You also can't echo the javascript from the calling PHP file because then the <script> is placed at the top of the document (out of order) when it needs to be after the HTML elements the script is modifying. Again, basic HTML/Javascript stuff even a script kiddie would know.
Am 08.08.22 um 17:29 schrieb list@ptld.com:
On 08-08-2022 12:53 am, Reindl Harald wrote: bnreaking news: you can echo <script>-tags and javascript from PHP
Yes, yes you can. Pretty common knowledge even a script kiddie would know.
However roundcube functions this way:
$this->include_script('stay_loggedin.js');
and wont accept PHP tags in the *.js file. You also can't echo the javascript from the calling PHP file because then the <script> is placed at the top of the document (out of order) when it needs to be after the HTML elements the script is modifying. Again, basic HTML/Javascript stuff even a script kiddie would know
at least now the problem is described properly
На всякий случай напоминаю, что для доступа к внутренним серверам фирмы (в т.ч. "Воронке" надо или работать из офиса (или салона) фирмы, или подключаться по VPN, как и при работе с termserv2.
С уважением, Владимир Горпенко
list@ptld.com писал 2022-08-08 18:29:
On 08-08-2022 12:53 am, Reindl Harald wrote: bnreaking news: you can echo <script>-tags and javascript from PHP
Yes, yes you can. Pretty common knowledge even a script kiddie would know.
However roundcube functions this way:
$this->include_script('stay_loggedin.js');
and wont accept PHP tags in the *.js file. You also can't echo the javascript from the calling PHP file because then the <script> is placed at the top of the document (out of order) when it needs to be after the HTML elements the script is modifying. Again, basic HTML/Javascript stuff even a script kiddie would know. _______________________________________________ Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev