- initial work on a mod_python based web frontend
- add logs to svn:ignore - use psycopg2 in backend git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@198 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
572b42a706
commit
bf7992a600
6 changed files with 56 additions and 5 deletions
|
@ -6,7 +6,7 @@
|
|||
from SessionManager import *
|
||||
from DomainManager import *
|
||||
import Settings
|
||||
import psycopg
|
||||
import psycopg2
|
||||
|
||||
class ServiceFacade:
|
||||
"""
|
||||
|
@ -16,7 +16,7 @@ class ServiceFacade:
|
|||
def __init__(self):
|
||||
connstr = 'host=%(dbhost)s user=%(dbuser)s ' + \
|
||||
'password=%(dbpassword)s dbname=%(dbname)s'
|
||||
dbconn = psycopg.connect(connstr % Settings.DBSETTINGS)
|
||||
dbconn = psycopg2.connect(connstr % Settings.DBSETTINGS)
|
||||
self.sessionManager = SessionManager(dbconn)
|
||||
self.domainManager = DomainManager(dbconn)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Session manager class for gnuviech-admin tool backend
|
|||
$Id$
|
||||
"""
|
||||
import Settings
|
||||
import os, sha, time, logging, psycopg
|
||||
import os, sha, time, logging, psycopg2
|
||||
from threading import Timer
|
||||
|
||||
SESSIONTIMEOUT=120 # 2 minutes
|
||||
|
@ -50,8 +50,8 @@ class SessionManager:
|
|||
def newSession(self, login, password):
|
||||
cr = self._dbconn.cursor()
|
||||
cr.execute('SELECT * FROM sysuser WHERE name=%(login)s AND md5pass=md5(%(password)s)' %
|
||||
{'login': psycopg.QuotedString(login),
|
||||
'password' : psycopg.QuotedString(password)})
|
||||
{'login': psycopg2.QuotedString(login),
|
||||
'password' : psycopg2.QuotedString(password)})
|
||||
self._dbconn.commit()
|
||||
result = cr.fetchall()
|
||||
if cr.rowcount == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue