geri 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +26 -0
- data/app/assets/javascripts/geri/admin.js +33 -0
- data/app/assets/javascripts/geri/admin/app.js +758 -0
- data/app/assets/javascripts/geri/admin/editor.js +56 -0
- data/app/assets/javascripts/geri/admin/password_resets.js +2 -0
- data/app/assets/stylesheets/geri/admin.css.less +60 -0
- data/app/assets/stylesheets/geri/admin/app.css +4915 -0
- data/app/assets/stylesheets/geri/admin/ckeditor/contents.css +135 -0
- data/app/assets/stylesheets/geri/admin/editor.css.less +38 -0
- data/app/assets/stylesheets/geri/admin/password_resets.css +4 -0
- data/app/assets/stylesheets/geri/admin/skin-blue.less +142 -0
- data/app/assets/vendor/ckeditor/CHANGES.md +1065 -0
- data/app/assets/vendor/ckeditor/LICENSE.md +1420 -0
- data/app/assets/vendor/ckeditor/README.md +39 -0
- data/app/assets/vendor/ckeditor/adapters/jquery.js +10 -0
- data/app/assets/vendor/ckeditor/build-config.js +69 -0
- data/app/assets/vendor/ckeditor/ckeditor.js +775 -0
- data/app/assets/vendor/ckeditor/config.js +34 -0
- data/app/assets/vendor/ckeditor/contents.css +135 -0
- data/app/assets/vendor/ckeditor/lang/en.js +5 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/about.js +7 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/clipboard/dialogs/paste.js +12 -0
- data/app/assets/vendor/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/app/assets/vendor/ckeditor/plugins/icons.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/icons_hidpi.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/link/dialogs/anchor.js +7 -0
- data/app/assets/vendor/ckeditor/plugins/link/dialogs/link.js +26 -0
- data/app/assets/vendor/ckeditor/plugins/link/images/anchor.png +0 -0
- data/app/assets/vendor/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/app/assets/vendor/ckeditor/samples/css/samples.css +1640 -0
- data/app/assets/vendor/ckeditor/samples/img/github-top.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/header-bg.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/header-separator.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/logo.png +0 -0
- data/app/assets/vendor/ckeditor/samples/img/navigation-tip.png +0 -0
- data/app/assets/vendor/ckeditor/samples/index.html +128 -0
- data/app/assets/vendor/ckeditor/samples/js/sample.js +53 -0
- data/app/assets/vendor/ckeditor/samples/js/sf.js +17 -0
- data/app/assets/vendor/ckeditor/samples/old/ajax.html +85 -0
- data/app/assets/vendor/ckeditor/samples/old/api.html +210 -0
- data/app/assets/vendor/ckeditor/samples/old/appendto.html +59 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/posteddata.php +59 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/sample.jpg +0 -0
- data/app/assets/vendor/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- data/app/assets/vendor/ckeditor/samples/old/datafiltering.html +508 -0
- data/app/assets/vendor/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- data/app/assets/vendor/ckeditor/samples/old/dialog/dialog.html +190 -0
- data/app/assets/vendor/ckeditor/samples/old/divreplace.html +144 -0
- data/app/assets/vendor/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- data/app/assets/vendor/ckeditor/samples/old/index.html +122 -0
- data/app/assets/vendor/ckeditor/samples/old/inlineall.html +314 -0
- data/app/assets/vendor/ckeditor/samples/old/inlinebycode.html +124 -0
- data/app/assets/vendor/ckeditor/samples/old/inlinetextarea.html +113 -0
- data/app/assets/vendor/ckeditor/samples/old/jquery.html +103 -0
- data/app/assets/vendor/ckeditor/samples/old/readonly.html +76 -0
- data/app/assets/vendor/ckeditor/samples/old/replacebyclass.html +60 -0
- data/app/assets/vendor/ckeditor/samples/old/replacebycode.html +59 -0
- data/app/assets/vendor/ckeditor/samples/old/sample.css +357 -0
- data/app/assets/vendor/ckeditor/samples/old/sample.js +50 -0
- data/app/assets/vendor/ckeditor/samples/old/sample_posteddata.php +16 -0
- data/app/assets/vendor/ckeditor/samples/old/tabindex.html +78 -0
- data/app/assets/vendor/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- data/app/assets/vendor/ckeditor/samples/old/uicolor.html +72 -0
- data/app/assets/vendor/ckeditor/samples/old/uilanguages.html +122 -0
- data/app/assets/vendor/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- data/app/assets/vendor/ckeditor/samples/old/xhtmlstyle.html +234 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/index.html +446 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +19 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +325 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +38 -0
- data/app/assets/vendor/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie7.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_ie8.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_iequirks.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/dialog_opera.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_gecko.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie7.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_ie8.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/editor_iequirks.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/icons.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/icons_hidpi.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/arrow.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/close.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/close.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/lock-open.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/lock.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/hidpi/refresh.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/lock-open.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/lock.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/images/refresh.png +0 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/readme.md +35 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/bootstrapck-sample.html +127 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/css/bootstrapck-sample.css +1 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/js/analytics.js +4 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/sample/js/jquery-1.11.0.min.js +189 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/gecko/editor_gecko.scss +25 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie/dialog_ie.scss +62 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie/editor_ie.scss +71 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie7/dialog_ie7.scss +68 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie7/editor_ie7.scss +213 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie8/dialog_ie8.scss +24 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/ie8/editor_ie8.scss +27 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/iequirks/dialog_iequirks.scss +21 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/iequirks/editor_iequirks.scss +79 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/browser-specific/opera/dialog_opera.scss +31 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_colorpanel.scss +119 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_elementspath.scss +66 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_mainui.scss +189 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_menu.scss +182 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_panel.scss +199 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_presets.scss +32 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_reset.scss +107 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_richcombo.scss +174 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/_toolbar.scss +317 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/components/editor.scss +66 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_colors.scss +61 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_config.scss +9 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/config/_defaults.scss +37 -0
- data/app/assets/vendor/ckeditor/skins/bootstrapck/scss/dialog/dialog.scss +822 -0
- data/app/assets/vendor/ckeditor/styles.js +111 -0
- data/app/controllers/geri/admin/admin_users_controller.rb +56 -0
- data/app/controllers/geri/admin/dashboard_controller.rb +8 -0
- data/app/controllers/geri/admin/editor_controller.rb +33 -0
- data/app/controllers/geri/admin/password_resets_controller.rb +21 -0
- data/app/controllers/geri/admin/sessions_controller.rb +24 -0
- data/app/controllers/geri/admin_controller.rb +19 -0
- data/app/controllers/geri/application_controller.rb +5 -0
- data/app/controllers/geri/pages_controller.rb +34 -0
- data/app/helpers/geri/admin/dashboard_helper.rb +4 -0
- data/app/helpers/geri/admin/editor_helper.rb +4 -0
- data/app/helpers/geri/admin/pages_helper.rb +45 -0
- data/app/helpers/geri/admin/partials_helper.rb +4 -0
- data/app/helpers/geri/admin/password_resets_helper.rb +4 -0
- data/app/helpers/geri/admin/sessions_helper.rb +4 -0
- data/app/helpers/geri/admin_helper.rb +24 -0
- data/app/helpers/geri/admin_users_helper.rb +4 -0
- data/app/helpers/geri/application_helper.rb +26 -0
- data/app/helpers/geri/meta_helper.rb +32 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/mailers/geri/admin_user_mailer.rb +11 -0
- data/app/models/geri/admin_user.rb +14 -0
- data/app/models/geri/content.rb +6 -0
- data/app/models/geri/password_reset.rb +17 -0
- data/app/models/geri/session.rb +20 -0
- data/app/views/geri/admin/admin_users/_form.html.erb +5 -0
- data/app/views/geri/admin/admin_users/edit.html.erb +27 -0
- data/app/views/geri/admin/admin_users/index.html.erb +45 -0
- data/app/views/geri/admin/admin_users/new.html.erb +17 -0
- data/app/views/geri/admin/dashboard/index.html.erb +1 -0
- data/app/views/geri/admin/editor/template.html.erb +17 -0
- data/app/views/geri/admin/password_resets/new.html.erb +17 -0
- data/app/views/geri/admin/sessions/new.html.erb +23 -0
- data/app/views/geri/admin/shared/_aside.html.erb +16 -0
- data/app/views/geri/admin/shared/_header.html.erb +31 -0
- data/app/views/geri/admin/shared/_menu_item.html.erb +17 -0
- data/app/views/geri/admin_user_mailer/reset_password_email.text.erb +7 -0
- data/app/views/layouts/geri/admin.html.erb +24 -0
- data/app/views/layouts/geri/admin/sessions.html.erb +21 -0
- data/app/views/layouts/mailer.html.erb +5 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/config/initializers/geri.rb +7 -0
- data/config/initializers/sorcery.rb +463 -0
- data/config/locales/devise.en.yml +62 -0
- data/config/locales/en.yml +13 -0
- data/config/routes.rb +23 -0
- data/db/migrate/20160409151523_create_geri_contents.rb +8 -0
- data/db/migrate/20160411205412_sorcery_core.rb +20 -0
- data/lib/generators/geri/install/USAGE +8 -0
- data/lib/generators/geri/install/install_generator.rb +54 -0
- data/lib/generators/geri/install/templates/bower.json +8 -0
- data/lib/generators/geri/install/templates/index.html.erb +46 -0
- data/lib/generators/geri/install/templates/initializer.rb +12 -0
- data/lib/generators/geri/install/templates/layout.html.erb +11 -0
- data/lib/generators/geri/install/templates/site.css.less +1 -0
- data/lib/generators/geri/install/templates/site.js +1 -0
- data/lib/geri.rb +7 -0
- data/lib/geri/cli.rb +6 -0
- data/lib/geri/cli/base.rb +23 -0
- data/lib/geri/cli/extension.rb +18 -0
- data/lib/geri/config.rb +29 -0
- data/lib/geri/config/menu_item.rb +35 -0
- data/lib/geri/engine.rb +34 -0
- data/lib/geri/tasks.rb +3 -0
- data/lib/geri/tasks/create_admin_user.rb +40 -0
- data/lib/geri/version.rb +3 -0
- data/lib/tasks/geri_tasks.rake +15 -0
- metadata +449 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
module Geri
|
2
|
+
module MetaHelper
|
3
|
+
attr_reader :page_title
|
4
|
+
|
5
|
+
def title(text)
|
6
|
+
@page_title = text
|
7
|
+
end
|
8
|
+
|
9
|
+
def description(text)
|
10
|
+
meta description: text
|
11
|
+
end
|
12
|
+
|
13
|
+
def keywords(*keywords)
|
14
|
+
meta keywords: keywords
|
15
|
+
end
|
16
|
+
|
17
|
+
def meta(options=nil)
|
18
|
+
@meta ||= {}
|
19
|
+
@meta.reverse_merge!(options) if options
|
20
|
+
@meta
|
21
|
+
end
|
22
|
+
|
23
|
+
def meta_tags
|
24
|
+
html = ''.html_safe
|
25
|
+
meta.each do |name, content|
|
26
|
+
html << content_tag(:meta, '', name: name, content: (content.is_a?(Array) ? content.join(', ') : content))
|
27
|
+
end
|
28
|
+
html
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Geri
|
2
|
+
class AdminUserMailer < ApplicationMailer
|
3
|
+
|
4
|
+
def reset_password_email(admin_user)
|
5
|
+
@admin_user = admin_user
|
6
|
+
@url = admin_edit_reset_password_url(admin_user.reset_password_token)
|
7
|
+
mail to: admin_user.email, subject: "#{Geri::Config.site_name}: Password Reset"
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'email_validator'
|
2
|
+
module Geri
|
3
|
+
class AdminUser < ActiveRecord::Base
|
4
|
+
authenticates_with_sorcery!
|
5
|
+
|
6
|
+
attr_accessor :validate_password
|
7
|
+
|
8
|
+
validates :email, presence: true, uniqueness: true, email: true
|
9
|
+
validates :password, presence: { if: :validate_password }, confirmation: true, length: { within: (5..20), allow_blank: true }
|
10
|
+
validates :first_name, presence: true
|
11
|
+
validates :last_name, presence: true
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Geri
|
2
|
+
class PasswordReset
|
3
|
+
extend ActiveModel::Naming
|
4
|
+
include ActiveModel::Conversion
|
5
|
+
include ActiveModel::Validations
|
6
|
+
|
7
|
+
attr_reader :email
|
8
|
+
|
9
|
+
def initialize(options={})
|
10
|
+
@email = options[:email]
|
11
|
+
end
|
12
|
+
|
13
|
+
def persisted?
|
14
|
+
false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Geri
|
2
|
+
# Simple class to allow use of form for
|
3
|
+
class Session
|
4
|
+
extend ActiveModel::Naming
|
5
|
+
include ActiveModel::Conversion
|
6
|
+
include ActiveModel::Validations
|
7
|
+
|
8
|
+
attr_reader :email, :password
|
9
|
+
|
10
|
+
def initialize(options={})
|
11
|
+
@email = options[:email]
|
12
|
+
@password = options[:password]
|
13
|
+
end
|
14
|
+
|
15
|
+
def persisted?
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<section class="content-header">
|
2
|
+
<h1>Edit Admin User - <%= @admin_user.email %></h1>
|
3
|
+
</section>
|
4
|
+
<section class="content">
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-xs-12">
|
7
|
+
<div class="box box-primary">
|
8
|
+
<div class="box-body">
|
9
|
+
<%= bootstrap_form_for @admin_user, url: admin_admin_user_path(@admin_user) do |f| %>
|
10
|
+
<%= render partial: 'form', locals: { f: f } %>
|
11
|
+
<% if current_user == @admin_user %>
|
12
|
+
<div class="row">
|
13
|
+
<div class="col-xs-6">
|
14
|
+
<%= f.password_field :password %>
|
15
|
+
</div>
|
16
|
+
<div class="col-xs-6">
|
17
|
+
<%= f.password_field :password_confirmation, label: 'Password Confirmation' %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<%= f.submit 'Update', class: 'btn btn-primary pull-right' %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</section>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<section class="content-header">
|
2
|
+
<h1>Admin Users</h1>
|
3
|
+
</section>
|
4
|
+
<section class="content">
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-xs-12">
|
7
|
+
<div class="box box-primary">
|
8
|
+
<div class="box-header with-border">
|
9
|
+
<%= link_to 'Create Admin User', new_admin_admin_user_url, class: 'btn btn-primary pull-right' %>
|
10
|
+
</div>
|
11
|
+
<div class="box-body">
|
12
|
+
<table class="table table-hover">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th>Email</th>
|
16
|
+
<th>First Name</th>
|
17
|
+
<th>Last Name</th>
|
18
|
+
<th>Created At</th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<% @admin_users.each do |user| %>
|
23
|
+
<tr>
|
24
|
+
<td><%= user.email %></td>
|
25
|
+
<th><%= user.first_name %></th>
|
26
|
+
<th><%= user.last_name %></th>
|
27
|
+
<td><%= time_ago_in_words(user.created_at) %> ago</td>
|
28
|
+
<td>
|
29
|
+
<%= link_to 'Edit', edit_admin_admin_user_path(user), class: 'btn btn-success' %>
|
30
|
+
<% unless current_user == user %>
|
31
|
+
<%= link_to 'Reset Password', '', class: 'btn btn-warning' %>
|
32
|
+
<%= link_to 'Delete', admin_admin_user_path(user),
|
33
|
+
class: 'btn btn-danger',
|
34
|
+
method: :delete, data: { confirm: "Are you sure you want to delete user '#{user.email}'?" } %>
|
35
|
+
<% end %>
|
36
|
+
</td>
|
37
|
+
</tr>
|
38
|
+
<% end %>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</section>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<section class="content-header">
|
2
|
+
<h1>New Admin User</h1>
|
3
|
+
</section>
|
4
|
+
<section class="content">
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-xs-12">
|
7
|
+
<div class="box box-primary">
|
8
|
+
<div class="box-body">
|
9
|
+
<%= bootstrap_form_for @admin_user, url: admin_admin_users_path do |f| %>
|
10
|
+
<%= render partial: 'form', locals: { f: f } %>
|
11
|
+
<%= f.submit 'Create', class: 'btn btn-primary pull-right' %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</section>
|
@@ -0,0 +1 @@
|
|
1
|
+
INDEX
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="geri-editor">
|
2
|
+
<div class="skin-blue">
|
3
|
+
<header class="main-header">
|
4
|
+
<nav class="navbar navbar-default navbar-fixed-top">
|
5
|
+
<div class="container">
|
6
|
+
<%= link_to admin_root_url, class: 'navbar-brand' do %>
|
7
|
+
<b>Geri</b>CMS:<b>EDITOR</b>
|
8
|
+
<% end %>
|
9
|
+
<ul class="nav navbar-nav navbar-right">
|
10
|
+
<li><a id="geri-editor-save" class="btn btn-success disabled navbar-btn editor-link" href="">Save Changes</a></li>
|
11
|
+
<li><a id="geri-editor-revert" class="btn btn-danger disabled navbar-btn editor-link" href="">Revert</a></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
</nav>
|
15
|
+
</header>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= flash_alert %>
|
2
|
+
<p class="login-box-msg">Enter your email to reset your password</p>
|
3
|
+
<div class="row">
|
4
|
+
<div class="col-xs-12">
|
5
|
+
<%= bootstrap_form_for @password_reset, url: admin_password_resets_path do |f| %>
|
6
|
+
<%= f.email_field :email, hide_label: true, class: 'form-control', placeholder: 'Email' %>
|
7
|
+
<div class="row">
|
8
|
+
<div class="col-xs-6">
|
9
|
+
<%= link_to '<< Return to Login', admin_login_url %>
|
10
|
+
</div>
|
11
|
+
<div class="col-xs-6">
|
12
|
+
<%= f.submit 'Reset', class: 'btn btn-primary pull-right' %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% if flash[:danger] %>
|
2
|
+
<p class="login-box-msg text-danger">
|
3
|
+
<%= flash[:danger] %>
|
4
|
+
</p>
|
5
|
+
<% else %>
|
6
|
+
<p class="login-box-msg">Login to access the admin</p>
|
7
|
+
<% end %>
|
8
|
+
<div class="row">
|
9
|
+
<div class="col-xs-12">
|
10
|
+
<%= bootstrap_form_for @session, url: admin_sessions_path do |f| %>
|
11
|
+
<%= f.email_field :email, hide_label: true, class: 'form-control', placeholder: 'Email' %>
|
12
|
+
<%= f.password_field :password, hide_label: true, class: 'form-control', placeholder: 'Password' %>
|
13
|
+
<div class="row">
|
14
|
+
<div class="col-xs-6">
|
15
|
+
<%= link_to 'Forgot Password >>', new_admin_password_reset_url %>
|
16
|
+
</div>
|
17
|
+
<div class="col-xs-6">
|
18
|
+
<%= f.submit 'Login', class: 'btn btn-primary pull-right' %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<aside class="main-sidebar">
|
2
|
+
<!-- sidebar: style can be found in sidebar.less -->
|
3
|
+
<section class="sidebar">
|
4
|
+
<!-- Sidebar user panel -->
|
5
|
+
<div class="user-panel">
|
6
|
+
<div class="pull-left info">
|
7
|
+
<p><%= current_user.email %></p>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<ul class="sidebar-menu">
|
11
|
+
<li class="header"><%= t('admin.aside.main_navigation') %></li>
|
12
|
+
<%= render @menu_items %>
|
13
|
+
</ul>
|
14
|
+
</section>
|
15
|
+
<!-- /.sidebar -->
|
16
|
+
</aside>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<header class="main-header">
|
2
|
+
<!-- Logo -->
|
3
|
+
<%= link_to Geri::Config.admin_path, class: 'logo' do %>
|
4
|
+
<!-- mini logo for sidebar mini 50x50 pixels -->
|
5
|
+
<span class="logo-mini">gCMS</span>
|
6
|
+
<!-- logo for regular state and mobile devices -->
|
7
|
+
<span class="logo-lg"><b>Geri</b>CMS</span>
|
8
|
+
<% end %>
|
9
|
+
<!-- Header Navbar: style can be found in header.less -->
|
10
|
+
<nav class="navbar navbar-static-top">
|
11
|
+
<!-- Sidebar toggle button-->
|
12
|
+
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"></a>
|
13
|
+
<div class="navbar-custom-menu">
|
14
|
+
<ul class="nav navbar-nav">
|
15
|
+
<li class="dropdown user user-menu">
|
16
|
+
<a class="dropdown-toggle" data-toggle="dropdown">
|
17
|
+
<span><%= current_user.first_name.capitalize %> <%= current_user.last_name.capitalize %></span>
|
18
|
+
</a>
|
19
|
+
<ul class="dropdown-menu">
|
20
|
+
<li>
|
21
|
+
<%= link_to 'Profile', edit_admin_admin_user_url(current_user) %>
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
<%= link_to 'Logout', admin_logout_url, method: :delete %>
|
25
|
+
</li>
|
26
|
+
</ul>
|
27
|
+
</li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
30
|
+
</nav>
|
31
|
+
</header>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if menu_item.is_parent %>
|
2
|
+
<li class="treeview">
|
3
|
+
<a href="#">
|
4
|
+
<% if menu_item.icon %>
|
5
|
+
<i class="fa fa-<%= menu_item.icon %>"></i>
|
6
|
+
<% end %>
|
7
|
+
<span><%= menu_item.title %></span>
|
8
|
+
</a>
|
9
|
+
<ul class="treeview-menu">
|
10
|
+
<% menu_item.menu_items.each do |i| %>
|
11
|
+
<%= sidebar_link(t("admin.menu.#{i.title.gsub(' ', '').underscore}", default: i.title), i.path, i.icon || nil) %>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
</li>
|
15
|
+
<% else %>
|
16
|
+
<%= sidebar_link(t("admin.menu.#{menu_item.title.gsub(' ', '').underscore}", default: menu_item.title), menu_item.path, menu_item.icon || nil) %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Hello, <%= @admin_user.first_name %>,
|
2
|
+
|
3
|
+
You are receiving this email because someone requested your password be reset. If you did not make this request simply
|
4
|
+
ignore this email. Otherwise follow this link: <%= @url %>
|
5
|
+
|
6
|
+
Sincerely,
|
7
|
+
<%= Geri::Config.site_name %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Geri</title>
|
5
|
+
<%= stylesheet_link_tag 'geri/admin', media: 'all' %>
|
6
|
+
<%= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css' %>
|
7
|
+
<%= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css' %>
|
8
|
+
<%= csrf_meta_tags %>
|
9
|
+
</head>
|
10
|
+
<body class="hold-transition skin-blue sidebar-mini">
|
11
|
+
<div class="wrapper">
|
12
|
+
<%= render 'geri/admin/shared/header' %>
|
13
|
+
<!-- Left side column. contains the logo and sidebar -->
|
14
|
+
<%= render 'geri/admin/shared/aside' %>
|
15
|
+
|
16
|
+
<!-- Content Wrapper. Contains page content -->
|
17
|
+
<div class="content-wrapper">
|
18
|
+
<%= flash_alert %>
|
19
|
+
<%= yield %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<%= javascript_include_tag 'geri/admin' %>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Geri</title>
|
5
|
+
<%= stylesheet_link_tag 'geri/admin', media: 'all' %>
|
6
|
+
<%= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css' %>
|
7
|
+
<%= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css' %>
|
8
|
+
<%= csrf_meta_tags %>
|
9
|
+
</head>
|
10
|
+
<body class="hold-transition skin-blue login-page">
|
11
|
+
<div class="login-box">
|
12
|
+
<div class="login-logo">
|
13
|
+
<b>Geri</b>CMS
|
14
|
+
</div>
|
15
|
+
<div class="login-box-body">
|
16
|
+
<%= yield %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<%= javascript_include_tag 'geri/admin' %>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add admin assets to pipeline
|
2
|
+
|
3
|
+
Geri::Config.configure do |c|
|
4
|
+
c.register_menu_item('Dashboard', '', icon: :dashboard, priority: -9999)
|
5
|
+
c.register_menu_item('Edit Site', '/edit', icon: 'files-o')
|
6
|
+
c.register_menu_item('Admin Users', '/admin_users', icon: 'users', priority: 9999)
|
7
|
+
end
|
@@ -0,0 +1,463 @@
|
|
1
|
+
# The first thing you need to configure is which modules you need in your app.
|
2
|
+
# The default is nothing which will include only core features (password encryption, login/logout).
|
3
|
+
# Available submodules are: :user_activation, :http_basic_auth, :remember_me,
|
4
|
+
# :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external
|
5
|
+
Rails.application.config.sorcery.submodules = [:reset_password]
|
6
|
+
|
7
|
+
# Here you can configure each submodule's features.
|
8
|
+
Rails.application.config.sorcery.configure do |config|
|
9
|
+
# -- core --
|
10
|
+
# What controller action to call for non-authenticated users. You can also
|
11
|
+
# override the 'not_authenticated' method of course.
|
12
|
+
# Default: `:not_authenticated`
|
13
|
+
#
|
14
|
+
# config.not_authenticated_action =
|
15
|
+
|
16
|
+
|
17
|
+
# When a non logged in user tries to enter a page that requires login, save
|
18
|
+
# the URL he wanted to reach, and send him there after login, using 'redirect_back_or_to'.
|
19
|
+
# Default: `true`
|
20
|
+
#
|
21
|
+
# config.save_return_to_url =
|
22
|
+
|
23
|
+
|
24
|
+
# Set domain option for cookies; Useful for remember_me submodule.
|
25
|
+
# Default: `nil`
|
26
|
+
#
|
27
|
+
# config.cookie_domain =
|
28
|
+
|
29
|
+
|
30
|
+
# Allow the remember_me cookie to be set through AJAX
|
31
|
+
# Default: `true`
|
32
|
+
#
|
33
|
+
# config.remember_me_httponly =
|
34
|
+
|
35
|
+
|
36
|
+
# -- session timeout --
|
37
|
+
# How long in seconds to keep the session alive.
|
38
|
+
# Default: `3600`
|
39
|
+
#
|
40
|
+
# config.session_timeout =
|
41
|
+
|
42
|
+
|
43
|
+
# Use the last action as the beginning of session timeout.
|
44
|
+
# Default: `false`
|
45
|
+
#
|
46
|
+
# config.session_timeout_from_last_action =
|
47
|
+
|
48
|
+
|
49
|
+
# -- http_basic_auth --
|
50
|
+
# What realm to display for which controller name. For example {"My App" => "Application"}
|
51
|
+
# Default: `{"application" => "Application"}`
|
52
|
+
#
|
53
|
+
# config.controller_to_realm_map =
|
54
|
+
|
55
|
+
|
56
|
+
# -- activity logging --
|
57
|
+
# will register the time of last user login, every login.
|
58
|
+
# Default: `true`
|
59
|
+
#
|
60
|
+
# config.register_login_time =
|
61
|
+
|
62
|
+
|
63
|
+
# will register the time of last user logout, every logout.
|
64
|
+
# Default: `true`
|
65
|
+
#
|
66
|
+
# config.register_logout_time =
|
67
|
+
|
68
|
+
|
69
|
+
# will register the time of last user action, every action.
|
70
|
+
# Default: `true`
|
71
|
+
#
|
72
|
+
# config.register_last_activity_time =
|
73
|
+
|
74
|
+
|
75
|
+
# -- external --
|
76
|
+
# What providers are supported by this app, i.e. [:twitter, :facebook, :github, :linkedin, :xing, :google, :liveid, :salesforce] .
|
77
|
+
# Default: `[]`
|
78
|
+
#
|
79
|
+
# config.external_providers =
|
80
|
+
|
81
|
+
|
82
|
+
# You can change it by your local ca_file. i.e. '/etc/pki/tls/certs/ca-bundle.crt'
|
83
|
+
# Path to ca_file. By default use a internal ca-bundle.crt.
|
84
|
+
# Default: `'path/to/ca_file'`
|
85
|
+
#
|
86
|
+
# config.ca_file =
|
87
|
+
|
88
|
+
|
89
|
+
# For information about LinkedIn API:
|
90
|
+
# - user info fields go to https://developer.linkedin.com/documents/profile-fields
|
91
|
+
# - access permissions go to https://developer.linkedin.com/documents/authentication#granting
|
92
|
+
#
|
93
|
+
# config.linkedin.key = ""
|
94
|
+
# config.linkedin.secret = ""
|
95
|
+
# config.linkedin.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=linkedin"
|
96
|
+
# config.linkedin.user_info_fields = ['first-name', 'last-name']
|
97
|
+
# config.linkedin.user_info_mapping = {first_name: "firstName", last_name: "lastName"}
|
98
|
+
# config.linkedin.access_permissions = ['r_basicprofile']
|
99
|
+
#
|
100
|
+
#
|
101
|
+
# For information about XING API:
|
102
|
+
# - user info fields go to https://dev.xing.com/docs/get/users/me
|
103
|
+
#
|
104
|
+
# config.xing.key = ""
|
105
|
+
# config.xing.secret = ""
|
106
|
+
# config.xing.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=xing"
|
107
|
+
# config.xing.user_info_mapping = {first_name: "first_name", last_name: "last_name"}
|
108
|
+
#
|
109
|
+
#
|
110
|
+
# Twitter will not accept any requests nor redirect uri containing localhost,
|
111
|
+
# make sure you use 0.0.0.0:3000 to access your app in development
|
112
|
+
#
|
113
|
+
# config.twitter.key = ""
|
114
|
+
# config.twitter.secret = ""
|
115
|
+
# config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
|
116
|
+
# config.twitter.user_info_mapping = {:email => "screen_name"}
|
117
|
+
#
|
118
|
+
# config.facebook.key = ""
|
119
|
+
# config.facebook.secret = ""
|
120
|
+
# config.facebook.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=facebook"
|
121
|
+
# config.facebook.user_info_mapping = {:email => "name"}
|
122
|
+
# config.facebook.access_permissions = ["email", "publish_actions"]
|
123
|
+
# config.facebook.display = "page"
|
124
|
+
# config.facebook.api_version = "v2.2"
|
125
|
+
#
|
126
|
+
# config.github.key = ""
|
127
|
+
# config.github.secret = ""
|
128
|
+
# config.github.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=github"
|
129
|
+
# config.github.user_info_mapping = {:email => "name"}
|
130
|
+
#
|
131
|
+
# config.google.key = ""
|
132
|
+
# config.google.secret = ""
|
133
|
+
# config.google.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=google"
|
134
|
+
# config.google.user_info_mapping = {:email => "email", :username => "name"}
|
135
|
+
#
|
136
|
+
# config.vk.key = ""
|
137
|
+
# config.vk.secret = ""
|
138
|
+
# config.vk.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=vk"
|
139
|
+
# config.vk.user_info_mapping = {:login => "domain", :name => "full_name"}
|
140
|
+
#
|
141
|
+
# To use liveid in development mode you have to replace mydomain.com with
|
142
|
+
# a valid domain even in development. To use a valid domain in development
|
143
|
+
# simply add your domain in your /etc/hosts file in front of 127.0.0.1
|
144
|
+
#
|
145
|
+
# config.liveid.key = ""
|
146
|
+
# config.liveid.secret = ""
|
147
|
+
# config.liveid.callback_url = "http://mydomain.com:3000/oauth/callback?provider=liveid"
|
148
|
+
# config.liveid.user_info_mapping = {:username => "name"}
|
149
|
+
|
150
|
+
# For information about JIRA API:
|
151
|
+
# https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+OAuth+authentication
|
152
|
+
# to obtain the consumer key and the public key you can use the jira-ruby gem https://github.com/sumoheavy/jira-ruby
|
153
|
+
# or run openssl req -x509 -nodes -newkey rsa:1024 -sha1 -keyout rsakey.pem -out rsacert.pem to obtain the public key
|
154
|
+
# Make sure you have configured the application link properly
|
155
|
+
|
156
|
+
# config.jira.key = "1234567"
|
157
|
+
# config.jira.secret = "jiraTest"
|
158
|
+
# config.jira.site = "http://localhost:2990/jira/plugins/servlet/oauth"
|
159
|
+
# config.jira.signature_method = "RSA-SHA1"
|
160
|
+
# config.jira.private_key_file = "rsakey.pem"
|
161
|
+
|
162
|
+
# For information about Salesforce API:
|
163
|
+
# https://developer.salesforce.com/signup &
|
164
|
+
# https://www.salesforce.com/us/developer/docs/api_rest/
|
165
|
+
# Salesforce callback_url must be https. You can run the following to generate self-signed ssl cert
|
166
|
+
# openssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -keyout server.key -out server.crt
|
167
|
+
# Make sure you have configured the application link properly
|
168
|
+
# config.salesforce.key = '123123'
|
169
|
+
# config.salesforce.secret = 'acb123'
|
170
|
+
# config.salesforce.callback_url = "https://127.0.0.1:9292/oauth/callback?provider=salesforce"
|
171
|
+
# config.salesforce.scope = "full"
|
172
|
+
# config.salesforce.user_info_mapping = {:email => "email"}
|
173
|
+
|
174
|
+
# --- user config ---
|
175
|
+
config.user_config do |user|
|
176
|
+
# -- core --
|
177
|
+
# specify username attributes, for example: [:username, :email].
|
178
|
+
# Default: `[:email]`
|
179
|
+
#
|
180
|
+
# user.username_attribute_names =
|
181
|
+
|
182
|
+
|
183
|
+
# change *virtual* password attribute, the one which is used until an encrypted one is generated.
|
184
|
+
# Default: `:password`
|
185
|
+
#
|
186
|
+
# user.password_attribute_name =
|
187
|
+
|
188
|
+
|
189
|
+
# downcase the username before trying to authenticate, default is false
|
190
|
+
# Default: `false`
|
191
|
+
#
|
192
|
+
# user.downcase_username_before_authenticating =
|
193
|
+
|
194
|
+
|
195
|
+
# change default email attribute.
|
196
|
+
# Default: `:email`
|
197
|
+
#
|
198
|
+
# user.email_attribute_name =
|
199
|
+
|
200
|
+
|
201
|
+
# change default crypted_password attribute.
|
202
|
+
# Default: `:crypted_password`
|
203
|
+
#
|
204
|
+
# user.crypted_password_attribute_name =
|
205
|
+
|
206
|
+
|
207
|
+
# what pattern to use to join the password with the salt
|
208
|
+
# Default: `""`
|
209
|
+
#
|
210
|
+
# user.salt_join_token =
|
211
|
+
|
212
|
+
|
213
|
+
# change default salt attribute.
|
214
|
+
# Default: `:salt`
|
215
|
+
#
|
216
|
+
# user.salt_attribute_name =
|
217
|
+
|
218
|
+
|
219
|
+
# how many times to apply encryption to the password.
|
220
|
+
# Default: `nil`
|
221
|
+
#
|
222
|
+
# user.stretches =
|
223
|
+
|
224
|
+
|
225
|
+
# encryption key used to encrypt reversible encryptions such as AES256.
|
226
|
+
# WARNING: If used for users' passwords, changing this key will leave passwords undecryptable!
|
227
|
+
# Default: `nil`
|
228
|
+
#
|
229
|
+
# user.encryption_key =
|
230
|
+
|
231
|
+
|
232
|
+
# use an external encryption class.
|
233
|
+
# Default: `nil`
|
234
|
+
#
|
235
|
+
# user.custom_encryption_provider =
|
236
|
+
|
237
|
+
|
238
|
+
# encryption algorithm name. See 'encryption_algorithm=' for available options.
|
239
|
+
# Default: `:bcrypt`
|
240
|
+
#
|
241
|
+
# user.encryption_algorithm =
|
242
|
+
|
243
|
+
|
244
|
+
# make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
|
245
|
+
# Default: `false`
|
246
|
+
#
|
247
|
+
# user.subclasses_inherit_config =
|
248
|
+
|
249
|
+
|
250
|
+
# -- remember_me --
|
251
|
+
# How long in seconds the session length will be
|
252
|
+
# Default: `604800`
|
253
|
+
#
|
254
|
+
# user.remember_me_for =
|
255
|
+
|
256
|
+
|
257
|
+
# -- user_activation --
|
258
|
+
# the attribute name to hold activation state (active/pending).
|
259
|
+
# Default: `:activation_state`
|
260
|
+
#
|
261
|
+
# user.activation_state_attribute_name =
|
262
|
+
|
263
|
+
|
264
|
+
# the attribute name to hold activation code (sent by email).
|
265
|
+
# Default: `:activation_token`
|
266
|
+
#
|
267
|
+
# user.activation_token_attribute_name =
|
268
|
+
|
269
|
+
|
270
|
+
# the attribute name to hold activation code expiration date.
|
271
|
+
# Default: `:activation_token_expires_at`
|
272
|
+
#
|
273
|
+
# user.activation_token_expires_at_attribute_name =
|
274
|
+
|
275
|
+
|
276
|
+
# how many seconds before the activation code expires. nil for never expires.
|
277
|
+
# Default: `nil`
|
278
|
+
#
|
279
|
+
# user.activation_token_expiration_period =
|
280
|
+
|
281
|
+
|
282
|
+
# your mailer class. Required.
|
283
|
+
# Default: `nil`
|
284
|
+
#
|
285
|
+
# user.user_activation_mailer =
|
286
|
+
|
287
|
+
|
288
|
+
# when true sorcery will not automatically
|
289
|
+
# email activation details and allow you to
|
290
|
+
# manually handle how and when email is sent.
|
291
|
+
# Default: `false`
|
292
|
+
#
|
293
|
+
# user.activation_mailer_disabled =
|
294
|
+
|
295
|
+
|
296
|
+
# activation needed email method on your mailer class.
|
297
|
+
# Default: `:activation_needed_email`
|
298
|
+
#
|
299
|
+
# user.activation_needed_email_method_name =
|
300
|
+
|
301
|
+
|
302
|
+
# activation success email method on your mailer class.
|
303
|
+
# Default: `:activation_success_email`
|
304
|
+
#
|
305
|
+
# user.activation_success_email_method_name =
|
306
|
+
|
307
|
+
|
308
|
+
# do you want to prevent or allow users that did not activate by email to login?
|
309
|
+
# Default: `true`
|
310
|
+
#
|
311
|
+
# user.prevent_non_active_users_to_login =
|
312
|
+
|
313
|
+
|
314
|
+
# -- reset_password --
|
315
|
+
# reset password code attribute name.
|
316
|
+
# Default: `:reset_password_token`
|
317
|
+
#
|
318
|
+
# user.reset_password_token_attribute_name =
|
319
|
+
|
320
|
+
|
321
|
+
# expires at attribute name.
|
322
|
+
# Default: `:reset_password_token_expires_at`
|
323
|
+
#
|
324
|
+
# user.reset_password_token_expires_at_attribute_name =
|
325
|
+
|
326
|
+
|
327
|
+
# when was email sent, used for hammering protection.
|
328
|
+
# Default: `:reset_password_email_sent_at`
|
329
|
+
#
|
330
|
+
# user.reset_password_email_sent_at_attribute_name =
|
331
|
+
|
332
|
+
|
333
|
+
# mailer class. Needed.
|
334
|
+
# Default: `nil`
|
335
|
+
#
|
336
|
+
user.reset_password_mailer = Geri::AdminUserMailer
|
337
|
+
|
338
|
+
|
339
|
+
# reset password email method on your mailer class.
|
340
|
+
# Default: `:reset_password_email`
|
341
|
+
#
|
342
|
+
# user.reset_password_email_method_name =
|
343
|
+
|
344
|
+
|
345
|
+
# when true sorcery will not automatically
|
346
|
+
# email password reset details and allow you to
|
347
|
+
# manually handle how and when email is sent
|
348
|
+
# Default: `false`
|
349
|
+
#
|
350
|
+
# user.reset_password_mailer_disabled =
|
351
|
+
|
352
|
+
|
353
|
+
# how many seconds before the reset request expires. nil for never expires.
|
354
|
+
# Default: `nil`
|
355
|
+
#
|
356
|
+
# user.reset_password_expiration_period =
|
357
|
+
|
358
|
+
|
359
|
+
# hammering protection, how long in seconds to wait before allowing another email to be sent.
|
360
|
+
# Default: `5 * 60`
|
361
|
+
#
|
362
|
+
# user.reset_password_time_between_emails =
|
363
|
+
|
364
|
+
|
365
|
+
# -- brute_force_protection --
|
366
|
+
# Failed logins attribute name.
|
367
|
+
# Default: `:failed_logins_count`
|
368
|
+
#
|
369
|
+
# user.failed_logins_count_attribute_name =
|
370
|
+
|
371
|
+
|
372
|
+
# This field indicates whether user is banned and when it will be active again.
|
373
|
+
# Default: `:lock_expires_at`
|
374
|
+
#
|
375
|
+
# user.lock_expires_at_attribute_name =
|
376
|
+
|
377
|
+
|
378
|
+
# How many failed logins allowed.
|
379
|
+
# Default: `50`
|
380
|
+
#
|
381
|
+
# user.consecutive_login_retries_amount_limit =
|
382
|
+
|
383
|
+
|
384
|
+
# How long the user should be banned. in seconds. 0 for permanent.
|
385
|
+
# Default: `60 * 60`
|
386
|
+
#
|
387
|
+
# user.login_lock_time_period =
|
388
|
+
|
389
|
+
# Unlock token attribute name
|
390
|
+
# Default: `:unlock_token`
|
391
|
+
#
|
392
|
+
# user.unlock_token_attribute_name =
|
393
|
+
|
394
|
+
# Unlock token mailer method
|
395
|
+
# Default: `:send_unlock_token_email`
|
396
|
+
#
|
397
|
+
# user.unlock_token_email_method_name =
|
398
|
+
|
399
|
+
# when true sorcery will not automatically
|
400
|
+
# send email with unlock token
|
401
|
+
# Default: `false`
|
402
|
+
#
|
403
|
+
# user.unlock_token_mailer_disabled = true
|
404
|
+
|
405
|
+
# Unlock token mailer class
|
406
|
+
# Default: `nil`
|
407
|
+
#
|
408
|
+
# user.unlock_token_mailer = UserMailer
|
409
|
+
|
410
|
+
# -- activity logging --
|
411
|
+
# Last login attribute name.
|
412
|
+
# Default: `:last_login_at`
|
413
|
+
#
|
414
|
+
# user.last_login_at_attribute_name =
|
415
|
+
|
416
|
+
|
417
|
+
# Last logout attribute name.
|
418
|
+
# Default: `:last_logout_at`
|
419
|
+
#
|
420
|
+
# user.last_logout_at_attribute_name =
|
421
|
+
|
422
|
+
|
423
|
+
# Last activity attribute name.
|
424
|
+
# Default: `:last_activity_at`
|
425
|
+
#
|
426
|
+
# user.last_activity_at_attribute_name =
|
427
|
+
|
428
|
+
|
429
|
+
# How long since last activity is the user defined logged out?
|
430
|
+
# Default: `10 * 60`
|
431
|
+
#
|
432
|
+
# user.activity_timeout =
|
433
|
+
|
434
|
+
|
435
|
+
# -- external --
|
436
|
+
# Class which holds the various external provider data for this user.
|
437
|
+
# Default: `nil`
|
438
|
+
#
|
439
|
+
# user.authentications_class =
|
440
|
+
|
441
|
+
|
442
|
+
# User's identifier in authentications class.
|
443
|
+
# Default: `:user_id`
|
444
|
+
#
|
445
|
+
# user.authentications_user_id_attribute_name =
|
446
|
+
|
447
|
+
|
448
|
+
# Provider's identifier in authentications class.
|
449
|
+
# Default: `:provider`
|
450
|
+
#
|
451
|
+
# user.provider_attribute_name =
|
452
|
+
|
453
|
+
|
454
|
+
# User's external unique identifier in authentications class.
|
455
|
+
# Default: `:uid`
|
456
|
+
#
|
457
|
+
# user.provider_uid_attribute_name =
|
458
|
+
end
|
459
|
+
|
460
|
+
# This line must come after the 'user config' block.
|
461
|
+
# Define which model authenticates with sorcery.
|
462
|
+
config.user_class = 'Geri::AdminUser'
|
463
|
+
end
|