comparison pylons_app/lib/auth.py @ 413:55377fdc1fc6

cleared global application settings. Made it much more extensible by keeping it key/value in the database.
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 01 Aug 2010 18:36:00 +0200
parents ca54622e39a1
children e0ef325cbdea
comparison
equal deleted inserted replaced
412:ca54622e39a1 413:55377fdc1fc6
15 # 15 #
16 # You should have received a copy of the GNU General Public License 16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software 17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA. 19 # MA 02110-1301, USA.
20 """
21 Created on April 4, 2010
22
23 @author: marcink
24 """
20 from beaker.cache import cache_region 25 from beaker.cache import cache_region
21 from pylons import config, session, url, request 26 from pylons import config, session, url, request
22 from pylons.controllers.util import abort, redirect 27 from pylons.controllers.util import abort, redirect
23 from pylons_app.lib.utils import get_repo_slug 28 from pylons_app.lib.utils import get_repo_slug
24 from pylons_app.model import meta 29 from pylons_app.model import meta
26 from sqlalchemy.exc import OperationalError 31 from sqlalchemy.exc import OperationalError
27 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound 32 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
28 import crypt 33 import crypt
29 from decorator import decorator 34 from decorator import decorator
30 import logging 35 import logging
31 """
32 Created on April 4, 2010
33
34 @author: marcink
35 """
36 36
37 log = logging.getLogger(__name__) 37 log = logging.getLogger(__name__)
38 38
39 def get_crypt_password(password): 39 def get_crypt_password(password):
40 """ 40 """
184 if user.is_authenticated: 184 if user.is_authenticated:
185 user = fill_data(user) 185 user = fill_data(user)
186 user = fill_perms(user) 186 user = fill_perms(user)
187 session['hg_app_user'] = user 187 session['hg_app_user'] = user
188 session.save() 188 session.save()
189 print user.permissions
190 return user 189 return user
191 190
192 #=============================================================================== 191 #===============================================================================
193 # CHECK DECORATORS 192 # CHECK DECORATORS
194 #=============================================================================== 193 #===============================================================================