Removed unused local variable
Use new location for http_authorization library. Added error_handler in CMS_MODULE_API (and thus all modules). Better error handling in CMS_USER_API.
This commit is contained in:
@@ -425,7 +425,6 @@ feature -- Handler
|
||||
handle_post_change_password (api: CMS_API; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
r: CMS_RESPONSE
|
||||
l_user_api: CMS_USER_API
|
||||
do
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
if attached template_block ("post_change", r) as l_tpl_block then
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<library name="cms_model" location="..\..\library\model\cms_model-safe.ecf" readonly="false"/>
|
||||
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder-safe.ecf"/>
|
||||
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="http_authorization" location="$ISE_LIBRARY\contrib\library\network\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
|
||||
<library name="http_authorization" location="$ISE_LIBRARY\contrib\library\web\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
|
||||
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
|
||||
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
|
||||
@@ -17,6 +17,24 @@ feature {NONE} -- Initialization
|
||||
initialize
|
||||
-- Initialize Current api.
|
||||
do
|
||||
create error_handler.make
|
||||
end
|
||||
|
||||
feature -- Access: error handling
|
||||
|
||||
error_handler: ERROR_HANDLER
|
||||
-- Error handler.
|
||||
|
||||
reset_error
|
||||
-- Reset error handler.
|
||||
do
|
||||
error_handler.reset
|
||||
end
|
||||
|
||||
has_error: BOOLEAN
|
||||
-- Error occurred?
|
||||
do
|
||||
Result := error_handler.has_error
|
||||
end
|
||||
|
||||
feature {CMS_API_ACCESS, CMS_MODULE, CMS_API} -- Restricted access
|
||||
|
||||
@@ -131,15 +131,15 @@ feature -- Change User
|
||||
no_id: not a_user.has_id
|
||||
no_hashed_password: a_user.hashed_password = Void
|
||||
do
|
||||
reset_error
|
||||
if
|
||||
attached a_user.password as l_password and then
|
||||
attached a_user.email as l_email
|
||||
then
|
||||
storage.new_user (a_user)
|
||||
error_handler.append (storage.error_handler)
|
||||
else
|
||||
debug ("refactor_fixme")
|
||||
fixme ("Add error")
|
||||
end
|
||||
error_handler.add_custom_error (0, "bad new user request", "Missing password or email to create new user!")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -148,7 +148,9 @@ feature -- Change User
|
||||
require
|
||||
has_id: a_user.has_id
|
||||
do
|
||||
reset_error
|
||||
storage.update_user (a_user)
|
||||
error_handler.append (storage.error_handler)
|
||||
end
|
||||
|
||||
feature -- User Activation
|
||||
@@ -190,4 +192,7 @@ feature -- User status
|
||||
Trashed: INTEGER = -1
|
||||
-- The user is trashed (soft delete), ready to be deleted/destroyed from storage.
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user