[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-appserver/src geasAuthentication.py geasLi...
From: |
Reinhard Mueller |
Subject: |
gnue-appserver/src geasAuthentication.py geasLi... |
Date: |
Mon, 01 Sep 2003 12:54:44 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue-appserver
Branch:
Changes by: Reinhard Mueller <address@hidden> 03/09/01 12:54:44
Modified files:
src : geasAuthentication.py geasList.py
geasSession.py
Log message:
Some code cleanups.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/src/geasAuthentication.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/src/geasList.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-appserver/src/geasSession.py.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
Patches:
Index: gnue-appserver/src/geasAuthentication.py
diff -c gnue-appserver/src/geasAuthentication.py:1.2
gnue-appserver/src/geasAuthentication.py:1.3
*** gnue-appserver/src/geasAuthentication.py:1.2 Sat Aug 16 13:07:16 2003
--- gnue-appserver/src/geasAuthentication.py Mon Sep 1 12:54:43 2003
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasAuthentication.py,v 1.2 2003/08/16 17:07:16 siesel Exp $
import string
from gnue.common.apps import GDebug
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasAuthentication.py,v 1.3 2003/09/01 16:54:43 reinhard Exp $
import string
from gnue.common.apps import GDebug
***************
*** 110,134 ****
GDebug.printMesg(1, _("User '%s' logged in.") % user)
# possibly not the best solution
! session._tablelist=string.split(authData[0][3],',')
!
return 1 # = has access
-
#
---------------------------------------------------------------------------
- #
# check if user x has access for class/table y
#
---------------------------------------------------------------------------
def hasAccess (self, session, user, classname):
# this should be changed to check for the user again.
# it will only be secure if the protocol supports session-management too.
! if hasattr(session,"_tablelist") and (classname in session._tablelist):
return 1
else:
GDebug.printMesg(1, _("User '%s' has no access to class %s.") %
(user,classname))
! return 0
!
#
=============================================================================
# PAM Authentication Agent
#
=============================================================================
--- 110,132 ----
GDebug.printMesg(1, _("User '%s' logged in.") % user)
# possibly not the best solution
! session.tablelist = string.split (authData[0][3],',')
!
return 1 # = has access
#
---------------------------------------------------------------------------
# check if user x has access for class/table y
#
---------------------------------------------------------------------------
def hasAccess (self, session, user, classname):
# this should be changed to check for the user again.
# it will only be secure if the protocol supports session-management too.
! if hasattr (session, "tablelist") and (classname in session.tablelist):
return 1
else:
GDebug.printMesg(1, _("User '%s' has no access to class %s.") %
(user,classname))
! return 0
!
#
=============================================================================
# PAM Authentication Agent
#
=============================================================================
***************
*** 161,179 ****
print _("User '%s' logged in.") % user
return 1 # = has access
-
#
---------------------------------------------------------------------------
- #
# check if user x has access for class/table y
#
---------------------------------------------------------------------------
def hasAccess (self, session, user, classname):
# this should be changed to check for the user again.
# it will only be secure if the protocol supports session-management too.
! if hasattr(session,"_tablelist") and (classname in session._tablelist):
return 1
else:
! return 0
!
!
--- 159,173 ----
print _("User '%s' logged in.") % user
return 1 # = has access
#
---------------------------------------------------------------------------
# check if user x has access for class/table y
#
---------------------------------------------------------------------------
def hasAccess (self, session, user, classname):
# this should be changed to check for the user again.
# it will only be secure if the protocol supports session-management too.
! if hasattr (session, "tablelist") and (classname in session.tablelist):
return 1
else:
! return 0
Index: gnue-appserver/src/geasList.py
diff -c gnue-appserver/src/geasList.py:1.25 gnue-appserver/src/geasList.py:1.26
*** gnue-appserver/src/geasList.py:1.25 Mon Sep 1 12:32:20 2003
--- gnue-appserver/src/geasList.py Mon Sep 1 12:54:43 2003
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.25 2003/09/01 16:32:20 reinhard Exp $
from gnue.common.datasources import GDataSource,GConditions
import geasInstance
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.26 2003/09/01 16:54:43 reinhard Exp $
from gnue.common.datasources import GDataSource,GConditions
import geasInstance
***************
*** 81,93 ****
def populate (self):
attributes = {}
attributes ["name"] = ""
! attributes ["database"] = self._session._database
attributes ["table"] = self._classdef.table
if self._sortColumns != []:
attributes ["order_by"] = string.joinfields (self._sortColumns, ",")
self._datasource = GDataSource.DataSourceWrapper (
! connections = self._session._connections,
attributes = attributes,
fields = self._prefColumns)
--- 81,93 ----
def populate (self):
attributes = {}
attributes ["name"] = ""
! attributes ["database"] = self._session.database
attributes ["table"] = self._classdef.table
if self._sortColumns != []:
attributes ["order_by"] = string.joinfields (self._sortColumns, ",")
self._datasource = GDataSource.DataSourceWrapper (
! connections = self._session.connections,
attributes = attributes,
fields = self._prefColumns)
Index: gnue-appserver/src/geasSession.py
diff -c gnue-appserver/src/geasSession.py:1.32
gnue-appserver/src/geasSession.py:1.33
*** gnue-appserver/src/geasSession.py:1.32 Sat Aug 16 13:07:16 2003
--- gnue-appserver/src/geasSession.py Mon Sep 1 12:54:43 2003
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.32 2003/08/16 17:07:16 siesel Exp $
import geasList
import geasTrigger
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasSession.py,v 1.33 2003/09/01 16:54:43 reinhard Exp $
import geasList
import geasTrigger
***************
*** 54,65 ****
def __init__ (self, connections, authAdapter, triggerMg):
self.loggedIn = 0
! self._user = ""
! self._connections = connections
try:
! self._database = gConfig('database')
except:
! self._database = "gnue"
self._lists = {}
self._listcount=0
self._authAdapter=authAdapter
--- 54,65 ----
def __init__ (self, connections, authAdapter, triggerMg):
self.loggedIn = 0
! self.connections = connections
try:
! self.database = gConfig('database')
except:
! self.database = "gnue"
! self._user = ""
self._lists = {}
self._listcount=0
self._authAdapter=authAdapter
***************
*** 124,129 ****
--- 124,131 ----
#
---------------------------------------------------------------------------
def commit (self):
+ # FIXME: gnue-common should support the concept of a session and commits
+ # on session level
for l in self._lists.keys():
if hasattr(self._lists[l],"_datasource"):
self._lists[l]._resultset.post()
***************
*** 133,139 ****
# Rollback the active transaction
#
---------------------------------------------------------------------------
! def rollback (self):
for l in self._lists.keys():
if hasattr(self._lists[l],"_datasource"):
self._lists[l]._datasource.rollback()
--- 135,143 ----
# Rollback the active transaction
#
---------------------------------------------------------------------------
! def rollback (self):
! # FIXME: gnue-common should support the concept of a session and rollbacks
! # on session level
for l in self._lists.keys():
if hasattr(self._lists[l],"_datasource"):
self._lists[l]._datasource.rollback()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue-appserver/src geasAuthentication.py geasLi...,
Reinhard Mueller <=