Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 127 of 806  Not logged in ELOG logo
ID Date Icon Authordown Author Email Category OS ELOG Version Subject
  68124   Thu Sep 24 00:14:49 2015 Warning Stefano colafranceschiStefano.Colafranceschi@gmail.comQuestionLinux3.1.0Elog command not working properly
<p>Hi,</p>

<p>I have a problem running elog command from php script. Basically in the php I call system(&quot;elog -h etc etc.. And from the php command line works but not in the browser apparently without errors (php apache logfile no problem), any suggestions?</p>
  68592   Thu Apr 6 17:36:46 2017 Question Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1command line and apache+ldap authentication
Hi,
  we are running an elogd (with SSL) server on a machine and using apache as a proxy.

The authentication to the apache server is managed via LDAP module directly by apache, while, so far, we have no authentication enabled in the elogd server itself.
So, when a used want to access the elog server, he is required to provide user/pwd by apache, and then he can access the elogs.

We would like to use the elog command line to transit entries automatically from a terminal from a different host.

the command line we are trying is:

echo "Test" | elog -v -h elog.belle2.org -a Author="stefano" -a Type="Other" -l elog -s demo -u username password  -p 443

where username password are registered into LDAP.

In response we have a 401 Unauthorized. The full return message is at the end of this message.

I suspect that the "username password" we pass to elog are supposed to be that of elogd, not that of apache/ldap: I don't know if this is the case.

Does anyone have an idea how to make this work?

Thanks in advance,
  Stefano

Successfully connected to host elog.belle2.org, port 443
Request sent to host:
POST /elog/ HTTP/1.0
Content-Type: multipart/form-data; boundary=---------------------------44BDB584269C5EEC3F73204
Host: elog.belle2.org:443
User-Agent: ELOG
Content-Length: 946


Content sent to host:
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="cmd"

Submit
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="unm"

xxxxxxxx
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="upwd"

xxxxxxxx
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="exp"

elog
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="encoding"

ELCode
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="Author"

stefano
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="Type"

Other
---------------------------44BDB584269C5EEC3F73204
Content-Disposition: form-data; name="Text"

demo
---------------------------44BDB584269C5EEC3F73204

Response received:
HTTP/1.1 401 Unauthorized
Date: Thu, 06 Apr 2017 15:32:37 GMT
Server: Apache/2.4.18 (Ubuntu)
WWW-Authenticate: Basic realm="Belle II internal"
Content-Length: 463
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at elog.belle2.org Port 443</address>
</body></html>

Error transmitting message
  68620   Tue May 16 10:21:18 2017 Entry Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1Use X-Forwarded-User as preset in author field
Hi,
  I have an elog server which uses apache/ldap for authentication.
I would like to have the username used for ldap to be set automatically as author field in the elog.

I'm using: 
Authentication = Webserver
and I do set the env-variable X-Forwarded-User correctly to the ldap username

GET /test/?cmd=New HTTP/1.1
Host: localhost:8080
Authorization: Basic bGFjYXByYXI6TWEwMiSyYnVt
...
Cookie: elmode=Summary; sid=D7DE678B7CAA1D10; ufnm=lacaprar; urem=0
...
X-Forwarded-User: lacaprar

How can I preset author to X-Forwarded-User?
Preset Author = $??
I've tried $short_name/$long_name but I got Anonymous.
I understand that it is so because these are meant to be filled when password authentication is used: any way to use some other variable with the Webserver auth?

thanks in advance,
  Stefano
  68622   Thu May 18 09:39:16 2017 Reply Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1Re: Use X-Forwarded-User as preset in author field
> I use an older version of elog, but
>  
> Preset Author = $short_name <$long_name>
> 
> works for me.
> 
> One thing to note is that I also have :
> Self register = 1
> 
> So at first login, the user has to type in his name and email adress,
> maybe that's why you got "Anonymous". (Otherwise the variable $shortname etc. are not set.)
> 
> HTH,
> 
> Christof

Many thanks for your answer.
however it seems that your solution requires to have a eLog "password" authentication, which I'd like to avoid since I'd like to use only webserver one.

best,
  Stefano
  68625   Thu May 18 16:55:42 2017 Reply Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1[solved] Re: Use X-Forwarded-User as preset in author field
> 
> Sorry, I just double-checked, this userdatabase, I was talking about is the Password-file...
> 
> Please try the following snippet :
> 
> allow password change = 0
> Authentication = Webserver, File
> Preset Author = $short_name <$long_name>
> Locked Attributes = Author
> Password file = PASSWD.file
> 
> Christof

Many thanks, that is what I was looking for.

best,
  Stefano
  68626   Wed May 31 11:45:06 2017 Reply Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1Re: inactive users
Hi,
  I reopen this old thread since I'm having a similar problem.

I'm running ELOG V3.1.1-0767eb0 on ubuntu with webserver authentication, and I'd like to remove 'active' checkbox as well.

The problem that we found is that if any user click on the [Set None] button at the bottom of the Config page in order to unsubscribe from all mail notification, *all* the checkbox are toggled, not only those for the email notification. And this includes 
also the "active user" as well.
Moreover, if an user click directly on the "active user" checkbox, a warning dialog box appears, asking for confirmation, but this is not the case is [Set none] is pressed: so, in that case, a user deactivate itself without warning.

Looking at the web page as well as at the code, I did not find a possibility, but maybe someone knows better.

Thanks in advance,
  Stefano

> Hello,
> 
> Is it possible to remove the "active" checkbox a user sees when they click on "config"?  Alternatively, is it possible to have a new user arrive directly at the logbook they chose, rather than starting out at the config screen?
> 
> We are running elog-3.1.1 on SL6 with webserver authentication.  For the most part this works great, but somehow a few users become inactive after they login for the first time.  They claim they didn't un-check "active," but I can't think of any other 
way this would happen.
> 
> Many thanks,
> Devin
  68628   Wed May 31 16:02:46 2017 Reply Stefano Lacaprarastefano.lacaprara@pd.infn.itBug reportLinux3.1.1Re: inactive users
Hi,
  a possible solution is to change the current SetAll() and SetNone() javascript functions to something like:


  <!--
function SetNone()
{
  for(var i=0,els=document.querySelectorAll('[name^="sub_lb"]'); i<els.length; i++)
  {
    els[i].checked = false;
  }
}
function SetAll()
{
  for(var i=0,els=document.querySelectorAll('[name^="sub_lb"]'); i<els.length; i++)
  {
    els[i].checked = true;
  }
}
//-->

It works on Chromium 58.x and Firefox 53.x, I don't know about other browsers.

The javascript snippet is generated in function elogd.c: void show_config_page(LOGBOOK * lbs) (line 13960-984 on my version of the source code).

Best,
  Stefano
  68694   Mon Oct 23 11:47:50 2017 Question Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinuxV3.1.1-0767eb0Attribute option "+x" not searcheable
Dear experts,
   I have an elog with an attribute with fixed values, like this:

Attributes = Half
Options Half = +x, -x, both

It works fine, but I would like to find (or quick filter) all entries with Half=+x .

If I go to the search form, I can select +x from the dropdown menu for Half, but the search returns no result, even if I do have a number of entries with Half=+x. Likewise if I try to do the same with Quick filter.

I believe that this is due to the fact that the search uses regex, and "+" is reserved. I've tried to perform a search by entering manually and escaped "\+x", and it works as intended.

https://.../?mode=summary&reverse=0&reverse=1&npp=20&Half=%5E%5C%2Bx%24

However, since this attribute has a list of fixed values, it is not possible to entry manually something different "\+x" than what is defined in the config, that is "+x".

Is there a solution for this problem?

I would rather not change the attributes options (to, say, positive/negative), since that would mean changing manually a non negligible number of entries.

thanks,
  Stefano
ELOG V3.1.5-3fb85fa6