Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 765 of 806  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
icon3.gif   Bug with Drafts and Language German, posted by Andreas Luedeke on Mon Aug 21 11:45:06 2017 elog_lang_pending_draft_bug.png

Hi Stefan,

when one creates a new entry, and a draft entry exists for the logbook, then a menu appears (see attachment).
If one select "Neuen Eintrag anlegen" then it should ignore the draft and create a new entry.
This feat is done by adding a "&ignore=1" to the "new" command: "<URL>/?cmd=New&ignore=1".
The problem is, that it should not be "cmd=New&..." but "cmd=Neu", since the commands are part of the translation.
Due to this, no new entry can be created as long as a draft exists; at least not in any language other than english.
This problem apparently existed since the beginning of drafts, but it only created problems at our site recently.
Kind Regards
Andreas

PS: Here's a patch that works:

diff  elogd.c elogd.c-orig
9575,9576c9575,9576
<    rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='?cmd=%s&ignore=1';\">\n", loc("Create new entry"),
<             loc("New"));
---
>    rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='%s';\">\n", loc("Create new entry"),
>             "?cmd=New&ignore=1");
    icon2.gif   Re: Bug with Drafts and Language German, posted by Andreas Luedeke on Mon Aug 21 12:16:05 2017 

I've quickly checked: there are a couple more commands in the source code that are not language encoded. I guess some of them needs correction.

