watobo 0.9.8.677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/watobo_gui.rb +39 -0
- data/certificates/cert.pem +19 -0
- data/certificates/privkey.pem +15 -0
- data/certificates/watobo_dh.key +5 -0
- data/config/datastore.yml +5 -0
- data/config/forwarding_proxy.yml +12 -0
- data/config/general.yml +4 -0
- data/config/gui.yml +23 -0
- data/config/interceptor.yml +16 -0
- data/config/scan_policy.yml +13 -0
- data/config/scanner.yml +34 -0
- data/icons/Add.ico +0 -0
- data/icons/Add_24x24.ico +0 -0
- data/icons/Bandwidth.ico +0 -0
- data/icons/Bandwidth_24x24.ico +0 -0
- data/icons/Mr. Bomb.ico +0 -0
- data/icons/Mr. Bomb_16x16.ico +0 -0
- data/icons/Mr. Bomb_24x24.ico +0 -0
- data/icons/Orange Ball.ico +0 -0
- data/icons/Orange Ball_16x16.ico +0 -0
- data/icons/Orange Ball_24x24.ico +0 -0
- data/icons/Pause.ico +0 -0
- data/icons/Play.ico +0 -0
- data/icons/Play_24x24.ico +0 -0
- data/icons/Red Ball.ico +0 -0
- data/icons/Red Ball_16x16.ico +0 -0
- data/icons/Red Ball_24x24.ico +0 -0
- data/icons/Run.ico +0 -0
- data/icons/Stop.ico +0 -0
- data/icons/Stop_24x24.ico +0 -0
- data/icons/Terminal.ico +0 -0
- data/icons/Transfer.ico +0 -0
- data/icons/Transfer_16x16.ico +0 -0
- data/icons/User.ico +0 -0
- data/icons/User_16x16.ico +0 -0
- data/icons/User_24x24.ico +0 -0
- data/icons/Web Browser.ico +0 -0
- data/icons/Web Browser_16x16.ico +0 -0
- data/icons/Write Document.ico +0 -0
- data/icons/Yellow Ball.ico +0 -0
- data/icons/Yellow Ball_16x16.ico +0 -0
- data/icons/Yellow Ball_24x24.ico +0 -0
- data/icons/advanced.ico +0 -0
- data/icons/advanced_16x16.ico +0 -0
- data/icons/advanced_24x24.ico +0 -0
- data/icons/applications.ico +0 -0
- data/icons/applications_16x16.ico +0 -0
- data/icons/applications_24x24.ico +0 -0
- data/icons/browser_16x16.ico +0 -0
- data/icons/browser_24x24.ico +0 -0
- data/icons/burn.ico +0 -0
- data/icons/burn_16x16.ico +0 -0
- data/icons/burn_24x24.ico +0 -0
- data/icons/calculator.ico +0 -0
- data/icons/calculator_24x24.ico +0 -0
- data/icons/cb_checked.ico +0 -0
- data/icons/cb_checked_orange.ico +0 -0
- data/icons/cb_unchecked.ico +0 -0
- data/icons/coin_24x24.ico +0 -0
- data/icons/conversation.ico +0 -0
- data/icons/conversation_24x24.ico +0 -0
- data/icons/engine.ico +0 -0
- data/icons/filter.ico +0 -0
- data/icons/folder.ico +0 -0
- data/icons/folder_16x16.ico +0 -0
- data/icons/fuzzer_16x16.ico +0 -0
- data/icons/fuzzer_24x24.ico +0 -0
- data/icons/go-down_16x16.png +0 -0
- data/icons/go-up_16x16.png +0 -0
- data/icons/help.ico +0 -0
- data/icons/help_16x16.ico +0 -0
- data/icons/help_24x24.ico +0 -0
- data/icons/iChat.ico +0 -0
- data/icons/iChat_16x16.ico +0 -0
- data/icons/iChat_24x24.ico +0 -0
- data/icons/icons.txt +3 -0
- data/icons/info.ico +0 -0
- data/icons/info_16x16.ico +0 -0
- data/icons/info_24x24.ico +0 -0
- data/icons/interceptor_24x24.ico +0 -0
- data/icons/lock.ico +0 -0
- data/icons/lock_12x12.ico +0 -0
- data/icons/lock_16x16.ico +0 -0
- data/icons/monitor.ico +0 -0
- data/icons/plugin.ico +0 -0
- data/icons/plugin_24x24.ico +0 -0
- data/icons/scan_16x16.png +0 -0
- data/icons/send.ico +0 -0
- data/icons/server.ico +0 -0
- data/icons/server_16x16.ico +0 -0
- data/icons/siberas_logo_x24.gif +0 -0
- data/icons/tag_blue_32x32.ico +0 -0
- data/icons/watobo-48x48.png +0 -0
- data/icons/watobo-logo.png +0 -0
- data/icons/watobo.ico +0 -0
- data/lib/watobo/adapters/data_store.rb +38 -0
- data/lib/watobo/adapters/file/file_store.rb +211 -0
- data/lib/watobo/adapters/session_store.rb +27 -0
- data/lib/watobo/adapters.rb +26 -0
- data/lib/watobo/config.rb +143 -0
- data/lib/watobo/constants.rb +92 -0
- data/lib/watobo/core/active_check.rb +404 -0
- data/lib/watobo/core/cookie.rb +69 -0
- data/lib/watobo/core/fuzz_gen.rb +160 -0
- data/lib/watobo/core/http_socket.rb +142 -0
- data/lib/watobo/core/interceptor.rb +729 -0
- data/lib/watobo/core/passive_check.rb +141 -0
- data/lib/watobo/core/project.rb +1058 -0
- data/lib/watobo/core/scanner.rb +396 -0
- data/lib/watobo/core/session.rb +1320 -0
- data/lib/watobo/core/simple_ca.rb +393 -0
- data/lib/watobo/core.rb +34 -0
- data/lib/watobo/defaults.rb +40 -0
- data/lib/watobo/external/diff/lcs/array.rb +42 -0
- data/lib/watobo/external/diff/lcs/block.rb +72 -0
- data/lib/watobo/external/diff/lcs/callbacks.rb +343 -0
- data/lib/watobo/external/diff/lcs/change.rb +190 -0
- data/lib/watobo/external/diff/lcs/hunk.rb +279 -0
- data/lib/watobo/external/diff/lcs/ldiff.rb +247 -0
- data/lib/watobo/external/diff/lcs/string.rb +40 -0
- data/lib/watobo/external/diff/lcs.rb +1124 -0
- data/lib/watobo/external/ntlm/ntlm.rb +797 -0
- data/lib/watobo/externals.rb +28 -0
- data/lib/watobo/framework/create_project.rb +55 -0
- data/lib/watobo/framework/init.rb +149 -0
- data/lib/watobo/framework/init_modules.rb +116 -0
- data/lib/watobo/framework/license_text.rb +50 -0
- data/lib/watobo/framework.rb +26 -0
- data/lib/watobo/gui/about_watobo.rb +68 -0
- data/lib/watobo/gui/browser_preview.rb +460 -0
- data/lib/watobo/gui/certificate_dialog.rb +132 -0
- data/lib/watobo/gui/chat_diff.rb +415 -0
- data/lib/watobo/gui/chatviewer_frame.rb +427 -0
- data/lib/watobo/gui/checkboxtree.rb +221 -0
- data/lib/watobo/gui/checks_policy_frame.rb +123 -0
- data/lib/watobo/gui/client_cert_dialog.rb +227 -0
- data/lib/watobo/gui/confirm_scan_dialog.rb +67 -0
- data/lib/watobo/gui/conversation_table.rb +386 -0
- data/lib/watobo/gui/conversation_table_ctrl.rb +175 -0
- data/lib/watobo/gui/csrf_token_dialog.rb +446 -0
- data/lib/watobo/gui/dashboard.rb +341 -0
- data/lib/watobo/gui/define_scope_frame.rb +380 -0
- data/lib/watobo/gui/edit_comment.rb +70 -0
- data/lib/watobo/gui/edit_scope_dialog.rb +69 -0
- data/lib/watobo/gui/finding_info.rb +212 -0
- data/lib/watobo/gui/findings_tree.rb +459 -0
- data/lib/watobo/gui/full_scan_dialog.rb +269 -0
- data/lib/watobo/gui/fuzzer_gui.rb +1522 -0
- data/lib/watobo/gui/hex_viewer.rb +106 -0
- data/lib/watobo/gui/interceptor_gui.rb +994 -0
- data/lib/watobo/gui/interceptor_settings_dialog.rb +201 -0
- data/lib/watobo/gui/log_viewer.rb +97 -0
- data/lib/watobo/gui/login_wizzard.rb +301 -0
- data/lib/watobo/gui/main_window.rb +1815 -0
- data/lib/watobo/gui/manual_request_editor.rb +1105 -0
- data/lib/watobo/gui/master_pw_dialog.rb +142 -0
- data/lib/watobo/gui/password_policy_dialog.rb +98 -0
- data/lib/watobo/gui/plugin/base.rb +82 -0
- data/lib/watobo/gui/plugin_board.rb +95 -0
- data/lib/watobo/gui/preferences_dialog.rb +116 -0
- data/lib/watobo/gui/progress_window.rb +102 -0
- data/lib/watobo/gui/project_wizzard.rb +369 -0
- data/lib/watobo/gui/proxy_dialog.rb +550 -0
- data/lib/watobo/gui/quick_scan_dialog.rb +242 -0
- data/lib/watobo/gui/request_editor.rb +480 -0
- data/lib/watobo/gui/save_chat_dialog.rb +158 -0
- data/lib/watobo/gui/scanner_settings_dialog.rb +360 -0
- data/lib/watobo/gui/select_chat_dialog.rb +169 -0
- data/lib/watobo/gui/session_management_dialog.rb +688 -0
- data/lib/watobo/gui/sites_tree.rb +347 -0
- data/lib/watobo/gui/status_bar.rb +88 -0
- data/lib/watobo/gui/table_editor.rb +445 -0
- data/lib/watobo/gui/tagless_viewer.rb +62 -0
- data/lib/watobo/gui/templates/plugin.rb +80 -0
- data/lib/watobo/gui/templates/plugin2.rb +103 -0
- data/lib/watobo/gui/text_viewer.rb +247 -0
- data/lib/watobo/gui/transcoder_window.rb +215 -0
- data/lib/watobo/gui/utils/gui_utils.rb +129 -0
- data/lib/watobo/gui/utils/init_icons.rb +106 -0
- data/lib/watobo/gui/utils/load_icons.rb +54 -0
- data/lib/watobo/gui/utils/load_plugins.rb +94 -0
- data/lib/watobo/gui/utils/master_password.rb +90 -0
- data/lib/watobo/gui/utils/save_default_settings.rb +99 -0
- data/lib/watobo/gui/utils/save_project_settings.rb +21 -0
- data/lib/watobo/gui/utils/save_proxy_settings.rb +45 -0
- data/lib/watobo/gui/utils/save_session_settings.rb +21 -0
- data/lib/watobo/gui/utils/session_history.rb +134 -0
- data/lib/watobo/gui/workspace_dialog.rb +89 -0
- data/lib/watobo/gui/www_auth_dialog.rb +348 -0
- data/lib/watobo/gui/xml_viewer_frame.rb +114 -0
- data/lib/watobo/gui.rb +139 -0
- data/lib/watobo/mixins/httpparser.rb +664 -0
- data/lib/watobo/mixins/request_parser.rb +210 -0
- data/lib/watobo/mixins/shapers.rb +345 -0
- data/lib/watobo/mixins/transcoders.rb +88 -0
- data/lib/watobo/mixins.rb +32 -0
- data/lib/watobo/utils/check_regex.rb +36 -0
- data/lib/watobo/utils/copy_object.rb +29 -0
- data/lib/watobo/utils/crypto.rb +74 -0
- data/lib/watobo/utils/expand_range.rb +45 -0
- data/lib/watobo/utils/file_management.rb +73 -0
- data/lib/watobo/utils/load_chat.rb +219 -0
- data/lib/watobo/utils/load_icon.rb +47 -0
- data/lib/watobo/utils/print_debug.rb +34 -0
- data/lib/watobo/utils/response_hash.rb +143 -0
- data/lib/watobo/utils/secure_eval.rb +57 -0
- data/lib/watobo/utils/text2request.rb +96 -0
- data/lib/watobo/utils.rb +32 -0
- data/lib/watobo.rb +76 -0
- data/modules/active/Apache/mod_status.rb +123 -0
- data/modules/active/Flash/crossdomain.rb +102 -0
- data/modules/active/directories/dirwalker.rb +89 -0
- data/modules/active/discovery/fileextensions.rb +151 -0
- data/modules/active/discovery/http_methods.rb +135 -0
- data/modules/active/domino/domino_db.lst +164 -0
- data/modules/active/domino/domino_db.rb +128 -0
- data/modules/active/fileinclusion/lfi_simple.rb +134 -0
- data/modules/active/jboss/jboss_basic.rb +119 -0
- data/modules/active/sap/business_objects.rb +73 -0
- data/modules/active/sap/its_commands.rb +101 -0
- data/modules/active/sap/its_service_parameter.rb +105 -0
- data/modules/active/sap/its_services.rb +103 -0
- data/modules/active/sap/its_xss.rb +98 -0
- data/modules/active/sqlinjection/sql_boolean.rb +262 -0
- data/modules/active/sqlinjection/sqli_simple.rb +205 -0
- data/modules/active/xss/xss_simple.rb +179 -0
- data/modules/passive/cookie_options.rb +97 -0
- data/modules/passive/cookie_xss.rb +85 -0
- data/modules/passive/detect_code.rb +89 -0
- data/modules/passive/detect_fileupload.rb +80 -0
- data/modules/passive/detect_infrastructure.rb +98 -0
- data/modules/passive/detect_one_time_tokens.rb +86 -0
- data/modules/passive/dirindexing.rb +81 -0
- data/modules/passive/disclosure_emails.rb +82 -0
- data/modules/passive/disclosure_ipaddr.rb +87 -0
- data/modules/passive/filename_as_parameter.rb +85 -0
- data/modules/passive/form_spotter.rb +75 -0
- data/modules/passive/hotspots.rb +86 -0
- data/modules/passive/in_script_parameter.rb +92 -0
- data/modules/passive/multiple_server_headers.rb +98 -0
- data/modules/passive/possible_login.rb +134 -0
- data/modules/passive/redirect_url.rb +88 -0
- data/modules/passive/redirectionz.rb +96 -0
- data/modules/passive/xss_dom.rb +91 -0
- data/plugins/catalog/catalog.ico +0 -0
- data/plugins/catalog/catalog.rb +726 -0
- data/plugins/catalog/db_tests +6483 -0
- data/plugins/catalog/db_variables +29 -0
- data/plugins/filefinder/dbs/hbci.db +12 -0
- data/plugins/filefinder/filefinder.rb +602 -0
- data/plugins/sslchecker/cli/sslchecker_cli.rb +21 -0
- data/plugins/sslchecker/gui/cipher_table.rb +260 -0
- data/plugins/sslchecker/gui/gui.rb +245 -0
- data/plugins/sslchecker/gui/sslchecker.rb +26 -0
- data/plugins/sslchecker/icons/green_16x16.ico +0 -0
- data/plugins/sslchecker/icons/grey_16x16.ico +0 -0
- data/plugins/sslchecker/icons/red_16x16.ico +0 -0
- data/plugins/sslchecker/icons/sslchecker.ico +0 -0
- data/plugins/sslchecker/lib/check.rb +117 -0
- metadata +317 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
# .
|
|
2
|
+
# session_management_dialog.rb
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2012 by siberas, http://www.siberas.de
|
|
5
|
+
#
|
|
6
|
+
# This file is part of WATOBO (Web Application Tool Box)
|
|
7
|
+
# http://watobo.sourceforge.com
|
|
8
|
+
#
|
|
9
|
+
# WATOBO is free software; you can redistribute it and/or modify
|
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
|
11
|
+
# the Free Software Foundation version 2 of the License.
|
|
12
|
+
#
|
|
13
|
+
# WATOBO is distributed in the hope that it will be useful,
|
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
# GNU General Public License for more details.
|
|
17
|
+
#
|
|
18
|
+
# You should have received a copy of the GNU General Public License
|
|
19
|
+
# along with WATOBO; if not, write to the Free Software
|
|
20
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
# .
|
|
22
|
+
module Watobo
|
|
23
|
+
module Gui
|
|
24
|
+
class SidTable < FXTable
|
|
25
|
+
def subscribe(event, &callback)
|
|
26
|
+
(@event_dispatcher_listeners[event] ||= []) << callback
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def clearEvents(event)
|
|
30
|
+
@event_dispatcher_listener[event].clear
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def updateSID(new_sids = {})
|
|
34
|
+
initTable()
|
|
35
|
+
new_sids.each_key do |site|
|
|
36
|
+
addSID(site, new_sids[site])
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def initialize(owner, opts)
|
|
41
|
+
super(owner, opts)
|
|
42
|
+
@request = nil
|
|
43
|
+
@event_dispatcher_listeners = Hash.new
|
|
44
|
+
initTable()
|
|
45
|
+
|
|
46
|
+
self.connect(SEL_COMMAND, method(:onTableClick))
|
|
47
|
+
|
|
48
|
+
# KEY_Return
|
|
49
|
+
# KEY_Control_L
|
|
50
|
+
# KEY_Control_R
|
|
51
|
+
# KEY_s
|
|
52
|
+
@ctrl_pressed = false
|
|
53
|
+
|
|
54
|
+
# addKeyHandler(self)
|
|
55
|
+
|
|
56
|
+
self.columnHeader.connect(SEL_COMMAND) do |sender, sel, index|
|
|
57
|
+
self.fitColumnsToContents(index)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
private
|
|
62
|
+
|
|
63
|
+
def onTableClick(sender, sel, item)
|
|
64
|
+
begin
|
|
65
|
+
row = item.row
|
|
66
|
+
self.selectRow(row, false)
|
|
67
|
+
# self.startInput(row,2)
|
|
68
|
+
rescue => bang
|
|
69
|
+
puts bang
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
=begin
|
|
73
|
+
def addKeyHandler(item)
|
|
74
|
+
item.connect(SEL_KEYPRESS) do |sender, sel, event|
|
|
75
|
+
cr = self.currentRow
|
|
76
|
+
@ctrl_pressed = true if event.code == KEY_Control_L or event.code == KEY_Control_R
|
|
77
|
+
# @shift_pressed = true if @ctrl_pressed and ( event.code == KEY_Shift_L or event.code == KEY_Shift_R )
|
|
78
|
+
|
|
79
|
+
if @ctrl_pressed
|
|
80
|
+
# special handling of KEY_Return, because we don't want a linebreak in textbox.
|
|
81
|
+
if event.code == KEY_Return
|
|
82
|
+
self.acceptInput(true)
|
|
83
|
+
notify(:hotkey_ctrl_enter)
|
|
84
|
+
true
|
|
85
|
+
else
|
|
86
|
+
notify(:hotkey_ctrl_f) if event.code == KEY_f
|
|
87
|
+
notify(:hotkey_ctrl_s) if event.code == KEY_s
|
|
88
|
+
|
|
89
|
+
if event.code == KEY_u
|
|
90
|
+
text = self.getItemText(cr, 2)
|
|
91
|
+
#puts "* Encode URL: #{text}"
|
|
92
|
+
cgi = CGI::escape(text)
|
|
93
|
+
self.acceptInput(true)
|
|
94
|
+
self.setItemText(cr, 2, cgi.strip, true)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if event.code == KEY_b
|
|
98
|
+
text = self.getItemText(cr, 2)
|
|
99
|
+
puts "* Encode B64: #{text}"
|
|
100
|
+
b64 = Base64.encode64(text)
|
|
101
|
+
self.acceptInput(true)
|
|
102
|
+
self.setItemText(cr, 2, b64.strip, true)
|
|
103
|
+
puts b64.class
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
puts "CTRL-SHIFT-U" if event.code == KEY_U
|
|
107
|
+
if event.code == KEY_U
|
|
108
|
+
|
|
109
|
+
text = self.getItemText(cr, 2)
|
|
110
|
+
puts "* Encode URL: #{text}"
|
|
111
|
+
uncgi = CGI::unescape(text)
|
|
112
|
+
self.acceptInput(true)
|
|
113
|
+
self.setItemText(cr, 2, uncgi.strip, true)
|
|
114
|
+
end
|
|
115
|
+
if event.code == KEY_B
|
|
116
|
+
text = self.getItemText(cr, 2)
|
|
117
|
+
puts "* Encode B64: #{text}"
|
|
118
|
+
b64 = Base64.decode64(text)
|
|
119
|
+
self.acceptInput(true)
|
|
120
|
+
self.setItemText(cr, 2, b64.strip, true)
|
|
121
|
+
puts b64.class
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
false
|
|
125
|
+
end
|
|
126
|
+
elsif event.code == KEY_Return
|
|
127
|
+
self.selectRow(cr)
|
|
128
|
+
startInput(cr,2)
|
|
129
|
+
true
|
|
130
|
+
else
|
|
131
|
+
#puts "%04x" % event.code
|
|
132
|
+
false
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
item.connect(SEL_KEYRELEASE) do |sender, sel, event|
|
|
137
|
+
@ctrl_pressed = false if event.code == KEY_Control_L or event.code == KEY_Control_R
|
|
138
|
+
false
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
=end
|
|
142
|
+
|
|
143
|
+
def addSID(host, sids)
|
|
144
|
+
sids.each_key do |sid_name|
|
|
145
|
+
lastRowIndex = self.getNumRows
|
|
146
|
+
self.appendRows(1)
|
|
147
|
+
self.setItemText(lastRowIndex, 0, host)
|
|
148
|
+
self.getItem(lastRowIndex, 0).justify = FXTableItem::LEFT
|
|
149
|
+
self.setItemText(lastRowIndex, 1, sid_name)
|
|
150
|
+
self.getItem(lastRowIndex, 1).justify = FXTableItem::LEFT
|
|
151
|
+
self.setItemText(lastRowIndex, 2, sids[sid_name])
|
|
152
|
+
self.getItem(lastRowIndex, 2).justify = FXTableItem::LEFT
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def notify(event, *args)
|
|
157
|
+
if @event_dispatcher_listeners[event]
|
|
158
|
+
@event_dispatcher_listeners[event].each do |m|
|
|
159
|
+
m.call(*args) if m.respond_to? :call
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def initTable
|
|
165
|
+
self.clearItems()
|
|
166
|
+
self.setTableSize(0, 3)
|
|
167
|
+
|
|
168
|
+
self.setColumnText( 0, "Host" )
|
|
169
|
+
self.setColumnText( 1, "Name" )
|
|
170
|
+
self.setColumnText( 2, "Value" )
|
|
171
|
+
|
|
172
|
+
self.rowHeader.width = 0
|
|
173
|
+
self.setColumnWidth(0, 60)
|
|
174
|
+
|
|
175
|
+
self.setColumnWidth(1, 80)
|
|
176
|
+
self.setColumnWidth(2, 120)
|
|
177
|
+
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
class LogoutSettings < FXHorizontalFrame
|
|
182
|
+
def showBadSignatureMessage()
|
|
183
|
+
FXMessageBox.information(self, MBOX_OK, "Wrong Signature Format", "Signature Format is wrong. Must be a valid regular expression, e.g.(<Regex>) <^Location.*action=logout>")
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
def getLogoutSignatures()
|
|
187
|
+
signatures = []
|
|
188
|
+
@signature_list.numItems.times do |index|
|
|
189
|
+
signatures.push @signature_list.getItemData(index)
|
|
190
|
+
end
|
|
191
|
+
return signatures
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def addSignature(sender,sel,id)
|
|
195
|
+
pattern = @signature.value
|
|
196
|
+
if pattern != "" then
|
|
197
|
+
begin
|
|
198
|
+
|
|
199
|
+
# test if pattern looks like a valid regex
|
|
200
|
+
if "test" =~ /#{pattern}/i then
|
|
201
|
+
#looks good
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
rescue => bang
|
|
205
|
+
puts "!!!ERROR: Bad pattern"
|
|
206
|
+
showBadSignatureMessage()
|
|
207
|
+
return -1
|
|
208
|
+
end
|
|
209
|
+
item = @signature_list.appendItem("#{@signature.value}")
|
|
210
|
+
@signature_list.setItemData(item, @signature.value)
|
|
211
|
+
return 0
|
|
212
|
+
# item.
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
def remSignature(sender,sel,id)
|
|
217
|
+
index = @signature_list.currentItem
|
|
218
|
+
if index >= 0
|
|
219
|
+
@signature_list.removeItem(index)
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
def onSignatureClick(sender,sel,item)
|
|
224
|
+
#@request_viewer.highlight(@pattern_list.getItemText(item))
|
|
225
|
+
#@response_viewer.highlight(@pattern_list.getItemText(item))
|
|
226
|
+
@signature.value = @signature_list.getItemText(item)
|
|
227
|
+
@signature_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def initialize(parent, project)
|
|
231
|
+
@project = project
|
|
232
|
+
@signature = FXDataTarget.new('')
|
|
233
|
+
|
|
234
|
+
super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
235
|
+
|
|
236
|
+
main_frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_GROOVE)
|
|
237
|
+
frame = FXVerticalFrame.new(main_frame, :opts => LAYOUT_FILL_Y)
|
|
238
|
+
label = FXLabel.new(frame, "Logout Signatures:")
|
|
239
|
+
|
|
240
|
+
@signature_field = FXTextField.new(frame, 40, :target => @signature, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT)
|
|
241
|
+
|
|
242
|
+
b_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
|
|
243
|
+
@addSigButton = FXButton.new(b_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
|
244
|
+
@addSigButton.connect(SEL_COMMAND, method(:addSignature))
|
|
245
|
+
@remSigButton=FXButton.new(b_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
|
246
|
+
@remSigButton.connect(SEL_COMMAND, method(:remSignature))
|
|
247
|
+
|
|
248
|
+
list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
|
|
249
|
+
@signature_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
250
|
+
@signature_list.numVisible = 25
|
|
251
|
+
|
|
252
|
+
@signature_list.connect(SEL_COMMAND,method(:onSignatureClick))
|
|
253
|
+
|
|
254
|
+
if @project then
|
|
255
|
+
@project.getLogoutSignatures.each do |p|
|
|
256
|
+
item = @signature_list.appendItem("#{p}")
|
|
257
|
+
@signature_list.setItemData(item, p)
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
class SessionIdSettings < FXHorizontalFrame
|
|
264
|
+
include Watobo::Gui::Utils
|
|
265
|
+
class SidPreview < FXText
|
|
266
|
+
def highlight(pattern)
|
|
267
|
+
self.setText(self.to_s)
|
|
268
|
+
begin
|
|
269
|
+
# puts pattern
|
|
270
|
+
if self.to_s =~ /#{pattern}/ then
|
|
271
|
+
if $1 and $2 then
|
|
272
|
+
# puts "MATCH (#{$1}/#{$2})"
|
|
273
|
+
string1 = $1
|
|
274
|
+
string2 = $2
|
|
275
|
+
index1 = nil
|
|
276
|
+
index1 = self.to_s.index(string1)
|
|
277
|
+
if index1 then
|
|
278
|
+
self.changeStyle(index1,string1.length,1)
|
|
279
|
+
end
|
|
280
|
+
index2 = nil
|
|
281
|
+
index2 = self.to_s.index(string2)
|
|
282
|
+
|
|
283
|
+
if index2 then
|
|
284
|
+
self.changeStyle(index2,string2.length,1)
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
self.makePositionVisible(index1)
|
|
288
|
+
|
|
289
|
+
else
|
|
290
|
+
# string1 = pattern
|
|
291
|
+
# string2 = pattern
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
rescue => bang
|
|
295
|
+
puts "!!!ERROR: could not highlight pattern"
|
|
296
|
+
puts bang
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def initialize(parent, opts)
|
|
301
|
+
super(parent, opts)
|
|
302
|
+
@style = 1 # default style
|
|
303
|
+
|
|
304
|
+
# Construct some hilite styles
|
|
305
|
+
hs_green = FXHiliteStyle.new
|
|
306
|
+
hs_green.normalForeColor = FXRGBA(255,255,255,255) #FXColor::Red
|
|
307
|
+
hs_green.normalBackColor = FXRGBA(0,255,0,1) # FXColor::White
|
|
308
|
+
hs_green.style = FXText::STYLE_BOLD
|
|
309
|
+
|
|
310
|
+
hs_red = FXHiliteStyle.new
|
|
311
|
+
hs_red.normalForeColor = FXRGBA(255,255,255,255) #FXColor::Red
|
|
312
|
+
hs_red.normalBackColor = FXRGBA(255,0,0,1) # FXColor::White
|
|
313
|
+
hs_red.style = FXText::STYLE_BOLD
|
|
314
|
+
|
|
315
|
+
self.styled = true
|
|
316
|
+
# Set the styles
|
|
317
|
+
self.hiliteStyles = [ hs_green, hs_red]
|
|
318
|
+
|
|
319
|
+
self.editable = false
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
def onPatternClick(sender,sel,item)
|
|
324
|
+
@request_viewer.highlight(@pattern_list.getItemText(item))
|
|
325
|
+
@response_viewer.highlight(@pattern_list.getItemText(item))
|
|
326
|
+
@pattern.value = @pattern_list.getItemText(item)
|
|
327
|
+
@pattern_field.handle(self, FXSEL(SEL_UPDATE, 0), nil)
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
def onRequestChanged(sender, sel, item)
|
|
331
|
+
begin
|
|
332
|
+
chat = @requestCombo.getItemData(@requestCombo.currentItem)
|
|
333
|
+
@request_viewer.setText(cleanupHTTP(chat.request))
|
|
334
|
+
@response_viewer.setText(cleanupHTTP(chat.response))
|
|
335
|
+
rescue => bang
|
|
336
|
+
puts "could not update request"
|
|
337
|
+
puts bang
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
def showBadPatternMessage()
|
|
342
|
+
FXMessageBox.information(self, MBOX_OK, "Wrong Pattern Format", "SID Pattern Format is wrong, e.g.(<PATTERN>) <(session)=([a-z]*)>\nRegex must contain two selectors \"()\" to satisfy $1 and $2.")
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
def getSidPatternList()
|
|
346
|
+
sids = []
|
|
347
|
+
@pattern_list.numItems.times do |index|
|
|
348
|
+
sids.push @pattern_list.getItemData(index)
|
|
349
|
+
end
|
|
350
|
+
return sids
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
def addPattern(sender,sel,id)
|
|
354
|
+
pattern = @pattern.value
|
|
355
|
+
if pattern != "" then
|
|
356
|
+
begin
|
|
357
|
+
dummy = pattern.split('(')
|
|
358
|
+
if dummy.length < 2 then
|
|
359
|
+
# no good pattern
|
|
360
|
+
puts "!!!ERROR: Bad pattern"
|
|
361
|
+
showBadPatternMessage()
|
|
362
|
+
return -1
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
dummy = pattern.split(')')
|
|
366
|
+
if dummy.length < 2 then
|
|
367
|
+
# no good pattern
|
|
368
|
+
puts "!!!ERROR: Bad pattern"
|
|
369
|
+
showBadPatternMessage()
|
|
370
|
+
return -1
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
# test if pattern looks like a valid regex
|
|
374
|
+
if "test" =~ /#{pattern}/i then
|
|
375
|
+
#looks good
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
rescue => bang
|
|
379
|
+
puts "!!!ERROR: Bad pattern"
|
|
380
|
+
showBadPatternMessage()
|
|
381
|
+
return -1
|
|
382
|
+
end
|
|
383
|
+
item = @pattern_list.appendItem("#{@pattern.value}")
|
|
384
|
+
@pattern_list.setItemData(item, @pattern.value)
|
|
385
|
+
return 0
|
|
386
|
+
# item.
|
|
387
|
+
end
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
def remPattern(sender,sel,id)
|
|
391
|
+
index = @pattern_list.currentItem
|
|
392
|
+
if index >= 0
|
|
393
|
+
@pattern_list.removeItem(index)
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def updateRequests(req_id_list)
|
|
398
|
+
|
|
399
|
+
if @project then
|
|
400
|
+
@requestCombo.clearItems()
|
|
401
|
+
|
|
402
|
+
req_id_list.each do |id|
|
|
403
|
+
chat = @project.getChat(id)
|
|
404
|
+
text = "[#{id}] #{chat.request.first}"
|
|
405
|
+
@requestCombo.appendItem(text.slice(0..60), chat)
|
|
406
|
+
end
|
|
407
|
+
if @requestCombo.numItems > 0 then
|
|
408
|
+
if @requestCombo.numItems < 10 then
|
|
409
|
+
@requestCombo.numVisible = @requestCombo.numItems
|
|
410
|
+
else
|
|
411
|
+
@requestCombo.numVisible = 10
|
|
412
|
+
end
|
|
413
|
+
@requestCombo.setCurrentItem(0, true)
|
|
414
|
+
chat = @requestCombo.getItemData(0)
|
|
415
|
+
@request_viewer.setText(cleanupHTTP(chat.request))
|
|
416
|
+
@response_viewer.setText(cleanupHTTP(chat.response))
|
|
417
|
+
end
|
|
418
|
+
end
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
def initialize(parent, project)
|
|
422
|
+
@project = project
|
|
423
|
+
@pattern = FXDataTarget.new('')
|
|
424
|
+
|
|
425
|
+
super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
426
|
+
|
|
427
|
+
main_frame = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_GROOVE)
|
|
428
|
+
frame = FXVerticalFrame.new(main_frame, :opts => LAYOUT_FILL_Y)
|
|
429
|
+
label = FXLabel.new(frame, "Session ID Patterns:")
|
|
430
|
+
|
|
431
|
+
@pattern_field = FXTextField.new(frame, 40, :target => @pattern, :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_LEFT)
|
|
432
|
+
|
|
433
|
+
b_frame = FXHorizontalFrame.new(frame, :opts => LAYOUT_FILL_X)
|
|
434
|
+
@addSidButton = FXButton.new(b_frame, "Add" , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
|
435
|
+
@addSidButton.connect(SEL_COMMAND, method(:addPattern))
|
|
436
|
+
@remSidButton=FXButton.new(b_frame, "Remove" , :opts => BUTTON_NORMAL|LAYOUT_LEFT)
|
|
437
|
+
@remSidButton.connect(SEL_COMMAND, method(:remPattern))
|
|
438
|
+
|
|
439
|
+
list_frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|FRAME_SUNKEN, :padding => 0)
|
|
440
|
+
@pattern_list = FXList.new(list_frame, :opts => LIST_EXTENDEDSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
441
|
+
@pattern_list.numVisible = 25
|
|
442
|
+
|
|
443
|
+
@pattern_list.connect(SEL_COMMAND,method(:onPatternClick))
|
|
444
|
+
|
|
445
|
+
frame = FXVerticalFrame.new(main_frame, :opts => LAYOUT_FILL_Y|LAYOUT_FILL_X)
|
|
446
|
+
label = FXLabel.new(frame, "Login Requests:")
|
|
447
|
+
@requestCombo = FXComboBox.new(frame, 5, nil, 0,
|
|
448
|
+
COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
|
449
|
+
#@filterCombo.width =200
|
|
450
|
+
|
|
451
|
+
@requestCombo.numVisible = 0
|
|
452
|
+
@requestCombo.numColumns = 50
|
|
453
|
+
@requestCombo.editable = false
|
|
454
|
+
@requestCombo.connect(SEL_COMMAND, method(:onRequestChanged))
|
|
455
|
+
|
|
456
|
+
chat_viewer_frame = FXVerticalFrame.new(frame, LAYOUT_FILL_X|LAYOUT_FILL_Y, :height => 300, :padding => 0)
|
|
457
|
+
tabBook = FXTabBook.new(chat_viewer_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT, :padding => 0)
|
|
458
|
+
|
|
459
|
+
req_tab = FXTabItem.new(tabBook, "Request", nil)
|
|
460
|
+
frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
|
|
461
|
+
sunken = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
|
|
462
|
+
@request_viewer = SidPreview.new(sunken, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN)
|
|
463
|
+
|
|
464
|
+
resp_tab = FXTabItem.new(tabBook, "Response", nil)
|
|
465
|
+
frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
|
|
466
|
+
sunken = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
|
|
467
|
+
@response_viewer = SidPreview.new(sunken, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
468
|
+
|
|
469
|
+
if @project then
|
|
470
|
+
@project.getSidPatterns.each do |p|
|
|
471
|
+
item = @pattern_list.appendItem("#{p}")
|
|
472
|
+
@pattern_list.setItemData(item, p)
|
|
473
|
+
end
|
|
474
|
+
end
|
|
475
|
+
end
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
class SIDCacheFrame < FXVerticalFrame
|
|
479
|
+
def initialize(parent, project)
|
|
480
|
+
@project = project
|
|
481
|
+
super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
482
|
+
# button_frame = FXHorizontalFrame.new(self, :opts=> LAYOUT_FILL_X)
|
|
483
|
+
# refresh_btn = FXButton.new(button_frame, "Refresh")
|
|
484
|
+
|
|
485
|
+
@sidTable = SidTable.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
486
|
+
|
|
487
|
+
@session = Watobo::Session.new(@project.object_id)
|
|
488
|
+
|
|
489
|
+
@sidTable.updateSID @session.sidCache()
|
|
490
|
+
end
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
class LoginScriptSettings < FXVerticalFrame
|
|
494
|
+
def showChat(chat)
|
|
495
|
+
@request_viewer.setText(chat.request)
|
|
496
|
+
|
|
497
|
+
@response_viewer.setText(chat.response)
|
|
498
|
+
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
def getLoginScriptIds()
|
|
502
|
+
ids = []
|
|
503
|
+
@scriptTable.numRows.times do |row|
|
|
504
|
+
# puts row
|
|
505
|
+
ids.push @scriptTable.getRowText(row)
|
|
506
|
+
end
|
|
507
|
+
return ids
|
|
508
|
+
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
def onTableClick(sender, sel, item)
|
|
512
|
+
begin
|
|
513
|
+
|
|
514
|
+
# purge viewers
|
|
515
|
+
@request_viewer.setText('')
|
|
516
|
+
@response_viewer.setText('')
|
|
517
|
+
row = item.row
|
|
518
|
+
|
|
519
|
+
if row >= 0 then
|
|
520
|
+
@scriptTable.selectRow(row, false)
|
|
521
|
+
chatid = @scriptTable.getRowText(item.row).to_i
|
|
522
|
+
# @logText.appendText("selected ID: (#{chatid})\n")
|
|
523
|
+
if chatid >= 0
|
|
524
|
+
chat = @project.getChat(chatid)
|
|
525
|
+
showChat(chat) if chat
|
|
526
|
+
@sel_row = row
|
|
527
|
+
@rem_button.enable
|
|
528
|
+
end
|
|
529
|
+
end
|
|
530
|
+
rescue => bang
|
|
531
|
+
puts "!!!ERROR: onTableClick"
|
|
532
|
+
puts bang
|
|
533
|
+
puts "!!!"
|
|
534
|
+
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
def removeRequest(sender, sel, item)
|
|
539
|
+
if @sel_row >= 0 then
|
|
540
|
+
@scriptTable.removeRows(@sel_row)
|
|
541
|
+
@scriptTable.killSelection(false)
|
|
542
|
+
@rem_button.disable
|
|
543
|
+
@sel_row = -1
|
|
544
|
+
end
|
|
545
|
+
end
|
|
546
|
+
|
|
547
|
+
def startSelectChatDialog(sender, sel, item)
|
|
548
|
+
begin
|
|
549
|
+
dlg = Watobo::Gui::SelectChatDialog.new(self, "Select Login Chat", @project.chats)
|
|
550
|
+
if dlg.execute != 0 then
|
|
551
|
+
|
|
552
|
+
chats_selected = dlg.selection.value.split(",")
|
|
553
|
+
|
|
554
|
+
chats_selected.each do |chatid|
|
|
555
|
+
chat = @project.getChat(chatid.strip)
|
|
556
|
+
addRequest(chat) if chat
|
|
557
|
+
end
|
|
558
|
+
end
|
|
559
|
+
rescue => bang
|
|
560
|
+
puts "!!!ERROR: could not open SelectChatDialog."
|
|
561
|
+
puts bang
|
|
562
|
+
end
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
def addRequest(chat)
|
|
566
|
+
@scriptTable.addChat(chat)
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
def initialize(parent, project)
|
|
570
|
+
@project = project
|
|
571
|
+
@table_filter = FXDataTarget.new('')
|
|
572
|
+
@sel_row = -1
|
|
573
|
+
super(parent, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
574
|
+
|
|
575
|
+
# main_splitter = FXSplitter.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|SPLITTER_HORIZONTAL|LAYOUT_FILL_Y|SPLITTER_TRACKING)
|
|
576
|
+
# left_frame = FXVerticalFrame.new(main_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE, :width => 400, :padding => 0)
|
|
577
|
+
# right_frame = FXVerticalFrame.new(main_splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :width => 200, :padding => 0)
|
|
578
|
+
|
|
579
|
+
#chat_filter_frame = FXHorizontalFrame.new(left_frame, :opts => LAYOUT_FILL_X)
|
|
580
|
+
#FXLabel.new(chat_filter_frame, "Filter")
|
|
581
|
+
#@filter_text_field = FXTextField.new(chat_filter_frame, 20, @table_filter, FXDataTarget::ID_VALUE, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X)
|
|
582
|
+
|
|
583
|
+
#chat_table_frame = FXVerticalFrame.new(left_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
584
|
+
splitter = FXSplitter.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|SPLITTER_VERTICAL|LAYOUT_FILL_Y|SPLITTER_TRACKING)
|
|
585
|
+
script_frame = FXVerticalFrame.new(splitter, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE, :height => 300,:padding => 0)
|
|
586
|
+
|
|
587
|
+
frame = FXHorizontalFrame.new(script_frame, :opts => LAYOUT_FILL_X)
|
|
588
|
+
label = FXLabel.new(frame, "Login Script Requests:")
|
|
589
|
+
@add_button = FXButton.new(frame, "Add Request...", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT)
|
|
590
|
+
@add_button.connect(SEL_COMMAND, method(:startSelectChatDialog))
|
|
591
|
+
|
|
592
|
+
@rem_button = FXButton.new(frame, "Remove Request", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT)
|
|
593
|
+
@rem_button.connect(SEL_COMMAND, method(:removeRequest))
|
|
594
|
+
@rem_button.disable
|
|
595
|
+
|
|
596
|
+
label.setFont(FXFont.new(getApp(), "helvetica", 12, FONTWEIGHT_BOLD, FONTSLANT_ITALIC, FONTENCODING_DEFAULT))
|
|
597
|
+
script_table_frame = FXVerticalFrame.new(script_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
598
|
+
@scriptTable = ConversationTable.new(script_table_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
599
|
+
@scriptTable.connect(SEL_CLICKED, method(:onTableClick))
|
|
600
|
+
|
|
601
|
+
chat_viewer_frame = FXVerticalFrame.new(splitter, LAYOUT_FILL_X|LAYOUT_FILL_Y, :height => 300, :padding => 0)
|
|
602
|
+
tabBook = FXTabBook.new(chat_viewer_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT, :padding => 0)
|
|
603
|
+
|
|
604
|
+
req_tab = FXTabItem.new(tabBook, "Request", nil)
|
|
605
|
+
frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
|
|
606
|
+
@request_viewer = Watobo::Gui::SimpleTextView.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
|
|
607
|
+
|
|
608
|
+
resp_tab = FXTabItem.new(tabBook, "Response", nil)
|
|
609
|
+
frame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_RAISED)
|
|
610
|
+
@response_viewer = Watobo::Gui::SimpleTextView.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, :padding => 0)
|
|
611
|
+
|
|
612
|
+
if @project then
|
|
613
|
+
@project.getLoginChatIds.each do |id|
|
|
614
|
+
chat = @project.getChat(id)
|
|
615
|
+
addRequest(chat)
|
|
616
|
+
end
|
|
617
|
+
end
|
|
618
|
+
end
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
#
|
|
622
|
+
# S E S S I O N M A N A G E M E N T D I A L O G
|
|
623
|
+
#
|
|
624
|
+
class SessionManagementDialog < FXDialogBox
|
|
625
|
+
include Watobo::Gui::Icons
|
|
626
|
+
|
|
627
|
+
def getSidPatterns()
|
|
628
|
+
sidpats = @sidSettings.getSidPatternList
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
def getLoginScriptIds()
|
|
632
|
+
login_chat_ids = @loginSettings.getLoginScriptIds()
|
|
633
|
+
end
|
|
634
|
+
|
|
635
|
+
def getLogoutSignatures()
|
|
636
|
+
signatures = @logoutSettings.getLogoutSignatures()
|
|
637
|
+
end
|
|
638
|
+
|
|
639
|
+
def initialize(owner, project)
|
|
640
|
+
@project = project
|
|
641
|
+
# Invoke base class initialize function first
|
|
642
|
+
# super(owner, "LoginScript Wizzard", DECOR_TITLE|DECOR_BORDER,:width=>800, :height=>600)
|
|
643
|
+
super(owner, "Session Management", DECOR_ALL, :width=>800, :height=>600)
|
|
644
|
+
self.icon = ICON_LOGIN_WIZZARD
|
|
645
|
+
main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
|
|
646
|
+
|
|
647
|
+
tabBook = FXTabBook.new(main_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
|
|
648
|
+
|
|
649
|
+
login_tab = FXTabItem.new(tabBook, "Login Script", nil)
|
|
650
|
+
@loginSettings = LoginScriptSettings.new(tabBook, @project)
|
|
651
|
+
|
|
652
|
+
sid_tab = FXTabItem.new(tabBook, "Sesssion IDs", nil)
|
|
653
|
+
# @sidFrame = FXVerticalFrame.new(tabBook, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
654
|
+
@sidSettings = SessionIdSettings.new(tabBook, @project)
|
|
655
|
+
|
|
656
|
+
logout_tab = FXTabItem.new(tabBook, "Logout Signatures", nil)
|
|
657
|
+
@logoutSettings = LogoutSettings.new(tabBook, @project)
|
|
658
|
+
|
|
659
|
+
sidcache_tab = FXTabItem.new(tabBook, "SID-Cache", nil)
|
|
660
|
+
SIDCacheFrame.new(tabBook, @project)
|
|
661
|
+
|
|
662
|
+
tabBook.connect(SEL_COMMAND) do |sender, sel, tabItem|
|
|
663
|
+
|
|
664
|
+
case tabItem.to_i
|
|
665
|
+
when 0
|
|
666
|
+
# puts "Login Script Selected"
|
|
667
|
+
when 1
|
|
668
|
+
# puts "Session IDs Selected"
|
|
669
|
+
ids = getLoginScriptIds()
|
|
670
|
+
@sidSettings.updateRequests(ids)
|
|
671
|
+
when 2
|
|
672
|
+
# puts "Logout Selected"
|
|
673
|
+
end
|
|
674
|
+
end
|
|
675
|
+
|
|
676
|
+
button_frame = FXHorizontalFrame.new(main_frame, :opts => LAYOUT_FILL_X)
|
|
677
|
+
FXButton.new(button_frame, "OK" ,
|
|
678
|
+
:target => self, :selector => FXDialogBox::ID_ACCEPT,
|
|
679
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
|
680
|
+
FXButton.new(button_frame, "Cancel" ,
|
|
681
|
+
:target => self, :selector => FXDialogBox::ID_CANCEL,
|
|
682
|
+
:opts => BUTTON_NORMAL|LAYOUT_RIGHT)
|
|
683
|
+
end
|
|
684
|
+
|
|
685
|
+
end
|
|
686
|
+
#--
|
|
687
|
+
end
|
|
688
|
+
end
|