Class: PluginFormatters::LoginScript

Inherits:
Arachni::Plugin::Formatter
  • Object
show all
Includes:
TemplateUtilities
Defined in:
components/reporters/plugin_formatters/stdout/login_script.rb,
components/reporters/plugin_formatters/html/login_script.rb,
components/reporters/plugin_formatters/xml/login_script.rb

Overview

Author:

Instance Method Summary collapse

Instance Method Details

#run(xml) ⇒ Object



14
15
16
17
18
19
20
# File 'components/reporters/plugin_formatters/stdout/login_script.rb', line 14

def run
    print_ok results['message']

    return if !results['cookies']
    print_info 'Cookies set to:'
    results['cookies'].each_pair { |name, val| print_info "    * #{name} = #{val}" }
end

#tplObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'components/reporters/plugin_formatters/html/login_script.rb', line 19

def tpl
    <<-HTML
    <% if results['status'] == 'success' %>
            <p class="alert alert-success">
                <%= results['message'] %>
            </p>

            <h3>Cookies set to:</h3>

            <dl class="dl-horizontal">
                <% results['cookies'].each do |k, v| %>
                    <dt>
                        <code><%= escapeHTML( k ) %></code>
                    </dt>
                    <dd>
                        <code><%= escapeHTML( v ) %></code>
                    </dd>
                <% end %>
            </dl>
    <% else %>
        <p class="alert alert-danger">
            <%= results['message'] %>
        </p>
    <% end %>
    HTML
end