Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 267 of 807  Not logged in ELOG logo
ID Date Icondown Author Author Email Category OS ELOG Version Subject
  66311   Tue Apr 14 18:51:43 2009 Reply Grant Jeffcotegrant@jeffcote.orgQuestionWindows2.7.5Re: Multi Logook Login

Hal Proctor wrote:

We have two logbooks, each with a different list of users. 
 The logbooks are open to all network users for read only.
A user with Write permisions logs into his designated logbook.
He then decides to view the other logbook, the one he does not have write permissions to by clicking on the tab to the other logbook.
He is immediately logged out of the logbook he has write permissions to.
He did not close his browser session, only clicked on the other logbook tab.
Is there Any way to keep that person logged into the logbook he has rights to without having the "keep me logged in Checkbox"?

 Just like this site has Forum, Config Examples, etc.

Once you select another tab they are logged out of their logbook they just logged in to.

 

 Have a look at this thread Hal, worked well for me:  Link

  66312   Tue Apr 14 20:00:08 2009 Reply Hal Proctorhproctor@mpm.comQuestionWindows2.7.3-1024Re: Access Control

Grant Jeffcote wrote:

Grant Jeffcote wrote:

Yoshio Imai wrote:

Grant Jeffcote wrote:
At present we can give others a full view by adding them to the 'Users' list for each individual logbook, this unfortunately also gives them 'write' access.


I think the solution to your problem would be to use Deny statements in the configuration sections for the logbooks.
Assume user1, user2 and user3 are in the "owners'" group of logbook1, and user4 and user5 only have "privileged read" access. Then a configuration as follows might help:
Login user = user1, user2, user3, user4, user5

Deny New = user4, user5
Deny Reply = user4, user5
Deny Duplicate = user4, user5
Deny Edit = user4, user5
Deny Delete = user4, user5
Deny Select = user4, user5
Deny CSV Import = user4, user5

This should give them the same read permissions as the logbook owners but should deny any writing operations. I recognize that this is a little bit of admin work if the lists of such "privileged readers" gets long, but each user would have his/her individual password (even the same as for access to his/her "own" logbook).

Perhaps you can give it a try.


What a great solution, thanks Yoshio, it works a treat.


Is there any way to give a logged in user a 'Guest' view on certain logbooks?
Unfortunately at the moment if they are not in the 'login users = ' group they are automatically logged out and have to re-log back into their own logbook.


I have this same issue. People come and go from one logbook to the other but I still want them to maintain logged in status to the logbook they have rights to.
  66313   Tue Apr 14 20:03:06 2009 Reply Hal Proctorhproctor@mpm.comQuestionWindows2.7.5Re: Multi Logook Login

Grant Jeffcote wrote:

Hal Proctor wrote:

We have two logbooks, each with a different list of users. 
 The logbooks are open to all network users for read only.
A user with Write permisions logs into his designated logbook.
He then decides to view the other logbook, the one he does not have write permissions to by clicking on the tab to the other logbook.
He is immediately logged out of the logbook he has write permissions to.
He did not close his browser session, only clicked on the other logbook tab.
Is there Any way to keep that person logged into the logbook he has rights to without having the "keep me logged in Checkbox"?

 Just like this site has Forum, Config Examples, etc.

Once you select another tab they are logged out of their logbook they just logged in to.

 

 Have a look at this thread Hal, worked well for me:  Link

 thanks Grant, but I dont see the solution.  your last entry still states users being logged out when switching logbooks.

Are you suggesting that every user within our orginization needs to be on the deny list of logbook1 if they have rights to logook2?

  66315   Wed Apr 15 09:26:37 2009 Reply Stefan Rittstefan.ritt@psi.chBug fixAll2.7.6Re: Long cookie content is not handled properly.

Simon Patton wrote:
I discovered the infinite loop in 2.7.5 which can happen when a cookie's content is longer that the cookie array
designed to hold it. I also note that this issue has been addressed in 2.7.6, but the solution does not appear
to be correct and it can end up completely confusing the cookie extraction.

In 2.7.5 the code was:
    for (i = 0; *p && *p != ';' && *p != '\r' && *p != '\n' ; )
        if (i < (int) sizeof(cookie)-1)
            cookie[i++] = *p++;

While in 2.7.6 is became:
    for (i = 0; *p && *p != ';' && *p != '\r' && *p != '\n';)
        if (i < (int) sizeof(cookie) - 1)
            cookie[i++] = *p++;
        else
            break;

This leaves 'p' pointing to the middle of the cookie's content and I can not see that this is corrected in the loop (sorry if I've missed that).

The solution I used to patch 2.7.5 was the following:
    for (i = 0; *p && *p != ';' && *p != '\r' && *p != '\n' ; ++p)
        if (i < (int) sizeof(cookie)-1)
            cookie[i++] = *p;

which simply truncates the contents of the cookie (which is assumed not to be an elogd cookie) but leaves 'p' in the right place to extract the next one.


You're absolutely right about that. I incorporated your patch into revision #2192.
  66316   Wed Apr 15 09:51:35 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows2.7.5Re: Multi Logook Login

 

Hal Proctor wrote:

 

Grant Jeffcote wrote:

 

