indexing description: "User disable account use case." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class USER_DISABLE_ACCOUNT inherit AUTH_USE_CASE O_USER_CONSTANTS O_CONFIG_CONSTANTS create make feature -- Access namespace: STRING is -- Namespace of this use case. once Result := user_namespace end type: STRING is -- Message type of this use case. once Result := user_disable_account_type end feature -- Basic operation start (a_msg: O_MESSAGE) is -- Start the use case by a_msg. local l_msg: O_USER_DISABLE_ACCOUNT_MESSAGE do l_msg ?= a_msg check valid_message: l_msg /= Void end -- check if the user is authorized and act accordingly is_authorized_for_project (l_msg, "user_disable_account", 0, auth_node) end feature {NONE} -- Callbacks handle_auth_success (a_msg: O_MESSAGE) is -- a_msg has been authorized, execute it. local l_msg: O_USER_DISABLE_ACCOUNT_MESSAGE l_storage_msg: O_USER_DISABLE_ACCOUNT_MESSAGE do l_msg ?= a_msg check valid_msg: l_msg /= Void end create l_storage_msg.make (l_msg.session) l_storage_msg.set_reply_handler (agent process_storage_reply (?, a_msg)) node.send_message_node (l_storage_msg, "storage1") end process_storage_reply (a_msg, an_orig_msg: O_MESSAGE) is -- Process storage reply - now the user has been disabled and deleted. -- `a_msg' is storage reply, `an_orig_msg' is original disable message. local l_conf: O_GENERIC_MESSAGE l_msg: O_USER_DISABLE_ACCOUNT_MESSAGE do l_msg ?= an_orig_msg check valid_msg: l_msg /= Void end -- also regenerate svn configuration create l_conf.make (config_namespace, config_svn_type) l_conf.set_reply_handler (agent forward_to_node (?, "config1")) node.send_message_node (l_conf, "storage1") -- also regenerate ftp configuration create l_conf.make (config_namespace, config_ftp_type) l_conf.set_reply_handler (agent forward_to_node (?, "config1")) node.send_message_node (l_conf, "storage1") create l_conf.make (config_namespace, config_command_type) l_conf.add_argument ("pureftp", "/usr/bin/pure-pw mkdb") node.send_message_node (l_conf, "config1") -- finally send reply from storage node back to api node.send_message_reply (a_msg, an_orig_msg) end end