Changesets can be listed by changeset number.
The Git repository is here.
Changeset 366
Hub integration.
- Comitted by: rool
- Date: Saturday March 19 22:06:05 2011 (over 13 years ago)
Affected files:
- rool/rails/instiki/trunk/app/controllers/admin_controller.rb (diff)
- rool/rails/instiki/trunk/app/controllers/file_controller.rb (diff)
- rool/rails/instiki/trunk/app/controllers/wiki_controller.rb (diff)
- rool/rails/instiki/trunk/app/helpers/wiki_helper.rb (diff)
- rool/rails/instiki/trunk/app/views/file/file.rhtml (diff)
- rool/rails/instiki/trunk/app/views/file/import.rhtml (diff)
- rool/rails/instiki/trunk/app/views/wiki/new.rhtml (diff)
- rool/rails/instiki/trunk/app/views/wiki/rollback.rhtml (diff)
rool/rails/instiki/trunk/app/controllers/admin_controller.rb:
prev. | current | |
cache_sweeper :web_sweeper | ||
before_filter :dnsbl_check | ||
7 | # 2011-03-14 (ADH): Hub integration. | |
8 | ||
9 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
10 | :create_system => [ :admin, :webmaster ], | |
11 | :create_web => [ :admin, :webmaster ], | |
12 | :edit_web => [ :admin, :webmaster ], | |
13 | :remove_orphaned_pages => [ :admin, :webmaster ], | |
14 | :remove_orphaned_pages_in_category => [ :admin, :webmaster ], | |
15 | :delete_web => [ :admin, :webmaster ], | |
16 | :delete_files => [ :admin, :webmaster ] | |
17 | }) | |
18 | ||
19 | def AdminController.hubssolib_permissions | |
20 | @@hubssolib_permissions | |
21 | end | |
22 | ||
def create_system | ||
if @wiki.setup? | ||
flash[:error] = |
rool/rails/instiki/trunk/app/controllers/file_controller.rb:
prev. | current | |
before_filter :check_authorized | ||
before_filter :check_allow_uploads, :dnsbl_check, :except => [:file, :blahtex_png] | ||
13 | # 2011-03-14 (ADH): Hub integration. | |
14 | ||
15 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
16 | :delete => [ :admin, :webmaster ] | |
17 | }) | |
18 | ||
19 | def FileController.hubssolib_permissions | |
20 | @@hubssolib_permissions | |
21 | end | |
22 | ||
def file | ||
@file_name = params['id'] | ||
if params['file'] |
rool/rails/instiki/trunk/app/controllers/wiki_controller.rb:
prev. | current | |
layout 'default', :except => [:atom_with_content, :atom_with_headlines, :atom, :source, :tex, :s5, :export_html] | ||
18 | # 2011-03-14 (ADH): Hub integration. | |
19 | ||
20 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
21 | :login => [ :admin, :webmaster, :privileged, :normal ], | |
22 | :edit => [ :admin, :webmaster, :privileged, :normal ], | |
23 | :cancel_edit => [ :admin, :webmaster, :privileged, :normal ], | |
24 | :new => [ :admin, :webmaster, :privileged, :normal ], | |
25 | :rollback => [ :admin, :webmaster, :privileged, :normal ], | |
26 | :save => [ :admin, :webmaster, :privileged, :normal ], | |
27 | :export_html => [ :admin, :webmaster ], | |
28 | :export_markup => [ :admin, :webmaster ], | |
29 | :web_list => [ :admin, :webmaster ] | |
30 | }) | |
31 | ||
32 | def WikiController.hubssolib_permissions | |
33 | @@hubssolib_permissions | |
34 | end | |
35 | ||
def index | ||
if @web_name | ||
redirect_home | ||
... | ... | |
def save | ||
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil? | ||
return unless is_post | ||
309 | | |
310 | | |
327 | # 2011-01-14 (ADH): Hub integration | |
328 | # author_name = params['author'].purify | |
329 | # author_name = 'AnonymousCoward' if author_name =~ /^\s*$/ | |
330 | author_name = hubssolib_unique_name | |
begin | ||
the_content = params['content'].purify | ||
prev_content = '' | ||
filter_spam(the_content) | ||
336 | # 2011-01-14 (ADH): Don't use "as_bytes" in this context. See changes to | |
337 | # "lib/instiki_stringsupport.rb". | |
338 | # cookies['author'] = { :value => author_name.dup, :expires => Time.utc(2030) } | |
cookies['author'] = { :value => author_name.dup.as_bytes, :expires => Time.utc(2030) } | ||
if @page | ||
new_name = params['new_name'] ? params['new_name'].purify : @page_name |
rool/rails/instiki/trunk/app/helpers/wiki_helper.rb:
prev. | current | |
def navigation_menu_for_page | ||
menu = [] | ||
menu << edit_page | ||
17 | | |
17 | # 2011-03-14 (ADH): Hub integration. | |
18 | # menu << edit_web if @page.name == "HomePage" | |
19 | menu << edit_web if @page.name == "HomePage" && hubssolib_logged_in? && hubssolib_authorized?( :edit_web, WikiController ) | |
if @page.revisions.size > 1 | ||
menu << back_for_page | ||
menu << see_or_hide_changes_for_page |
rool/rails/instiki/trunk/app/views/file/file.rhtml:
prev. | current | |
<%= text_field "file", "description", "size" => 40 %> | ||
</div> | ||
<div> | ||
28 | | |
28 | <input type="submit" value="Upload" /> | |
29 | <% | |
30 | if false # 2011-03-14 (ADH): Hub integration - author comes from logged in user name | |
31 | -%> | |
32 | as | |
<%= text_field_tag :author, @author, | ||
:onfocus => "this.value == 'AnonymousCoward' ? this.value = '' : true;", | ||
:onblur => "this.value == '' ? this.value = 'AnonymousCoward' : true" %> | ||
36 | <% end -%> | |
</div> | ||
<%- end -%> |
rool/rails/instiki/trunk/app/views/file/import.rhtml:
prev. | current | |
<input type="password" id="system_password" name="system_password" /> | ||
</p> | ||
<p> | ||
14 | | |
14 | <input type="submit" value="Update" /> | |
15 | <% | |
16 | if false # 2011-03-14 (ADH): Hub integration - author comes from logged in user name | |
17 | -%> | |
18 | as | |
<input type="text" name="author" id="authorName" value="<%= @author %>" | ||
onclick="this.value == 'AnonymousCoward' ? this.value = '' : true" /> | ||
21 | <% end -%> | |
<%- if @page -%> | ||
| <%= link_to 'Cancel', :web => @web.address, :action => 'file'%> <em>(unlocks page)</em> | ||
<%- end -%> |
rool/rails/instiki/trunk/app/views/wiki/new.rhtml:
prev. | current | |
<textarea name="content" id="content" rows="24" cols="60"><%= h(flash[:content] || | ||
params['content'] ? params['content'].purify : '' ) %></textarea> | ||
<div id="editFormButtons"> | ||
19 | | |
19 | <input type="submit" value="Submit" accesskey="s"/> | |
20 | <% | |
21 | if false # 2011-03-14 (ADH): Hub integration - author comes from logged in user name | |
22 | -%> | |
23 | as | |
<%= text_field_tag :author, @author, | ||
:onfocus => "this.value == 'AnonymousCoward' ? this.value = '' : true;", | ||
:onblur => "this.value == '' ? this.value = 'AnonymousCoward' : true" %> | ||
27 | <% end %> | |
</div> | ||
<%- end -%> | ||
</div> |
rool/rails/instiki/trunk/app/views/wiki/rollback.rhtml:
prev. | current | |
<div> | ||
<textarea name="content" id="content" rows="24" cols="60"><%= h(@revision.content.purify) %></textarea> | ||
<div id="editFormButtons"> | ||
18 | | |
18 | <input type="submit" value="Update" accesskey="u" /> | |
19 | <% | |
20 | if false # 2011-03-14 (ADH): Hub integration - author comes from logged in user name | |
21 | -%> | |
22 | as | |
<input type="text" name="author" id="authorName" value="<%= h(@author.purify) %>" | ||
onclick="this.value == 'AnonymousCoward' ? this.value = '' : true" /> | ||
25 | <% end -%> | |
| | ||
<span> | ||
<%= link_to('Cancel', {:web => @web.address, :action => 'cancel_edit', :id => @page.name}, |