Merge branch 'top-10-2013' of github.com:OWASP/railsgoat into top-10-2013
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
class AdminController < ApplicationController
|
class AdminController < ApplicationController
|
||||||
|
|
||||||
#before_filter :administrative
|
before_filter :administrative, :if => :admin_param
|
||||||
skip_before_filter :has_info
|
skip_before_filter :has_info
|
||||||
|
|
||||||
def dashboard
|
def dashboard
|
||||||
@@ -45,4 +45,10 @@ class AdminController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def admin_param
|
||||||
|
params[:id] == '1'
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function makeActive(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
function loadTable(){
|
function loadTable(){
|
||||||
$("#userDataTable").load("/admin/"+ <%=current_user.user_id %> + "/get_all_users")
|
$("#userDataTable").load("/admin/"+ <%= params[:admin_id] %> + "/get_all_users")
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(
|
$(document).ready(
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ $('#delete_button').click(function() {
|
|||||||
$("#editAcct").modal('hide');
|
$("#editAcct").modal('hide');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/admin/" + <%= @user.user_id %> + "/delete_user.json",
|
url: "/admin/" + <%= params[:admin_id] %> + "/delete_user.json",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
$('#success').show(500).delay(1500).fadeOut();
|
$('#success').show(500).delay(1500).fadeOut();
|
||||||
|
|||||||
+2
-2
@@ -33,8 +33,8 @@ users = [
|
|||||||
{
|
{
|
||||||
:email => "mike@metacorp.com",
|
:email => "mike@metacorp.com",
|
||||||
:admin => false,
|
:admin => false,
|
||||||
:password => "motorcross1445",
|
:password => "motocross1445",
|
||||||
:password_confirmation => "motorcross1445",
|
:password_confirmation => "motocross1445",
|
||||||
:first_name => "Mike",
|
:first_name => "Mike",
|
||||||
:last_name => "McCabe",
|
:last_name => "McCabe",
|
||||||
:user_id =>4
|
:user_id =>4
|
||||||
|
|||||||
Reference in New Issue
Block a user