Updated templates and fixed typos.
Renamed classes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<p>You have required a new password at <a href="$host">$sitename</a></p>
|
||||
|
||||
<p>To complete your request, please click on this link to genereate a new password:<p>
|
||||
<p>To complete your request, please click on this link to generate a new password:<p>
|
||||
|
||||
<p><a href="$link">$link</a></p>
|
||||
</body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="author" content="$sitename">
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to<a href="$host">$sitename</a></p>
|
||||
<p>Welcome to <a href="$host">$sitename</a></p>
|
||||
<p>Thank you for joining us.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<h2> Account Evaluation </h2>
|
||||
<p>The user $user ($email) wants to register to the site <a href="$host">$sitename</a></p>
|
||||
|
||||
<blockquote><p>This is his/her application.</p>
|
||||
<blockquote><p>User application:</p>
|
||||
<p>$application</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
|
||||
DROP TABLE IF EXISTS "auth_temp_users";
|
||||
CREATE TABLE `auth_temp_users` (
|
||||
`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`uid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
`password` VARCHAR(100) NOT NULL,
|
||||
`salt` VARCHAR(100) NOT NULL,
|
||||
@@ -11,3 +9,5 @@ CREATE TABLE `auth_temp_users` (
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<h1 class="page-title">Listing 4 Pending Registrations</h1>
|
||||
<ul class="cms-registrations">
|
||||
<li class="cms_pending_user">
|
||||
<ul>
|
||||
<li>
|
||||
Javier - javier@testing
|
||||
</li>
|
||||
<li>
|
||||
Software Developer
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="http://localhost:9090/admin/user/2">activate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://localhost:9090/admin/user/2">reject</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -108,7 +108,7 @@ feature -- Access
|
||||
-- Contact email.
|
||||
|
||||
site_name: IMMUTABLE_STRING_8
|
||||
-- Site name.
|
||||
-- UTF-8 encoded Site name.
|
||||
|
||||
contact_subject_account_evaluation: IMMUTABLE_STRING_8
|
||||
contact_subject_register: IMMUTABLE_STRING_8
|
||||
|
||||
@@ -91,16 +91,16 @@ feature {CMS_API} -- Module Initialization
|
||||
-- <Precursor>
|
||||
local
|
||||
l_auth_api: like auth_api
|
||||
l_user_auth_storage: CMS_TEMPORAL_USER_STORAGE_I
|
||||
l_user_auth_storage: CMS_TEMP_USER_STORAGE_I
|
||||
do
|
||||
Precursor (a_api)
|
||||
|
||||
-- Storage initialization
|
||||
if attached a_api.storage.as_sql_storage as l_storage_sql then
|
||||
create {CMS_TEMPORAL_USER_STORAGE_SQL} l_user_auth_storage.make (l_storage_sql)
|
||||
create {CMS_TEMP_USER_STORAGE_SQL} l_user_auth_storage.make (l_storage_sql)
|
||||
else
|
||||
-- FIXME: in case of NULL storage, should Current be disabled?
|
||||
create {CMS_TEMPORAL_USER_STORAGE_NULL} l_user_auth_storage
|
||||
create {CMS_TEMP_USER_STORAGE_NULL} l_user_auth_storage
|
||||
end
|
||||
|
||||
-- API initialization
|
||||
@@ -128,7 +128,7 @@ feature {CMS_API} -- Module Initialization
|
||||
|
||||
feature {CMS_API} -- Access: API
|
||||
|
||||
auth_api: detachable CMS_USER_TEMP_API
|
||||
auth_api: detachable CMS_TEMP_USER_API
|
||||
-- <Precursor>
|
||||
|
||||
feature -- Router
|
||||
@@ -252,7 +252,7 @@ feature -- Handler
|
||||
local
|
||||
r: CMS_RESPONSE
|
||||
l_user_api: CMS_USER_API
|
||||
u: CMS_TEMPORAL_USER
|
||||
u: CMS_TEMP_USER
|
||||
l_exist: BOOLEAN
|
||||
es: CMS_AUTHENTICATON_EMAIL_SERVICE
|
||||
l_url_activate: STRING
|
||||
@@ -337,19 +337,19 @@ feature -- Handler
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
if r.has_permission ("account activate") then
|
||||
if attached {WSF_STRING} req.path_parameter ("token") as l_token then
|
||||
if attached {CMS_TEMPORAL_USER} l_auth_api.user_by_activation_token (l_token.value) as l_user then
|
||||
if attached {CMS_TEMP_USER} l_auth_api.user_by_activation_token (l_token.value) as l_user then
|
||||
|
||||
-- TODO copy the personal information
|
||||
--! to CMS_USER_PROFILE and persist data
|
||||
--! check also CMS_USER.data_items
|
||||
|
||||
-- Delete temporal User
|
||||
l_auth_api.delete_temporary_user (l_user)
|
||||
l_auth_api.delete_temp_user (l_user)
|
||||
|
||||
-- Valid user_id
|
||||
l_user.set_id (0)
|
||||
l_user.mark_active
|
||||
l_auth_api.new_user_from_temporal_user (l_user)
|
||||
l_auth_api.new_user_from_temp_user (l_user)
|
||||
l_auth_api.remove_activation (l_token.value)
|
||||
r.set_main_content ("<p> The account <i>" + l_user.name + "</i> has been activated</p>")
|
||||
-- Send Email
|
||||
@@ -388,8 +388,8 @@ feature -- Handler
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
if r.has_permission ("account reject") then
|
||||
if attached {WSF_STRING} req.path_parameter ("token") as l_token then
|
||||
if attached {CMS_USER} l_auth_api.user_by_activation_token (l_token.value) as l_user then
|
||||
l_auth_api.delete_temporary_user (l_user)
|
||||
if attached {CMS_TEMP_USER} l_auth_api.user_by_activation_token (l_token.value) as l_user then
|
||||
l_auth_api.delete_temp_user (l_user)
|
||||
r.set_main_content ("<p> The temporal account for <i>" + l_user.name + "</i> has been removed</p>")
|
||||
-- Send Email
|
||||
if attached l_user.email as l_email then
|
||||
@@ -432,7 +432,7 @@ feature -- Handler
|
||||
if req.is_post_request_method then
|
||||
if attached {WSF_STRING} req.form_parameter ("email") as l_email then
|
||||
l_user_api := api.user_api
|
||||
if attached {CMS_TEMPORAL_USER} l_auth_api.user_by_email (l_email.value) as l_user then
|
||||
if attached {CMS_TEMP_USER} l_auth_api.user_by_email (l_email.value) as l_user then
|
||||
-- User exist create a new token and send a new email.
|
||||
if l_user.is_active then
|
||||
r.set_value ("The asociated user to the given email " + l_email.value + " , is already active", "is_active")
|
||||
@@ -593,7 +593,7 @@ feature -- Handler
|
||||
local
|
||||
l_response: CMS_RESPONSE
|
||||
s: STRING
|
||||
u: CMS_TEMPORAL_USER
|
||||
u: CMS_TEMP_USER
|
||||
l_page_helper: CMS_PAGINATION_GENERATOR
|
||||
s_pager: STRING
|
||||
l_count: INTEGER
|
||||
|
||||
@@ -4,7 +4,7 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_USER_TEMP_API
|
||||
CMS_TEMP_USER_API
|
||||
|
||||
inherit
|
||||
CMS_MODULE_API
|
||||
@@ -16,7 +16,7 @@ create {CMS_AUTHENTICATION_MODULE}
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_with_storage (a_api: CMS_API; a_auth_storage: CMS_TEMPORAL_USER_STORAGE_I)
|
||||
make_with_storage (a_api: CMS_API; a_auth_storage: CMS_TEMP_USER_STORAGE_I)
|
||||
-- Create an object with api `a_api' and storage `a_auth_storage'.
|
||||
do
|
||||
auth_storage := a_auth_storage
|
||||
@@ -52,7 +52,7 @@ feature -- Access
|
||||
Result := auth_storage.user_by_activation_token (a_token)
|
||||
end
|
||||
|
||||
recent_users (params: CMS_DATA_QUERY_PARAMETERS): ITERABLE [CMS_TEMPORAL_USER]
|
||||
recent_users (params: CMS_DATA_QUERY_PARAMETERS): ITERABLE [CMS_TEMP_USER]
|
||||
-- List of the `a_rows' most recent users starting from `a_offset'.
|
||||
do
|
||||
Result := auth_storage.recent_users (params.offset.to_integer_32, params.size.to_integer_32)
|
||||
@@ -65,7 +65,7 @@ feature -- Access
|
||||
|
||||
feature -- Temp User
|
||||
|
||||
new_user_from_temporal_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_user_from_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- Add a new user `a_user'.
|
||||
require
|
||||
no_id: not a_user.has_id
|
||||
@@ -85,7 +85,7 @@ feature -- Temp User
|
||||
end
|
||||
end
|
||||
|
||||
new_temp_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- Add a new user `a_user'.
|
||||
require
|
||||
no_id: not a_user.has_id
|
||||
@@ -109,7 +109,7 @@ feature -- Temp User
|
||||
auth_storage.remove_activation (a_token)
|
||||
end
|
||||
|
||||
delete_temporary_user (a_user: CMS_USER)
|
||||
delete_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- Delete user `a_user'.
|
||||
require
|
||||
has_id: a_user.has_id
|
||||
@@ -121,7 +121,7 @@ feature -- Temp User
|
||||
|
||||
feature {CMS_MODULE} -- Access: User auth storage.
|
||||
|
||||
auth_storage: CMS_TEMPORAL_USER_STORAGE_I
|
||||
auth_storage: CMS_TEMP_USER_STORAGE_I
|
||||
-- storage interface.
|
||||
|
||||
end
|
||||
@@ -1,10 +1,10 @@
|
||||
note
|
||||
description: "Summary description for {CMS_TEMPORAL_USER}."
|
||||
description: "Summary description for {CMS_TEMP_USER}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_TEMPORAL_USER
|
||||
CMS_TEMP_USER
|
||||
|
||||
inherit
|
||||
|
||||
@@ -6,7 +6,7 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_TEMPORAL_USER_STORAGE_I
|
||||
CMS_TEMP_USER_STORAGE_I
|
||||
|
||||
inherit
|
||||
SHARED_LOGGER
|
||||
@@ -57,7 +57,7 @@ feature -- Access: Users
|
||||
password: Result /= Void implies (Result.hashed_password /= Void and Result.password = Void)
|
||||
end
|
||||
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMPORAL_USER]
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMP_USER]
|
||||
-- List of recent `a_count' temporal users with an offset of `lower'.
|
||||
deferred
|
||||
end
|
||||
@@ -71,7 +71,7 @@ feature -- Access: Users
|
||||
|
||||
feature -- New Temp User
|
||||
|
||||
new_user_from_temporal_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_user_from_temporal_user (a_user: CMS_TEMP_USER)
|
||||
-- new user from temporal user `a_user'
|
||||
require
|
||||
no_id: not a_user.has_id
|
||||
@@ -83,14 +83,14 @@ feature -- New Temp User
|
||||
deferred
|
||||
end
|
||||
|
||||
new_temp_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- New temp user `a_user'.
|
||||
require
|
||||
no_id: not a_user.has_id
|
||||
deferred
|
||||
end
|
||||
|
||||
delete_user (a_user: CMS_USER)
|
||||
delete_user (a_user: CMS_TEMP_USER)
|
||||
-- Delete user `a_user'.
|
||||
require
|
||||
has_id: a_user.has_id
|
||||
@@ -1,14 +1,14 @@
|
||||
note
|
||||
description: "Summary description for {CMS_TEMPORAL_USER_STORAGE_NULL}."
|
||||
description: "Summary description for {CMS_TEMP_USER_STORAGE_NULL}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_TEMPORAL_USER_STORAGE_NULL
|
||||
CMS_TEMP_USER_STORAGE_NULL
|
||||
|
||||
inherit
|
||||
|
||||
CMS_TEMPORAL_USER_STORAGE_I
|
||||
CMS_TEMP_USER_STORAGE_I
|
||||
|
||||
|
||||
feature -- Error handler
|
||||
@@ -46,10 +46,10 @@ feature -- Access: Users
|
||||
do
|
||||
end
|
||||
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMPORAL_USER]
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMP_USER]
|
||||
-- List of recent `a_count' temporal users with an offset of `lower'.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_TEMPORAL_USER]} Result.make (0)
|
||||
create {ARRAYED_LIST[CMS_TEMP_USER]} Result.make (0)
|
||||
end
|
||||
|
||||
token_by_user_id (a_id: like {CMS_USER}.id): detachable STRING
|
||||
@@ -59,7 +59,7 @@ feature -- Access: Users
|
||||
|
||||
feature -- Temp Users
|
||||
|
||||
new_user_from_temporal_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_user_from_temporal_user (a_user: CMS_TEMP_USER)
|
||||
-- <Precursor>
|
||||
do
|
||||
end
|
||||
@@ -70,12 +70,12 @@ feature -- Temp Users
|
||||
do
|
||||
end
|
||||
|
||||
new_temp_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- <Precursor>
|
||||
do
|
||||
end
|
||||
|
||||
delete_user (a_user: CMS_USER)
|
||||
delete_user (a_user: CMS_TEMP_USER)
|
||||
-- <Precursor>
|
||||
do
|
||||
end
|
||||
@@ -1,13 +1,13 @@
|
||||
note
|
||||
description: "Summary description for {CMS_TEMPORAL_USER_STORAGE_SQL}."
|
||||
description: "Summary description for {CMS_TEMP_USER_STORAGE_SQL}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_TEMPORAL_USER_STORAGE_SQL
|
||||
CMS_TEMP_USER_STORAGE_SQL
|
||||
|
||||
inherit
|
||||
CMS_TEMPORAL_USER_STORAGE_I
|
||||
CMS_TEMP_USER_STORAGE_I
|
||||
|
||||
CMS_PROXY_STORAGE_SQL
|
||||
|
||||
@@ -113,12 +113,12 @@ feature -- Access User
|
||||
sql_finalize
|
||||
end
|
||||
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMPORAL_USER]
|
||||
recent_users (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_TEMP_USER]
|
||||
-- <Precursor>
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
do
|
||||
create {ARRAYED_LIST [CMS_TEMPORAL_USER]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_TEMP_USER]} Result.make (0)
|
||||
|
||||
error_handler.reset
|
||||
write_information_log (generator + ".recent_users")
|
||||
@@ -162,7 +162,7 @@ feature -- Access User
|
||||
|
||||
feature {NONE} -- Implementation: User
|
||||
|
||||
fetch_user: detachable CMS_TEMPORAL_USER
|
||||
fetch_user: detachable CMS_TEMP_USER
|
||||
local
|
||||
l_id: INTEGER_64
|
||||
l_name: detachable READABLE_STRING_32
|
||||
@@ -204,7 +204,7 @@ feature {NONE} -- Implementation: User
|
||||
|
||||
feature -- New Temp User
|
||||
|
||||
new_user_from_temporal_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_user_from_temporal_user (a_user: CMS_TEMP_USER)
|
||||
-- <Precursor>
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
@@ -242,7 +242,7 @@ feature -- New Temp User
|
||||
end
|
||||
end
|
||||
|
||||
new_temp_user (a_user: CMS_TEMPORAL_USER)
|
||||
new_temp_user (a_user: CMS_TEMP_USER)
|
||||
-- Add a new temp_user `a_user'.
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
@@ -301,7 +301,7 @@ feature -- Remove Activation
|
||||
sql_finalize
|
||||
end
|
||||
|
||||
delete_user (a_user: CMS_USER)
|
||||
delete_user (a_user: CMS_TEMP_USER)
|
||||
-- Delete user `a_user'.
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<p>You have required a new password at <a href="$host">$sitename</a></p>
|
||||
|
||||
<p>To complete your request, please click on this link to genereate a new password:<p>
|
||||
<p>To complete your request, please click on this link to generate a new password:<p>
|
||||
|
||||
<p><a href="$link">$link</a></p>
|
||||
</body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="author" content="$sitename">
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to<a href="$host">$sitename</a></p>
|
||||
<p>Welcome to <a href="$host">$sitename</a></p>
|
||||
<p>Thank you for joining us.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<h2> Account Evaluation </h2>
|
||||
<p>The user $user ($email) wants to register to the site <a href="$host">$sitename</a></p>
|
||||
|
||||
<blockquote><p>This is his/her application.</p>
|
||||
<blockquote><p>User application:</p>
|
||||
<p>$application</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
DROP TABLE IF EXISTS "auth_temp_users";
|
||||
CREATE TABLE `auth_temp_users` (
|
||||
`uid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
@@ -11,3 +9,5 @@ CREATE TABLE `auth_temp_users` (
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
DROP TABLE IF EXISTS "auth_temp_users";
|
||||
CREATE TABLE `auth_temp_users` (
|
||||
`uid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
`password` VARCHAR(100) NOT NULL,
|
||||
`salt` VARCHAR(100) NOT NULL,
|
||||
`email` VARCHAR(250) NOT NULL,
|
||||
`application` TEXT NOT NULL,
|
||||
CONSTRAINT `name`
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<h1 class="page-title">Listing 4 Pending Registrations</h1>
|
||||
<ul class="cms-registrations">
|
||||
<li class="cms_pending_user">
|
||||
<ul>
|
||||
<li>
|
||||
Javier - javier@testing
|
||||
</li>
|
||||
<li>
|
||||
Software Developer
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="http://localhost:9090/admin/user/2">activate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://localhost:9090/admin/user/2">reject</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user