diff options
Diffstat (limited to 'addons/auth_oauth/static/src')
| -rw-r--r-- | addons/auth_oauth/static/src/css/auth_oauth.css | 34 | ||||
| -rw-r--r-- | addons/auth_oauth/static/src/js/auth_oauth.js | 80 | ||||
| -rw-r--r-- | addons/auth_oauth/static/src/xml/auth_oauth.xml | 8 |
3 files changed, 0 insertions, 122 deletions
diff --git a/addons/auth_oauth/static/src/css/auth_oauth.css b/addons/auth_oauth/static/src/css/auth_oauth.css deleted file mode 100644 index 0489229042a..00000000000 --- a/addons/auth_oauth/static/src/css/auth_oauth.css +++ /dev/null @@ -1,34 +0,0 @@ -.openerp .oe_application .zocial { - font: white; -} - -.openerp .zocial.openerp:before { - content: "\E02E"; - font-style: italic; - text-shadow: 0 1px 1px black; -} - -.openerp a.zocial.openerp { - border: 1px solid #222222; - color: white; - margin: 0; - background-color: #b92020; - background-image: -webkit-gradient(linear, left top, left bottom, from(#b92020), to(#600606)); - background-image: -webkit-linear-gradient(top, #b92020, #600606); - background-image: -moz-linear-gradient(top, #b92020, #600606); - background-image: -ms-linear-gradient(top, #b92020, #600606); - background-image: -o-linear-gradient(top, #b92020, #600606); - background-image: linear-gradient(to bottom, #b92020, #600606); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; - text-shadow: none; - font-weight: normal; -} - -.openerp .oe_login .oe_oauth_provider_login_button { - margin-top: 4px; -} diff --git a/addons/auth_oauth/static/src/js/auth_oauth.js b/addons/auth_oauth/static/src/js/auth_oauth.js deleted file mode 100644 index 5046469a5dc..00000000000 --- a/addons/auth_oauth/static/src/js/auth_oauth.js +++ /dev/null @@ -1,80 +0,0 @@ -openerp.auth_oauth = function(instance) { - var _t = instance.web._t, - _lt = instance.web._lt; - var QWeb = instance.web.qweb; - - instance.web.Login.include({ - start: function(parent, params) { - var self = this; - var d = this._super.apply(this, arguments); - this.$el.hide(); - this.$el.on('click', 'a.zocial', this.on_oauth_sign_in); - this.oauth_providers = []; - if(this.params.oauth_error === 1) { - this.do_warn(_t("Sign up error"),_t("Sign up is not allowed on this database."), true); - } else if(this.params.oauth_error === 2) { - this.do_warn(_t("Authentication error"),_t("Access Denied"), true); - } else if(this.params.oauth_error === 3) { - this.do_warn(_t("Authentication error"),_t("You do not have access to this database or your invitation has expired. Please ask for an invitation and be sure to follow the link in your invitation email."), true); - } - return d.done(this.do_oauth_load).fail(function() { - self.do_oauth_load([]); - }); - }, - on_db_loaded: function(result) { - this._super.apply(this, arguments); - this.$("form [name=db]").change(this.do_oauth_load); - }, - do_oauth_load: function() { - var db = this.$("form [name=db]").val(); - if (db) { - this.rpc("/auth_oauth/list_providers", { dbname: db }).done(this.on_oauth_loaded); - } else { - this.$el.show(); - } - }, - on_oauth_loaded: function(result) { - this.oauth_providers = result; - var params = $.deparam($.param.querystring()); - if (this.oauth_providers.length === 1 && params.type === 'signup') { - this.do_oauth_sign_in(this.oauth_providers[0]); - } else { - this.$el.show(); - this.$('.oe_oauth_provider_login_button').remove(); - var buttons = QWeb.render("auth_oauth.Login.button",{"widget":this}); - this.$(".oe_login_pane form ul").after(buttons); - } - }, - on_oauth_sign_in: function(ev) { - ev.preventDefault(); - var index = $(ev.target).data('index'); - var provider = this.oauth_providers[index]; - return this.do_oauth_sign_in(provider); - }, - do_oauth_sign_in: function(provider) { - var return_url = _.str.sprintf('%s//%s/auth_oauth/signin', location.protocol, location.host); - if (instance.session.debug) { - return_url += '?debug'; - } - var state = this._oauth_state(provider); - var params = { - response_type: 'token', - client_id: provider.client_id, - redirect_uri: return_url, - scope: provider.scope, - state: JSON.stringify(state), - }; - var url = provider.auth_endpoint + '?' + $.param(params); - instance.web.redirect(url); - }, - _oauth_state: function(provider) { - // return the state object sent back with the redirected uri - var dbname = this.$("form [name=db]").val(); - return { - d: dbname, - p: provider.id, - }; - }, - }); - -}; diff --git a/addons/auth_oauth/static/src/xml/auth_oauth.xml b/addons/auth_oauth/static/src/xml/auth_oauth.xml deleted file mode 100644 index 76c71b83f10..00000000000 --- a/addons/auth_oauth/static/src/xml/auth_oauth.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<templates id="template" xml:space="preserve"> -<t t-name="auth_oauth.Login.button"> - <t t-foreach="widget.oauth_providers" t-as="p"> - <a href="#" t-attf-class="oe_oauth_provider_login_button #{p.css_class}" t-att-data-index="p_index"><t t-esc="p.body"/></a> - </t> -</t> -</templates> |
