Replace the direct URL with config's one

To be customizable URL should be placed to "config"

Fixes: https://pagure.io/freeipa/issue/7619
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-07-06 09:31:37 +03:00 committed by Serhii Tsymbaliuk
parent 4b83227ac7
commit 0ed3dfb44c
3 changed files with 14 additions and 9 deletions

View File

@ -66,10 +66,15 @@ define([
/**
* Forms based login url
*/
frms_login_url: '/ipa/session/login_password',
forms_login_url: '/ipa/session/login_password',
//logout_url: '/ipa/session/json',
/**
* certificate/smartcard authentication url
*/
x509_login_url: '/ipa/session/login_x509',
/**
* Password reset url
*/

View File

@ -62,7 +62,7 @@ var IPA = function () {
that.jsonrpc_id = 0;
// live server path
that.url = '/ipa/ui/';
that.url = config.url;
/**
* jQuery AJAX options used by RPC commands
@ -122,7 +122,7 @@ var IPA = function () {
// if current path matches live server path, use live data
if (that.url && window.location.pathname.substring(0, that.url.length) === that.url) {
that.json_url = params.url || '/ipa/session/json';
that.json_url = params.url || config.json_url;
} else { // otherwise use fixtures
that.json_path = params.url || "test/data";
@ -514,7 +514,7 @@ IPA.login_password = function(username, password) {
};
var request = {
url: '/ipa/session/login_password',
url: config.forms_login_url,
data: data,
contentType: 'application/x-www-form-urlencoded',
processData: true,
@ -587,7 +587,7 @@ IPA.reset_password = function(username, old_password, new_password, otp) {
}
request = {
url: '/ipa/session/change_password',
url: config.reset_psw_url,
data: data,
contentType: 'application/x-www-form-urlencoded',
processData: true,

View File

@ -27,6 +27,7 @@ define(['dojo/_base/declare',
'dojo/topic',
'../ipa',
'../auth',
'../config',
'../reg',
'../FieldBinder',
'../text',
@ -34,7 +35,8 @@ define(['dojo/_base/declare',
'./LoginScreenBase'
],
function(declare, Deferred, construct, dom_style, query, on, topic,
IPA, auth, reg, FieldBinder, text, util, LoginScreenBase) {
IPA, auth, config, reg, FieldBinder, text, util,
LoginScreenBase) {
/**
@ -78,8 +80,6 @@ define(['dojo/_base/declare',
user_locked: "The user account you entered is locked. ",
x509_url: '/ipa/session/login_x509',
//nodes:
login_btn_node: null,
reset_btn_node: null,
@ -345,7 +345,7 @@ define(['dojo/_base/declare',
var login = this.get_field('username').get_value()[0];
var request = {
url: this.x509_url,
url: config.x509_login_url,
cache: false,
type: "GET",
data: $.param({