Skip to content

Commit

Permalink
fiixes #109 - fixed account apps (#115)
Browse files Browse the repository at this point in the history
fixed the following  apps:

signup app
login app
register public key app
password recovery app
view permissions app
reset password app(not tested)
  • Loading branch information
djmgit authored and mariobehling committed Mar 13, 2017
1 parent e510737 commit 1adb670
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion accountpermissions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h3>Account information</h3>
<div class="section" id="serviceList"><h3>List of services</h3></div>
</div>
<div id="notLoggedIn" class="hidden">
<p>You are not logged in. <a href="/apps/loginpage">Click here to login</a></p>
<p>You are not logged in. <a href="/loginpage">Click here to login</a></p>
</div>

<!-- Bootstrap core JavaScript
Expand Down
14 changes: 7 additions & 7 deletions accountpermissions/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready( function () {
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
dataType: "json",
dataType: "jsonp",
success (response) {
$("#permissions").removeClass("hidden");
$("#userName").children().first().append(response.userName);
Expand All @@ -11,17 +11,17 @@ $(document).ready( function () {
jQuery.each(response.userRoleSpecificPermissions, function(service, obj){
$("#userRoleSpecificPermissions").append(service);
});
$("#ParentUserRole").children().first().append(response.userRole);
$("#parentUserRole").children().first().append(response.userRole);
},
error (xhr, ajaxOptions, thrownError) {
$("#notLoggedIn").removeClass("hidden");
return;
}
});

$.ajax( "/api/account-permissions.json", {
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
data: { getServiceList: true },
dataType: "json",
dataType: "jsonp",
success (response) {
jQuery.each(response.serviceList, function(i, service){
$("#serviceList").append("<div class='service' id='" +
Expand All @@ -31,7 +31,7 @@ $(document).ready( function () {
"</span><div class='serviceContent'\
valueSet=false></div></div><br>");
});
}
},
});

$(document).on("click",".serviceTitle", function () {
Expand All @@ -40,9 +40,9 @@ $(document).ready( function () {

if(child.attr("valueSet") === "false"){
child.hide();
$.ajax( "/api/account-permissions.json", {
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
data: { getServicePermissions: obj.attr("id") },
dataType: "json",
dataType: "jsonp",
success (response) {
if(Object.keys(response.servicePermissions).length > 0){
child.append("<ul></ul>");
Expand Down
2 changes: 1 addition & 1 deletion forgotpassword/js/passwordrecovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(document).ready(function () {
var mail = $('#email').val();
$.ajax( "http://api.loklak.org/api/recoverpassword.json", {
data: { forgotemail: mail },
dataType: 'json',
dataType: 'jsonp',
success: function (response) {
resetFields();
$('#status-box').text(response.message);
Expand Down
8 changes: 4 additions & 4 deletions keyRegistration/js/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ $(document).ready(function () {

// get password parameters
var regex;
$.ajax( "/api/pubkey_registration.json", {
$.ajax( "http://api.loklak.org/api/pubkey_registration.json", {
data: { getParameters: true },
dataType: 'json',
dataType: 'jsonp',
success: function (response) {
if(response.self) {
$('#status-box').text("");
Expand Down Expand Up @@ -116,9 +116,9 @@ $(document).ready(function () {
}
//console.log(data);

$.ajax( "/api/pubkey_registration.json", {
$.ajax( "http://api.loklak.org/api/pubkey_registration.json", {
data: data,
dataType: 'json',
dataType: 'jsonp',
success: function (response) {
//resetFields();
$('#status-box').text(response.message);
Expand Down
12 changes: 6 additions & 6 deletions loginpage/js/loginpage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$(document).ready(function () {
$.ajax( "/api/login.json", {
$.ajax( "http://api.loklak.org/api/login.json", {
data: { checkLogin: true },
dataType: "json",
dataType: "jsonp",
success: function (response) {
if(response.loggedIn) {
$("#status-box").text(response.message);
Expand Down Expand Up @@ -31,9 +31,9 @@ $(document).ready(function () {
setRemember();

var optionsLogin = {
url: "/api/login.json",
url: "http://api.loklak.org/api/login.json",
type: "get",
dataType: "json",
dataType: "jsonp",
success(response) {
window.location = "/apps/applist/index.html";
},
Expand All @@ -49,9 +49,9 @@ $(document).ready(function () {
});

var optionsLogout = {
url: "/api/login.json",
url: "http://api.loklak.org/api/login.json",
type: "get",
dataType: "json",
dataType: "jsonp",
success(response) {
$("#loginForm").removeClass("hidden");
$("#logoutForm").addClass("hidden");
Expand Down
7 changes: 4 additions & 3 deletions resetpass/js/resetpass.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(document).ready(function () {

$.ajax( "http://api.loklak.org/api/recoverpassword.json", {
data: { getParameters: true, token: urltoken },
dataType: 'json',
dataType: 'jsonp',
success: function (response) {
regex = response.regex;
var regexTooltip = response.regexTooltip;
Expand All @@ -21,6 +21,7 @@ $(document).ready(function () {
$('#pass').prop( "disabled", true );
$('#confirmpass').prop( "disabled", true );
$('#resetbut').prop( "disabled", true );
console.log(thrownError);
tokenerr = true;
},
});
Expand Down Expand Up @@ -72,9 +73,9 @@ $(document).ready(function () {
if(!total) {
var newpass = $('#pass').val();

$.ajax( "/api/resetpassword.json", {
$.ajax( "http://api.loklak.org/api/resetpassword.json", {
data: { token: urltoken, newpass: newpass },
dataType: 'json',
dataType: 'jsonp',
success: function (response) {
resetFields();
$('#status-box').text(response.message);
Expand Down
6 changes: 3 additions & 3 deletions signup/js/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(document).ready(function ()
// get password parameters
$.ajax( "http://api.loklak.org/api/signup.json", {
data: { getParameters: true },
dataType: "json",
dataType: "jsonp",
success: function (response) {
var regex = response.regex;
var regexTooltip = response.regexTooltip;
Expand Down Expand Up @@ -170,9 +170,9 @@ $(document).ready(function ()
$("#confirmpass").keyup(function (){checkConfirmPass();});

var options = {
url: "/api/signup.json",
url: "http://api.loklak.org/api/signup.json",
type: "get",
dataType: "json",
dataType: "jsonp",
success(response) {
resetFields();
$("#status-box").text(response.message);
Expand Down

0 comments on commit 1adb670

Please sign in to comment.