Skip to content

Commit

Permalink
Bug Fixes on Cloner and AdminWeb
Browse files Browse the repository at this point in the history
- Fixing Cloner issue on index view + forms with full URI
- Adding logic to cloner template to better parse credentials
- Added Information on Credentials AdminWeb. Still need to find a way
to do the same in Console that makes sense for CLI.
  • Loading branch information
mrbrutti committed Oct 24, 2014
1 parent 1cac4fe commit 47e72a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion data/web/admin/views/stats_creds.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</thead>
<tbody>
<% @hits.each do |hit| %>
<tr>
<tr onclick="$('.<%= hit['_id']%>').toggle('slow');">
<td><%if !hit.username.nil?%><%=h hit.username %><%end%></td>
<td><%if !hit.password.nil?%><span class="label label-info"><%=h hit.password %></span><%end%></td>
<td><%=h hit.ip %></td>
Expand All @@ -41,6 +41,9 @@
<td><%=h hit.ua_platform %></td>
<td><small><%=h hit.created_at.strftime("%m/%d/%Y-%T")%></small></td>
</tr>
<tr class="<%= hit['_id']%>" style="display:none; background:#eee;" >
<td colspan="12"><%= h hit.data %></td>
</tr>
<% end %>
</tbody>
</table>
Expand Down
4 changes: 4 additions & 0 deletions lib/cartero/commands/cloner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ def create_index(page)
end
end

page.search("//form/@action").each do |form|
form.value = URI.parse(form.value).path
end

f = File.new(@options.path + "/" + webserver.underscore + "/views/index.erb", "w")
f << page.parser.to_s
f.close
Expand Down
4 changes: 2 additions & 2 deletions templates/webserver/template.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class <%= self[:webserver].camelize %> < Sinatra::Base
:ua_engine => ua.engine,
:ua_platform => ua.platform,
:ua_lang => ua.lang,
:username => params[:username] || params[:email] || params[:user],
:password => params[:password] || params[:pwd] || params[:secret]
:username => params[:username] || params[:email] || params[:user] || params[params.keys.select {|x| x =~ /email|user|uname/i }[0]],
:password => params[:password] || params[:pwd] || params[:secret] || params[params.keys.select {|x| x =~ /pass|pwd|secret/i }[0]]
)
creds.save!
end
Expand Down

0 comments on commit 47e72a2

Please sign in to comment.