Merge branch 'master' into DAL-modular
* master: (58 commits) changed version number better types by default, given that we're on 2005 at least fix for StorageList and tests added improved coverage, fix bug with IS_LIST_OF and items not being strings fix cache.increment, added tests R-2.9.11 reverted simplejson R-2.9.10 upgraded memcache and markdown2 upgraded pypyodbc.py upgraded simplejson no more split in contains, thanks Niphlod fixed wording and bug on contains(), made smart_query use ilike instead of like ilike, thanks Niphlod CROSS JOIN, thanks jotbe added custom represent to GoogleDatastoreAdapter, thanks Alan postgresql: identifies what adapter auto-loads json values added more tests for json Field fixed typo in driver_auto_json Improve the graphing to show the name of the application. ... Conflicts: gluon/dal.py gluon/globals.py gluon/tests/test_dal.py
This commit is contained in:
+15
-8
@@ -11,7 +11,10 @@ Auth, Mail, PluginManager and various utilities
|
||||
"""
|
||||
|
||||
import base64
|
||||
import cPickle
|
||||
try:
|
||||
import cPickle as pickle
|
||||
except:
|
||||
import pickle
|
||||
import datetime
|
||||
import thread
|
||||
import logging
|
||||
@@ -2710,7 +2713,8 @@ class Auth(object):
|
||||
extra_fields = [
|
||||
Field("password_two", "password", requires=IS_EQUAL_TO(
|
||||
request.post_vars.get(passfield,None),
|
||||
error_message=self.messages.mismatched_password))]
|
||||
error_message=self.messages.mismatched_password),
|
||||
label=current.T("Confirm Password"))]
|
||||
else:
|
||||
extra_fields = []
|
||||
form = SQLFORM(table_user,
|
||||
@@ -3187,11 +3191,14 @@ class Auth(object):
|
||||
if log is DEFAULT:
|
||||
log = self.messages['change_password_log']
|
||||
passfield = self.settings.password_field
|
||||
is_crypt = copy.copy([t for t in table_user[passfield].requires
|
||||
if isinstance(t,CRYPT)][0])
|
||||
is_crypt.min_length = 0
|
||||
requires = table_user[passfield].requires
|
||||
if not isinstance(requires,(list, tuple)):
|
||||
requires = [requires]
|
||||
requires = filter(lambda t:isinstance(t,CRYPT), requires)
|
||||
if requires:
|
||||
requires[0].min_length = 0
|
||||
form = SQLFORM.factory(
|
||||
Field('old_password', 'password', requires=[is_crypt],
|
||||
Field('old_password', 'password', requires=requires,
|
||||
label=self.messages.old_password),
|
||||
Field('new_password', 'password',
|
||||
label=self.messages.new_password,
|
||||
@@ -3326,7 +3333,7 @@ class Auth(object):
|
||||
user = table_user(user_id)
|
||||
if not user:
|
||||
raise HTTP(401, "Not Authorized")
|
||||
auth.impersonator = cPickle.dumps(session)
|
||||
auth.impersonator = pickle.dumps(session, pickle.HIGHEST_PROTOCOL)
|
||||
auth.user.update(
|
||||
table_user._filter_fields(user, True))
|
||||
self.user = auth.user
|
||||
@@ -3337,7 +3344,7 @@ class Auth(object):
|
||||
elif user_id in (0, '0'):
|
||||
if self.is_impersonating():
|
||||
session.clear()
|
||||
session.update(cPickle.loads(auth.impersonator))
|
||||
session.update(pickle.loads(auth.impersonator))
|
||||
self.user = session.auth.user
|
||||
self.update_groups()
|
||||
self.run_login_onaccept()
|
||||
|
||||
Reference in New Issue
Block a user