[REM] Removed auth='admin' from modules
bzr revid: fme@openerp.com-20140129171520-wkz8ot4pa63utoi3
This commit is contained in:
parent
e6e8bb3789
commit
c4e48e2388
|
@ -1,11 +1,12 @@
|
||||||
|
|
||||||
from openerp import http
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.http import request
|
from openerp.http import request
|
||||||
|
|
||||||
class MassMailController(http.Controller):
|
class MassMailController(http.Controller):
|
||||||
@http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='admin')
|
@http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none')
|
||||||
def track_mail_open(self, mail_id):
|
def track_mail_open(self, mail_id):
|
||||||
""" Email tracking. """
|
""" Email tracking. """
|
||||||
|
request.disable_db = False
|
||||||
mail_mail_stats = request.registry.get('mail.mail.statistics')
|
mail_mail_stats = request.registry.get('mail.mail.statistics')
|
||||||
mail_mail_stats.set_opened(request.cr, request.uid, mail_mail_ids=[mail_id])
|
mail_mail_stats.set_opened(request.cr, SUPERUSER_ID, mail_mail_ids=[mail_id])
|
||||||
return "data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
|
return "data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
|
||||||
|
|
|
@ -8,8 +8,8 @@ import logging
|
||||||
import pprint
|
import pprint
|
||||||
import werkzeug
|
import werkzeug
|
||||||
|
|
||||||
from openerp.addons.web import http
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.addons.web.http import request
|
from openerp.http import request
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -19,12 +19,13 @@ class AdyenController(http.Controller):
|
||||||
|
|
||||||
@http.route([
|
@http.route([
|
||||||
'/payment/adyen/return/',
|
'/payment/adyen/return/',
|
||||||
], type='http', auth='admin')
|
], type='http', auth='none')
|
||||||
def adyen_return(self, pspReference, **post):
|
def adyen_return(self, pspReference, **post):
|
||||||
""" Paypal IPN."""
|
""" Paypal IPN."""
|
||||||
|
request.disable_db = False
|
||||||
post["pspReference"] = pspReference
|
post["pspReference"] = pspReference
|
||||||
_logger.info('Beginning Adyen form_feedback with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Beginning Adyen form_feedback with post data %s', pprint.pformat(post)) # debug
|
||||||
request.registry['payment.transaction'].form_feedback(request.cr, request.uid, post, 'adyen', context=request.context)
|
request.registry['payment.transaction'].form_feedback(request.cr, SUPERUSER_ID, post, 'adyen', context=request.context)
|
||||||
return_url = post.pop('return_url', '')
|
return_url = post.pop('return_url', '')
|
||||||
if not return_url:
|
if not return_url:
|
||||||
custom = json.loads(post.pop('merchantReturnData', '{}'))
|
custom = json.loads(post.pop('merchantReturnData', '{}'))
|
||||||
|
|
|
@ -3,8 +3,8 @@ import logging
|
||||||
import pprint
|
import pprint
|
||||||
import werkzeug
|
import werkzeug
|
||||||
|
|
||||||
from openerp.addons.web import http
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.addons.web.http import request
|
from openerp.http import request
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -20,10 +20,11 @@ class OgoneController(http.Controller):
|
||||||
'/payment/ogone/decline', '/payment/ogone/test/decline',
|
'/payment/ogone/decline', '/payment/ogone/test/decline',
|
||||||
'/payment/ogone/exception', '/payment/ogone/test/exception',
|
'/payment/ogone/exception', '/payment/ogone/test/exception',
|
||||||
'/payment/ogone/cancel', '/payment/ogone/test/cancel',
|
'/payment/ogone/cancel', '/payment/ogone/test/cancel',
|
||||||
], type='http', auth='admin')
|
], type='http', auth='none')
|
||||||
def ogone_form_feedback(self, **post):
|
def ogone_form_feedback(self, **post):
|
||||||
""" Ogone contacts using GET, at least for accept """
|
""" Ogone contacts using GET, at least for accept """
|
||||||
|
request.disable_db = False
|
||||||
_logger.info('Ogone: entering form_feedback with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Ogone: entering form_feedback with post data %s', pprint.pformat(post)) # debug
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
cr, uid, context = request.cr, SUPERUSER_ID, request.context
|
||||||
request.registry['payment.transaction'].form_feedback(cr, uid, post, 'ogone', context=context)
|
request.registry['payment.transaction'].form_feedback(cr, uid, post, 'ogone', context=context)
|
||||||
return werkzeug.utils.redirect(post.pop('return_url', '/'))
|
return werkzeug.utils.redirect(post.pop('return_url', '/'))
|
||||||
|
|
|
@ -9,8 +9,8 @@ import pprint
|
||||||
import urllib2
|
import urllib2
|
||||||
import werkzeug
|
import werkzeug
|
||||||
|
|
||||||
from openerp.addons.web import http
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.addons.web.http import request
|
from openerp.http import request
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class PaypalController(http.Controller):
|
||||||
resp = uopen.read()
|
resp = uopen.read()
|
||||||
if resp == 'VERIFIED':
|
if resp == 'VERIFIED':
|
||||||
_logger.info('Paypal: validated data')
|
_logger.info('Paypal: validated data')
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
cr, uid, context = request.cr, SUPERUSER_ID, request.context
|
||||||
res = request.registry['payment.transaction'].form_feedback(cr, uid, post, 'paypal', context=context)
|
res = request.registry['payment.transaction'].form_feedback(cr, uid, post, 'paypal', context=context)
|
||||||
elif resp == 'INVALID':
|
elif resp == 'INVALID':
|
||||||
_logger.warning('Paypal: answered INVALID on data verification')
|
_logger.warning('Paypal: answered INVALID on data verification')
|
||||||
|
@ -53,25 +53,28 @@ class PaypalController(http.Controller):
|
||||||
_logger.warning('Paypal: unrecognized paypal answer, received %s instead of VERIFIED or INVALID' % resp.text)
|
_logger.warning('Paypal: unrecognized paypal answer, received %s instead of VERIFIED or INVALID' % resp.text)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@http.route('/payment/paypal/ipn/', type='http', auth='admin', methods=['POST'])
|
@http.route('/payment/paypal/ipn/', type='http', auth='none', methods=['POST'])
|
||||||
def paypal_ipn(self, **post):
|
def paypal_ipn(self, **post):
|
||||||
""" Paypal IPN. """
|
""" Paypal IPN. """
|
||||||
|
request.disable_db = False
|
||||||
_logger.info('Beginning Paypal IPN form_feedback with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Beginning Paypal IPN form_feedback with post data %s', pprint.pformat(post)) # debug
|
||||||
self.paypal_validate_data(**post)
|
self.paypal_validate_data(**post)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@http.route('/payment/paypal/dpn', type='http', auth="admin", methods=['POST'])
|
@http.route('/payment/paypal/dpn', type='http', auth="none", methods=['POST'])
|
||||||
def paypal_dpn(self, **post):
|
def paypal_dpn(self, **post):
|
||||||
""" Paypal DPN """
|
""" Paypal DPN """
|
||||||
|
request.disable_db = False
|
||||||
_logger.info('Beginning Paypal DPN form_feedback with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Beginning Paypal DPN form_feedback with post data %s', pprint.pformat(post)) # debug
|
||||||
return_url = self._get_return_url(**post)
|
return_url = self._get_return_url(**post)
|
||||||
self.paypal_validate_data(**post)
|
self.paypal_validate_data(**post)
|
||||||
return werkzeug.utils.redirect(return_url)
|
return werkzeug.utils.redirect(return_url)
|
||||||
|
|
||||||
@http.route('/payment/paypal/cancel', type='http', auth="admin")
|
@http.route('/payment/paypal/cancel', type='http', auth="none")
|
||||||
def paypal_cancel(self, **post):
|
def paypal_cancel(self, **post):
|
||||||
""" When the user cancels its Paypal payment: GET on this route """
|
""" When the user cancels its Paypal payment: GET on this route """
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
request.disable_db = False
|
||||||
|
cr, uid, context = request.cr, SUPERUSER_ID, request.context
|
||||||
_logger.info('Beginning Paypal cancel with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Beginning Paypal cancel with post data %s', pprint.pformat(post)) # debug
|
||||||
return_url = self._get_return_url(**post)
|
return_url = self._get_return_url(**post)
|
||||||
return werkzeug.utils.redirect(return_url)
|
return werkzeug.utils.redirect(return_url)
|
||||||
|
|
|
@ -3,8 +3,8 @@ import logging
|
||||||
import pprint
|
import pprint
|
||||||
import werkzeug
|
import werkzeug
|
||||||
|
|
||||||
from openerp.addons.web import http
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.addons.web.http import request
|
from openerp.http import request
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,9 +14,10 @@ class OgoneController(http.Controller):
|
||||||
|
|
||||||
@http.route([
|
@http.route([
|
||||||
'/payment/transfer/feedback',
|
'/payment/transfer/feedback',
|
||||||
], type='http', auth='admin')
|
], type='http', auth='none')
|
||||||
def transfer_form_feedback(self, **post):
|
def transfer_form_feedback(self, **post):
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
request.disable_db = False
|
||||||
|
cr, uid, context = request.cr, SUPERUSER_ID, request.context
|
||||||
_logger.info('Beginning form_feedback with post data %s', pprint.pformat(post)) # debug
|
_logger.info('Beginning form_feedback with post data %s', pprint.pformat(post)) # debug
|
||||||
request.registry['payment.transaction'].form_feedback(cr, uid, post, 'transfer', context)
|
request.registry['payment.transaction'].form_feedback(cr, uid, post, 'transfer', context)
|
||||||
return werkzeug.utils.redirect(post.pop('return_url', '/'))
|
return werkzeug.utils.redirect(post.pop('return_url', '/'))
|
||||||
|
|
Loading…
Reference in New Issue