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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7da97f63d603ce5db996c3a9f67744916802a45c
4
- data.tar.gz: b44741bf9d9fde91b18469f1d574d169dfeb2791
3
+ metadata.gz: 3d62662dca4a0ced4108b7e0952184da77749f20
4
+ data.tar.gz: 3c55ff911616648ee9923851542b2183358e4204
5
5
  SHA512:
6
- metadata.gz: 5e08759bcad1eeb18c34cb57074f266c1e350f46bf7dfb0d0afcc07ec47f82a6399d336d7e64563a7fda0db364e1670582be1dd5edcf14ab21cf558401c87ca2
7
- data.tar.gz: eb51a764a7089e2d7c4886d536b44d2a7a97d3ed2582ad17872cffdecc902498948967b96743d7f3228bcdeaade81ce422d3a8e117b13514c07f954e77581570
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
- redirect_to "/admin"
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
- redirect_to "/admin"
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
@@ -2,6 +2,7 @@
2
2
  <html>
3
3
  <head>
4
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 %>
@@ -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 %>
@@ -0,0 +1,6 @@
1
+ class AddEmailToDefconAdminUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :defcon_admin_users, :email, :string
4
+ add_index :defcon_admin_users, :email
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Defcon
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.5"
3
3
  end
@@ -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: 20141008214632) do
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
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2011
+ Migrating to AddEmailToAdminUsers (20141009215814)
2012
+  (0.1ms) begin transaction
2013
+  (0.2ms) ALTER TABLE "admin_users" ADD "email" varchar(255)
2014
+ SQLite3::SQLException: no such table: admin_users: ALTER TABLE "admin_users" ADD "email" varchar(255)
2015
+  (0.1ms) rollback transaction
2016
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2017
+ Migrating to AddEmailToDefconAdminUsers (20141009215910)
2018
+  (0.1ms) begin transaction
2019
+  (0.9ms) ALTER TABLE "defcon_admin_users" ADD "email" varchar(255)
2020
+  (0.1ms) select sqlite_version(*)
2021
+  (0.1ms)  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
+ 
2029
+  (0.2ms) CREATE INDEX "index_defcon_admin_users_on_email" ON "defcon_admin_users" ("email")
2030
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141009215910"]]
2031
+  (209.6ms) commit transaction
2032
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2033
+  (0.3ms) 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
+  (0.1ms)  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
+ 
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.2
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