defcon 1.1.2 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/defcon/sessions_controller.rb +10 -2
- data/app/views/layouts/defcon/application.html.erb +1 -0
- data/app/views/layouts/defcon/default/application.html.erb +2 -1
- data/db/migrate/20141009215910_add_email_to_defcon_admin_users.rb +6 -0
- data/lib/defcon/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +3 -1
- data/test/dummy/log/development.log +39 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d62662dca4a0ced4108b7e0952184da77749f20
|
4
|
+
data.tar.gz: 3c55ff911616648ee9923851542b2183358e4204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47ebef4f9bfec3ac151d3090348eabd9039f0beec1759e991249d7ad454927f9aded9db24f55570f54d15bc755f604686ecce726cef94cf7fbe6a6e9f407d2f9
|
7
|
+
data.tar.gz: 04a7f511d56b0539c1b35d3672bd7ea4e7430cbb4e65bbb0afb69633536590b58b3c785d98db3d092b2732371f045853356172ded5253d2ad757a4c5b2c6cd4e
|
@@ -16,7 +16,7 @@ module Defcon
|
|
16
16
|
session[:admin_id] = admin.id
|
17
17
|
session[:admin_username] = admin.username
|
18
18
|
flash[:notice] = "Welcome back!"
|
19
|
-
|
19
|
+
send_away
|
20
20
|
else
|
21
21
|
if !admin.nil?
|
22
22
|
admin.attempts = admin.attempts + 1
|
@@ -53,11 +53,19 @@ module Defcon
|
|
53
53
|
def logged_out_check
|
54
54
|
if ::Defcon.logged_in?(session)
|
55
55
|
flash[:alert] = "You are already logged in."
|
56
|
-
|
56
|
+
send_away
|
57
57
|
return false
|
58
58
|
else
|
59
59
|
return true
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
def send_away
|
64
|
+
begin
|
65
|
+
redirect_to main_app.admin_root_path
|
66
|
+
rescue
|
67
|
+
redirect_to "/admin"
|
68
|
+
end
|
69
|
+
end
|
62
70
|
end
|
63
71
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title>Defcon</title>
|
4
|
+
<title>Defcon</title>
|
5
|
+
<%= stylesheet_link_tag "application", media: "all" %>
|
5
6
|
<%= stylesheet_link_tag "defcon/application", media: "all" %>
|
6
7
|
<%= javascript_include_tag "defcon/application" %>
|
7
8
|
<%= csrf_meta_tags %>
|
data/lib/defcon/version.rb
CHANGED
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20141009215910) do
|
15
15
|
|
16
16
|
create_table "defcon_admin_users", force: true do |t|
|
17
17
|
t.string "username"
|
@@ -23,8 +23,10 @@ ActiveRecord::Schema.define(version: 20141008214632) do
|
|
23
23
|
t.integer "priority"
|
24
24
|
t.datetime "created_at"
|
25
25
|
t.datetime "updated_at"
|
26
|
+
t.string "email"
|
26
27
|
end
|
27
28
|
|
29
|
+
add_index "defcon_admin_users", ["email"], name: "index_defcon_admin_users_on_email"
|
28
30
|
add_index "defcon_admin_users", ["username"], name: "index_defcon_admin_users_on_username"
|
29
31
|
|
30
32
|
end
|
@@ -2007,3 +2007,42 @@ Started GET "/assets/defcon/sessions.js?body=1" for 127.0.0.1 at 2014-10-09 10:4
|
|
2007
2007
|
|
2008
2008
|
|
2009
2009
|
Started GET "/assets/defcon/application.js?body=1" for 127.0.0.1 at 2014-10-09 10:46:02 -0400
|
2010
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2011
|
+
Migrating to AddEmailToAdminUsers (20141009215814)
|
2012
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2013
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "admin_users" ADD "email" varchar(255)[0m
|
2014
|
+
SQLite3::SQLException: no such table: admin_users: ALTER TABLE "admin_users" ADD "email" varchar(255)
|
2015
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2016
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2017
|
+
Migrating to AddEmailToDefconAdminUsers (20141009215910)
|
2018
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2019
|
+
[1m[36m (0.9ms)[0m [1mALTER TABLE "defcon_admin_users" ADD "email" varchar(255)[0m
|
2020
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
2021
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
2022
|
+
FROM sqlite_master
|
2023
|
+
WHERE name='index_defcon_admin_users_on_username' AND type='index'
|
2024
|
+
UNION ALL
|
2025
|
+
SELECT sql
|
2026
|
+
FROM sqlite_temp_master
|
2027
|
+
WHERE name='index_defcon_admin_users_on_username' AND type='index'
|
2028
|
+
[0m
|
2029
|
+
[1m[35m (0.2ms)[0m CREATE INDEX "index_defcon_admin_users_on_email" ON "defcon_admin_users" ("email")
|
2030
|
+
[1m[36mSQL (1.0ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141009215910"]]
|
2031
|
+
[1m[35m (209.6ms)[0m commit transaction
|
2032
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2033
|
+
[1m[35m (0.3ms)[0m SELECT sql
|
2034
|
+
FROM sqlite_master
|
2035
|
+
WHERE name='index_defcon_admin_users_on_email' AND type='index'
|
2036
|
+
UNION ALL
|
2037
|
+
SELECT sql
|
2038
|
+
FROM sqlite_temp_master
|
2039
|
+
WHERE name='index_defcon_admin_users_on_email' AND type='index'
|
2040
|
+
|
2041
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
2042
|
+
FROM sqlite_master
|
2043
|
+
WHERE name='index_defcon_admin_users_on_username' AND type='index'
|
2044
|
+
UNION ALL
|
2045
|
+
SELECT sql
|
2046
|
+
FROM sqlite_temp_master
|
2047
|
+
WHERE name='index_defcon_admin_users_on_username' AND type='index'
|
2048
|
+
[0m
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: defcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cleophus Robinson
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- config/routes.rb
|
78
78
|
- db/migrate/20141008173352_create_defcon_admin_users.rb
|
79
79
|
- db/migrate/20141008214632_add_index_to_defcon_admin_users.rb
|
80
|
+
- db/migrate/20141009215910_add_email_to_defcon_admin_users.rb
|
80
81
|
- lib/defcon.rb
|
81
82
|
- lib/defcon/engine.rb
|
82
83
|
- lib/defcon/version.rb
|