Hal Proctor wrote:

We have two logbooks, each with a different list of users. 
 The logbooks are open to all network users for read only.
A user with Write permisions logs into his designated logbook.
He then decides to view the other logbook, the one he does not have write permissions to by clicking on the tab to the other logbook.
He is immediately logged out of the logbook he has write permissions to.
He did not close his browser session, only clicked on the other logbook tab.
Is there Any way to keep that person logged into the logbook he has rights to without having the "keep me logged in Checkbox"?

 Just like this site has Forum, Config Examples, etc.

Once you select another tab they are logged out of their logbook they just logged in to.

 

 

 Have a look at this thread Hal, worked well for me:  Link

 

 thanks Grant, but I dont see the solution.  your last entry still states users being logged out when switching logbooks.

Are you suggesting that every user within our orginization needs to be on the deny list of logbook1 if they have rights to logook2?

 

Can you try the following:

  • Put your "password file = xxx" option from the [global] section in elogd.cfg into each individual logook, remove it from [global] 
  • Remove all cookies from your browser
  • Try again to log in to the individual logbooks

The login is handled through cookies. Once you log in, you get two cookies unm (for user name) and upwd (for user password). Each cookie contains a "path" which controls to which URL the browser sends that cookie. If you "password file = xxx" statement is under [global], then "path=/", meaning the cookie is sent for all logbooks. This confuses you if you have different rights for different logooks. If "password file = xxx" is however in each individual loogbooks configuration, then you get "path=/<lobook>". You can check that by inspecting your browser's cookies. In that case the login name and password cookies are only sent to the URL for that specific logbook. I have not tested that extensively (different browsers, with/without Apache proxy), but if it works reliably, I will put this into the documentation.

  66318   Wed Apr 15 12:56:18 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows2.7.6-2191Re: ROptions value changed in the edit page
> When ROptions items contain the same substring and this substring is also an ROptions item (ex: notdone, 
> done), the value of the entry could change in the edit page. 
> It depends on the item order in the config file. 
> 
> If Options is used (instead of ROptions), it works as expected.
> 
> Is it a bug?
> 
> 
> Examples : 
> 
> #Insert "notdone" as new entry. When you try to edit the entry, the displayed value is "done".
> 
> [test_bad]
> Attributes = Author, Category
> ROptions Category = notdone, done
> 
> #No problem if you change the item order 
> 
> [test_good]
> Attributes = Author, Category
> ROptions Category = done, notdone

Thanks for reporting this bug. I fixed it in SVN revisoin 2193.
  66319   Wed Apr 15 14:44:42 2009 Reply Yoshio ImaiQuestionWindows2.7.5Re: Multi Logook Login
Hi, Stefan!


Stefan Ritt wrote:
If "password file = xxx" is however in each individual logbooks configuration, then you get "path=/<lobook>". You can check that by inspecting your browser's cookies. In that case the login name and password cookies are only sent to the URL for that specific logbook. I have not tested that extensively (different browsers, with/without Apache proxy), but if it works reliably, I will put this into the documentation.


We had done so on your advice and in principle this works, but our experience has shown one problem:

We have separated our logbooks into different top groups because of the sheer number of them (i.e. experiment logbooks in one top group with logbook groups for the sub-categories, personal analysis logbooks in another top group etc.). Obviously, the experiment logbooks may share the same login, therefore we have put the "password file" statement into that top group's global section (otherwise, we would have to log on to every beamtime logbook individually, which can be cumbersome when comparing e.g. experiment settings between beamtimes). For the personal logbooks, of course, we use per-logbook-access (i.e. "password file" statement in the individual logbook sections) such that logging on to one's own logbook does not imply access to someone else's logbook. However, since the group/top group structure does not appear in the elog URLs, the cookies for the beamtime logbooks all have the path set to "path=/". This breaks the scheme again (I guess we have sort of "abused" the concept of top groups a little) and it is not possible to work in one of the experiment logbooks in parallel with one's own logbook without having to renew the login when switching the logbook.


Is it possible to modify the elogd such that it first checks if, among the cookies sent, there is one where the path corresponds to the path of the current logbook, and evaluate cookies with "path=/" only if no such cookie is found?

Yoshio
  66321   Thu Apr 16 08:34:03 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.7.5Re: Config so that users can delete only their own entries?

Dennis Seitz wrote:
I've tried

Deny_Delete = All
Allow Delete = $author

and just
Allow Delete = $author

But either users can delete anyone's entries, or they can't delete any entries.

Am I missing something? If not, can you add the capability to allow users to delete, but only their own entries?

Thanks as usual for a great piece of code!


You cannot put $author into any Allow or Deny option, only explicit login names (not "full" names). What you want however is
Restrict Edit = 1

which lets only the original author either delete or edit entries. If you use that option, you probably want as well
Preset Author = $long_name
Preset on reply Author = $long_name
Preset on duplicate Author = $long_name
Locked Attributes = Author

So a user cannot pretend to be somebody else. You also need a valid "admin user = ..." statement. Note that the admin user always can delete/edit entries. If no admin user is defined, everybody has automatically admin rights, so Restrict Edit has no effect.
ELOG V3.1.5-3fb85fa6