It is currently Mon May 21, 2012 4:31 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: eTiny login screen: reduce the DB list
PostPosted: Thu Jun 26, 2008 1:17 pm 
Offline

Joined: Thu Apr 17, 2008 8:00 am
Posts: 183
Hi,

I've the feeling theis question was already asked one, but can no longer find it..

When logging in via eTiny one is presented with a list of available DBs. I would like to restrict it to just one.

Deleted the DBs, or creating a dedicate Terp instance with this one DB is not an option right now..

In tinyerp/templates/login.kid I see:
Code:
                        <select name="db" style="width: 302px;">
                            <span py:if="dblist and (dblist is not -1)" py:strip="">
                                <option py:for="v in dblist or []" py:content="v" selected="${tg.selector(v==db)}">dbname</option>
                            </span>
                        </select>


Is there a more elegant /recommended way, or should I just hack the above code?

Thanks in advance,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:16 pm 
Offline

Joined: Sat Aug 18, 2007 7:14 am
Posts: 746
Hi boran,
We do not like how this list of db's is displayed for the public to view. It would be better if the user was able to log into a default db and from there make a selection from a list of db's that they were allowed to access.

Regards,
Gerry


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 1:05 am 
Offline

Joined: Sat Aug 18, 2007 7:14 am
Posts: 746
Preferably, this is what we would like to see for the login sequence:

Click OpenERP icon or select from system menu.
Welcome screen appears saying: Enter key [_______]
User enters their key (4-8 alphanumeric string)
(key is used to find the database list allowed for this key)
Now the regular Login screen appears with a restricted set of databases in the dropdown list.

On the server there would be a new table in a database (postgres db maybe?), let's call it 'db_allow'. It would have two fields:
Code:
'key':   varchar(8)
'db':     varchar(128)   # varchar only allocates used space so let's be generous.

Create a universal user in postgres just for this table and only GRANT SELECT.
This user is used to access the table from the initial Key Submit screen.

Each key represents a select subset list of databases.
Create view for 'db_allow' so we can add some records for some keys and databases.


Regards,
Gerry


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 8:40 am 
Offline

Joined: Thu Apr 17, 2008 8:00 am
Posts: 183
Its not that easy to make generic. The user details are in each DB, so unless we know which DB to query for user details (user/pass) ....

Adding another key is not really the solution in my opinion.

Perhaps if db_allowed existed, then
- the db list would be restricted to the DB list in that table.
- First thing would be to query the username
- Given the username lookup the allowed DBs to display, or display all if there is no restriction.
- Now show the password field, and look up the password from the correct DB.

BTW I did some tests and just changing the HTML lines above to following works.
Code:
for="v in ['mydb']"

This shows only one DB. This is fine ina scenario where one uses the GTK interface for generic Terp work, and eTiny for restrcted access to just one DB..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 3:51 pm 
Offline

Joined: Sat Aug 18, 2007 7:14 am
Posts: 746
There is no way to tell if a specific user even exists in each db so you cannot use the username to try to restrict the list. This is why there needs to be a key that is not associated with any specific username or any specific db.

Each key represents a grouping of databases allowed for that key. You can assign the same key to any number of users so it becomes many2many and this makes it very flexible and powerful.

Using the key solution you would also have the same behavior in both the Gtk-client and eTiny which is rather important.

I've been thinking about how to solve this publicly viewable db list problem for quite a while. I looked at many different ways of doing this but always the username presented the roadblock and that is when I went to the key idea. It is disassociated from any specific user in any Tiny db which may or may not even exist and that is why the key solution works.

Regards,
Gerry


Top
 Profile  
 
 Post subject: Re: eTiny login screen: reduce the DB list
PostPosted: Tue Feb 08, 2011 1:08 pm 
Offline

Joined: Tue Feb 08, 2011 1:05 pm
Posts: 1
You can restrict the limit by placing a parameter on db !

You should have a great inspect the diet solution so the tinnitus miracle guide book. You could attempt burn the fat feed the muscle effectively the truth about six pack abs occasion you would like. I like link building services then seo link monster because give good results super to the eat stop eat guidelines.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP