On Fri, 31 Jan 2014, Devin A. Bougie wrote:
> We are still running Invenio v1.0.1

You may want up upgrade at least within the same release series, i.e. to
v1.0.6, which keeps the same API and so the upgrade should be painless.

> I would like to set the login method for all users.  Is there a
> command we can use for this?

You have to write a small Python script to do this.  Just loop over your
users and set "login_method" user preference to the desired value.  Here
is a skeleton on how to go about writing it:

| In [1]: from invenio.webuser import *
| 
| In [2]: run_sql("SELECT id,nickname FROM user")
| Out[2]: 
| ((1L, 'admin'),
|  (2L, 'jekyll'),
|  (3L, 'hyde'),
|  (4L, 'dorian'),
|  (5L, 'romeo'),
|  (6L, 'juliet'),
|  (7L, 'benvolio'),
|  (8L, 'balthasar'))
| 
| In [3]: get_user_preferences(5)
| Out[3]: {'language': 'en', 'login_method': 'Local'}
| 
| In [4]: d = get_user_preferences(5)
| 
| In [5]: d['login_method'] = 'Foo'
| 
| In [6]: set_user_preferences(5, d)
| 
| In [7]: get_user_preferences(5)
| Out[7]: {'language': 'en', 'login_method': 'Foo'}

Best regards
-- 
Tibor Simko

Reply via email to