Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5eeb73cb0a |
@@ -1212,6 +1212,7 @@ Gem::Specification.new do |s|
|
||||
lib/gollum/templates/pagination.mustache
|
||||
lib/gollum/templates/search.mustache
|
||||
lib/gollum/templates/searchbar.mustache
|
||||
lib/gollum/templates/user.mustache
|
||||
lib/gollum/templates/wiki_content.mustache
|
||||
lib/gollum/uri_encode_component.rb
|
||||
lib/gollum/views/commit.rb
|
||||
|
||||
+8
-2
@@ -211,7 +211,7 @@ module Precious
|
||||
end
|
||||
|
||||
get '/edit/*' do
|
||||
forbid unless @allow_editing
|
||||
forbid unless @allow_editing && @user_authed
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.fullname
|
||||
@path = wikip.path
|
||||
@@ -234,6 +234,7 @@ module Precious
|
||||
|
||||
wiki = wiki_new
|
||||
halt 405 unless wiki.allow_uploads
|
||||
forbid unless @user_authed
|
||||
|
||||
if params[:file]
|
||||
fullname = params[:file][:filename]
|
||||
@@ -290,6 +291,7 @@ module Precious
|
||||
post '/rename/*' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
halt 500 if wikip.nil?
|
||||
forbid unless @user_authed
|
||||
wiki = wikip.wiki
|
||||
page = wikip.page
|
||||
rename = params[:rename]
|
||||
@@ -333,6 +335,7 @@ module Precious
|
||||
path = "/#{clean_url(sanitize_empty_params(params[:path]))}"
|
||||
wiki = wiki_new
|
||||
page = wiki.page(::File.join(path, params[:page]))
|
||||
forbid unless @user_authed
|
||||
|
||||
return if page.nil?
|
||||
if etag != page.sha
|
||||
@@ -353,6 +356,7 @@ module Precious
|
||||
|
||||
post '/delete/*' do
|
||||
forbid unless @allow_editing
|
||||
forbid unless @user_authed
|
||||
wiki = wiki_new
|
||||
filepath = params[:splat].first
|
||||
unless filepath.nil?
|
||||
@@ -364,6 +368,7 @@ module Precious
|
||||
|
||||
get '/create/*' do
|
||||
forbid unless @allow_editing
|
||||
forbid unless @user_authed
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@name = wikip.name
|
||||
@ext = wikip.ext
|
||||
@@ -389,6 +394,7 @@ module Precious
|
||||
path = sanitize_empty_params(params[:path]) || ''
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
forbid unless @user_authed
|
||||
|
||||
path.gsub!(/^\//, '')
|
||||
|
||||
@@ -639,7 +645,7 @@ module Precious
|
||||
elsif @redirects_enabled && redirect_path = wiki.redirects[fullpath]
|
||||
redirect to("#{encodeURIComponent(redirect_path)}?redirected_from=#{encodeURIComponent(fullpath)}")
|
||||
else
|
||||
if @allow_editing
|
||||
if @allow_editing && @user_authed
|
||||
path = fullpath[-1] == '/' ? "#{fullpath}#{wiki.index_page}" : fullpath # Append default index page if no page name is supplied
|
||||
redirect to("/gollum/create/#{clean_url(encodeURIComponent(path))}")
|
||||
else
|
||||
|
||||
@@ -734,3 +734,12 @@ nav.actions {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* @section user */
|
||||
#user p {
|
||||
text-align: right;
|
||||
padding-right:0.5em;
|
||||
font-size: .8em;
|
||||
line-height: 2.0em;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<body>
|
||||
<div class="container-lg clearfix">
|
||||
{{{yield}}}
|
||||
{{< user}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<div id="user">
|
||||
<p>
|
||||
{{#user_authed}}
|
||||
{{user_name}} | {{user_provider}} | <strong><a href="/__omnigollum__/logout">[Logout]</a></strong>
|
||||
{{/user_authed}}
|
||||
{{^user_authed}}
|
||||
not logged in | <strong><a href="/__omnigollum__/login">[Login]</a></strong>
|
||||
{{/user_authed}}
|
||||
<p>
|
||||
</div>
|
||||
@@ -88,6 +88,19 @@ module Precious
|
||||
false
|
||||
end
|
||||
|
||||
# Passthrough additional omniauth parameters for status bar
|
||||
def user_authed
|
||||
@user_authed
|
||||
end
|
||||
|
||||
def user_provider
|
||||
@user.provider
|
||||
end
|
||||
|
||||
def user_name
|
||||
@user.name
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user