> egrep -n "cmd=[A-Za-z]" elogd.c
10293:   rsprintf("    r.open('GET', '?jcmd=Unlock&edit_id=%d', true);\n", message_id);
11784:                      ("<label for=\"ELCode\"><a target=\"_blank\" href=\"?cmd=HelpELCode\">ELCode</a>&nbsp;&nbsp;</label>\n");
13663:                                "\r\n%s URL         : %s?cmd=Config&cfg_user=%s&unm=%s\r\n", loc("Logbook"),
14562:      redirect(lbs, "?cmd=Config");
14625:      sprintf(str, "../%s/?cmd=Config", getparam("lbname"));
14678:      sprintf(str, "../%s/?cmd=Config", lbn);
15703:   combine_url(lbs, host, "?cmd=GetMD5", url, sizeof(url), &ssl);
16378:         strcat(str, "?cmd=GetConfig"); // request complete config file
16380:         strcat(str, "?cmd=Download");  // request config section of logbook
16570:      strcat(str, "?cmd=GetPwdFile");   // request password file
17575:            rsprintf("<br><b><a href=\"../%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
17577:            rsprintf("<br><b><a href=\"%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
17579:            rsprintf("<br><b><a href=\"../%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
18959:   if (strstr(ref, "cmd=Search&"))
18960:      strlcpy(strstr(ref, "cmd=Search&"), strstr(ref, "cmd=Search&") + 11, sizeof(str));
26728:         rsprintf("<a href=\"?cmd=Synchronize\">%s</a></td>\n", loc("Synchronize all logbooks"));
 

Andreas Luedeke wrote:

Hi Stefan,

when one creates a new entry, and a draft entry exists for the logbook, then a menu appears (see attachment).
If one select "Neuen Eintrag anlegen" then it should ignore the draft and create a new entry.
This feat is done by adding a "&ignore=1" to the "new" command: "<URL>/?cmd=New&ignore=1".
The problem is, that it should not be "cmd=New&..." but "cmd=Neu", since the commands are part of the translation.
Due to this, no new entry can be created as long as a draft exists; at least not in any language other than english.
This problem apparently existed since the beginning of drafts, but it only created problems at our site recently.
Kind Regards
Andreas

PS: Here's a patch that works:

diff  elogd.c elogd.c-orig
9575,9576c9575,9576
<    rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='?cmd=%s&ignore=1';\">\n", loc("Create new entry"),
<             loc("New"));
---
>    rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='%s';\">\n", loc("Create new entry"),
>             "?cmd=New&ignore=1");

 

icon5.gif   CSS reference in Email for private logbooks, posted by Andreas Luedeke on Mon Aug 21 14:27:50 2017 
We operate ELOG in an intranet. Many logbooks do send out emails; several use HTML content formatting.
If I watch HTML formatted emails from the intranet, then everything is fine.
If I try to read them from home, my email client hangs when it tries to read the CSS file from out intranet (URL: https://elog-gfa.psi.ch/SLS/elog.css).
Is there a way to set a URL for the email CSS?
Then I could simply copy the CSS file to the internet accessible location and the emails would be properly formatted in the intranet and from home.
 
I've tried to use "Use Email URL = ", but it turned out that this will change all base URL's in the email BUT the one in the CSS :-(
So I would need a config "Email CSS URL = " to set this.
 
Here is a patch that does what I want, but it might have some side-effects I'm not yet aware of:
7636,7643c7636,7638
<    if (absolute_link) {
<       if (lbs != NULL && getcfg(lbs->name, "Email CSS URL", str, sizeof(str)))
<          strlcpy(css_base, str, sizeof(css_base));
<       else if (lbs == NULL && getcfg("global", "Email CSS URL", str, sizeof(str)))
<          strlcpy(css_base, str, sizeof(css_base));
<       if (css_base[0] == 0)
<         compose_base_url(lbs, css_base, sizeof(css_base), FALSE);
<    } else
---
>    if (absolute_link)
>       compose_base_url(lbs, css_base, sizeof(css_base), FALSE);
>    else
 
 
Cheers
Andreas
    icon2.gif   Re: Hide logbook tab when not authorized, posted by Andreas Luedeke on Wed Aug 23 11:36:22 2017 

Hi Stefano,

I think your assessment is correct: it is not possible to hide a logbook based on your read/write privileges.
And I'm not even sure that this would make much sense: at least you need to be able to get to the login page of the logbook.
But if you don't have read privileges for a logbook, you'll be automatically redirected to the login page, as soon as you select this logbook.

Kind Regards, Andreas

Stefano Bonaldo wrote:

Hello, I read carefully the manual, but I didn't find a way to hide the logbooks in the logbook bar and in the initial logbook selection for which the user does not have the access. So, if a user1 does not have the access to a specific logbook, user1 is not able to see that logbook in the bar and neither in the initial logbook selection. How can I do this without using the top groups?

 

    icon2.gif   Re: Problems with german_UTF8 language, posted by Andreas Luedeke on Wed Aug 23 15:11:32 2017 

Just an update: I've re-compiled, reinstalled and restarted elogd for other reasons and now the corrupted strings are all gone. Everthing looks fine now.

But I never worry when a problem goes away before I could understand it: I'm confident that I will have plenty of time later, when the problem magically re-appears - likely I'll be called on a Friday night :-)

Andreas Luedeke wrote:

Hi Stefan,

since recently (a few weeks) ELOG confuses the language translations.
Individual language strings are translated into garbage; most other strings are fine.
Currently I see the string "please select" translated into "ressed" (see attached picture), instead of what's written correctly in the language file "bitte auswählen".
But with every restart the corrupted strings vary: other strings are affected and other garbage strings are shown - some of them unreadable binary code (see Attachment 2).
I have the same version running in English: I see no problems there.
Kind regards

Andreas

 

    icon2.gif   Re: Hide logbook tab when not authorized, posted by Andreas Luedeke on Thu Aug 24 11:08:43 2017 

Well, Stefan would need to answer that. But if you are good with C-programming, you might implement it yourself?

There is a way to implement it; but it makes your installation a lot more complicated: you can have two ELOG servers. The first has all logbooks but requires authentification to read any. The second has only the public logbooks, and they are mirrored from the first.

Stefano Bonaldo wrote:

Hi Andreas,

many thanks for your answer. I partially agree with you, because sometimes "for privacy" of my working group I don't want that other users (external users) know the existance of the other logbooks.

Do you think that will be implemented in future?

Best regards, Stefano

Andreas Luedeke wrote:

Hi Stefano,

I think your assessment is correct: it is not possible to hide a logbook based on your read/write privileges.
And I'm not even sure that this would make much sense: at least you need to be able to get to the login page of the logbook.
But if you don't have read privileges for a logbook, you'll be automatically redirected to the login page, as soon as you select this logbook.

Kind Regards, Andreas

Stefano Bonaldo wrote:

Hello, I read carefully the manual, but I didn't find a way to hide the logbooks in the logbook bar and in the initial logbook selection for which the user does not have the access. So, if a user1 does not have the access to a specific logbook, user1 is not able to see that logbook in the bar and neither in the initial logbook selection. How can I do this without using the top groups?

 

 

 

    icon2.gif   Re: edit elog config via elog web interface, posted by Andreas Luedeke on Mon Sep 4 13:08:35 2017 elog_cfg_menu.png

On the right side of "Change password" you should find "Change config file".

But you'll only see this, if the user has admin priviledges defined in the config file: "Admin user = <user>"

config menu

Then you can edit the configuration of that logbook. At the top you'll have a button "Change [global]" to edit the global part of the configuration - if you have the relevant priviledges to do so.

Tim Schelfhout wrote:

Hello,

Is it possible to edit the entire elog config file via the elog frontend?  I see the config button 
on some screens but it only allows me to change user and password??

Thankx

 

    icon2.gif   Re: javascript?, posted by Andreas Luedeke on Mon Sep 4 13:19:33 2017 
This logbook, the forum, provides some javascript code. The code is simply referenced in the footer (Bottom text = <file> | <string>).

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css"><script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script><script>hljs.initHighlightingOnLoad();</script>

There's another example under elog:contributions/39

Cheers, Andreas

Tim Schelfhout wrote:

Is there anyone out there who can help me get started using javascript in elog ?  Is there an example somewhere ... i suppose you put the code in the
scripts folder?

Basically I am trying to calculate age of an added person in the database and display it after the birthdate field.  I  want to do other stuff, but once I know how 
the interaction is done I can proceed.

Thankx heaps

Great job btw with this ELOG ... been using it for years now.  I see you can add forms with html also, this might interest me for the future.

 

 

ELOG V3.1.5-3fb85fa6