Changeset 3560

Show
Ignore:
Timestamp:
04/26/08 11:19:06 (9 months ago)
Author:
pacopablo
Message:

Fixed session population on login.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • phpbbauthplugin/0.11/phpbbauth/main.py

    r3558 r3560  
    4040    hash_prefix = Option('account-manager', 'phpbb_hash_prefix', '$H$',  
    4141                         'Hash prefix used for phpBB passwords.') 
     42 
     43    # This is here so that the account manager configuration page will pick  
     44    # it up. 
     45    database = Option('account-manager', 'phpbb_database', None,  
     46                      'Database URI for the phpBB database to auth ' 
     47                      'against') 
    4248 
    4349    def config_key(self): 
     
    108114        cnx = PhpDatabaseManager(self.env).get_connection() 
    109115        cur = cnx.cursor() 
    110         cur.execute('SELECT user_name, email_address, created, display_name
    111                     '  FROM %s WHERE active = True AND user_name = %%s
    112                     % self.table, (user,)) 
     116        cur.execute('SELECT username, user_email, user_lastvisit
     117                    '  FROM phpbb_users
     118                    ' WHERE username = %s', (user,)) 
    113119        userinfo = [u for u in cur] 
    114120        cnx.close() 
     
    125131        for uname, email, lastvisit in userinfo: 
    126132            try: 
    127                cur = cnx.cursor() 
     133                cur = cnx.cursor() 
    128134                cur.execute('INSERT INTO session (sid, authenticated, ' 
    129135                            'last_visit) VALUES (%s, 1, %s)', 
     
    133139                cnx.rollback() 
    134140            try: 
    135                cur = cnx.cursor() 
     141                cur = cnx.cursor() 
    136142                cur.execute("INSERT INTO session_attribute" 
    137143                            "    (sid, authenticated, name, value)"