Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
ec1e7742
Commit
ec1e7742
authored
Nov 07, 2017
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed display of users with missing member_state
parent
aeaa8e43
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
51 deletions
+98
-51
user-admin-info.tcl
lib/user-admin-info.tcl
+10
-5
user-admin-info.xql
lib/user-admin-info.xql
+21
-14
user-basic-info.tcl
lib/user-basic-info.tcl
+1
-0
user-basic-info.xql
lib/user-basic-info.xql
+21
-15
member-notify.tcl
www/member-notify.tcl
+24
-2
view.tcl
www/users/view.tcl
+21
-15
No files found.
lib/user-admin-info.tcl
View file @
ec1e7742
...
@@ -29,6 +29,7 @@ if {!$read} {
...
@@ -29,6 +29,7 @@ if {!$read} {
set
date_format
"YYYY-MM-DD"
set
date_format
"YYYY-MM-DD"
set
result
[
db_0or1row users_info_query
{}]
set
result
[
db_0or1row users_info_query
{}]
if
{
""
eq
$member
_state
}
{
set member_state
"undefined"
}
if
{
$result
> 1
}
{
if
{
$result
> 1
}
{
ad_return_complaint
"
[
_ intranet-core.Bad_User
]
"
"
ad_return_complaint
"
[
_ intranet-core.Bad_User
]
"
"
...
@@ -57,12 +58,16 @@ case $member_state {
...
@@ -57,12 +58,16 @@ case $member_state {
set
activate_delete_link
""
set
activate_delete_link
""
if
{
$admin
}
{
if
{
$admin
}
{
append activate_delete_link
"("
append activate_delete_link
"("
if
{
"approved"
!=
$member
_state
}
{
append activate_delete_link
"<a href=/acs-admin/users/member-state-change?member_state=approved&
[
export_vars
{
user_id return_url
}]
>
[
_ intranet-core.activate
]
</a>"
switch
$member
_state
{
"approved"
{
append activate_delete_link
"<a href=/intranet/users/member-state-change?member_state=banned&
[
export_vars
{
user_id return_url
}]
>
[
_ intranet-core.delete
]
</a>"
}
"banned"
{
append activate_delete_link
"<a href=/acs-admin/users/member-state-change?member_state=approved&
[
export_vars
{
user_id return_url
}]
>
[
_ intranet-core.activate
]
</a> "
}
}
}
if
{
"banned"
!=
$member
_state
}
{
append activate_delete_link
"<a href=/intranet/users/member-state-change?member_state=banned&
[
export_vars
{
user_id return_url
}]
>
[
_ intranet-core.delete
]
</a>"
}
append activate_delete_link
")"
append activate_delete_link
")"
}
}
...
...
lib/user-admin-info.xql
View file @
ec1e7742
...
@@ -9,27 +9,34 @@
...
@@ -9,27 +9,34 @@
</rdbms>
</rdbms>
<fullquery
name=
"users_info_query"
>
<fullquery
name=
"users_info_query"
>
<querytext>
<querytext>
select
u.first_names,
select
u.last_name,
pe.first_names,
pe.last_name,
im_name_from_user_id(u.user_id) as name,
im_name_from_user_id(u.user_id) as name,
u
.email,
pa
.email,
u
.url,
pa
.url,
u
.creation_date as registration_date,
o
.creation_date as registration_date,
u
.creation_ip as registration_ip,
o
.creation_ip as registration_ip,
to_char(u.last_visit, :date_format) as last_visit,
to_char(u.last_visit, :date_format) as last_visit,
u.screen_name,
u.screen_name,
u.username,
u.username,
u.member_state,
(select member_state from membership_rels where rel_id in (
coalesce(u.creation_user, 0) as creation_user_id,
select rel_id from acs_rels where object_id_two = u.user_id and object_id_one = -2
coalesce(im_name_from_user_id(u.creation_user), 'system') as creation_user_name,
)) as member_state,
o.creation_user as creation_user_id,
im_name_from_user_id(o.creation_user) as creation_user_name,
auth.short_name as authority_short_name,
auth.short_name as authority_short_name,
auth.pretty_name as authority_pretty_name
auth.pretty_name as authority_pretty_name
from
from acs_objects o,
cc_users u
persons pe,
parties pa,
users u
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
where
where u.user_id = :user_id_from_search and
u.user_id = :user_id_from_search
u.user_id = pe.person_id and
u.user_id = pa.party_id and
u.user_id = o.object_id
</querytext>
</querytext>
</fullquery>
</fullquery>
...
...
lib/user-basic-info.tcl
View file @
ec1e7742
...
@@ -56,6 +56,7 @@ if {!$read} {
...
@@ -56,6 +56,7 @@ if {!$read} {
# ---------------------------------------------------------------
# ---------------------------------------------------------------
set
result
[
db_0or1row users_info_query
{}]
set
result
[
db_0or1row users_info_query
{}]
if
{
""
eq
$member
_state
}
{
set member_state
"undefined"
}
if
{
$result
> 1
}
{
if
{
$result
> 1
}
{
ad_return_complaint
"
[
_ intranet-core.Bad_User
]
"
"
ad_return_complaint
"
[
_ intranet-core.Bad_User
]
"
"
...
...
lib/user-basic-info.xql
View file @
ec1e7742
...
@@ -9,27 +9,33 @@
...
@@ -9,27 +9,33 @@
</rdbms>
</rdbms>
<fullquery
name=
"users_info_query"
>
<fullquery
name=
"users_info_query"
>
<querytext>
<querytext>
select
select
u
.first_names,
pe
.first_names,
u
.last_name,
pe
.last_name,
im_name_from_user_id(u.user_id) as name,
im_name_from_user_id(u.user_id) as name,
u
.email,
pa
.email,
u
.url,
pa
.url,
u
.creation_date as registration_date,
o
.creation_date as registration_date,
u
.creation_ip as registration_ip,
o
.creation_ip as registration_ip,
to_char(u.last_visit, :date_format) as last_visit,
to_char(u.last_visit, :date_format) as last_visit,
u.screen_name,
u.screen_name,
u.username,
u.username,
u.member_state,
(select member_state from membership_rels where rel_id in (
u.creation_user as creation_user_id,
select rel_id from acs_rels where object_id_two = u.user_id and object_id_one = -2
im_name_from_user_id(u.creation_user) as creation_user_name,
)) as member_state,
o.creation_user as creation_user_id,
im_name_from_user_id(o.creation_user) as creation_user_name,
auth.short_name as authority_short_name,
auth.short_name as authority_short_name,
auth.pretty_name as authority_pretty_name
auth.pretty_name as authority_pretty_name
from
from acs_objects o,
cc_users u
persons pe,
parties pa,
users u
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
where
where u.user_id = :user_id_from_search and
u.user_id = :user_id_from_search
u.user_id = pe.person_id and
u.user_id = pa.party_id and
u.user_id = o.object_id
</querytext>
</querytext>
</fullquery>
</fullquery>
...
@@ -94,4 +100,4 @@ where
...
@@ -94,4 +100,4 @@ where
</fullquery>
</fullquery>
</queryset>
</queryset>
\ No newline at end of file
www/member-notify.tcl
View file @
ec1e7742
...
@@ -56,6 +56,13 @@ if { "" != $cancel } {
...
@@ -56,6 +56,13 @@ if { "" != $cancel } {
ad_script_abort
ad_script_abort
}
}
# Should we wait a second after sending out an email?
# This is necessary for 1and1 because of a limit of
# max 5000 emails per hour
set
throttle_seconds
[
parameter::get_from_package_key -package_key
"intranet-core"
-parameter ThrottleEmailSendingSeconds -default 0.8
]
set
error_list
[]
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
@@ -284,6 +291,11 @@ foreach email $email_list {
...
@@ -284,6 +291,11 @@ foreach email $email_list {
set message_subst
[
lang::message::format
$message
$substitution
_list
]
set message_subst
[
lang::message::format
$message
$substitution
_list
]
}
}
# Remember the date of the last email
if
{[
im_column_exists persons last_email_sent
]}
{
db_dml update_last_email
"update persons set last_email_sent = now() where person_id = :user_id"
}
if
{[
catch
{
if
{[
catch
{
acs_mail_lite::send
\
acs_mail_lite::send
\
-send_immediately
\
-send_immediately
\
...
@@ -294,9 +306,13 @@ foreach email $email_list {
...
@@ -294,9 +306,13 @@ foreach email $email_list {
-file_ids
$attachment
_ci_id
-file_ids
$attachment
_ci_id
}
errmsg
]}
{
}
errmsg
]}
{
ns_log Error
"member-notify: Error sending to
\"
$email
\"
:
$errmsg
"
ns_log Error
"member-notify: Error sending to
\"
$email
\"
:
$errmsg
"
ad_return_error
$subject
"<p>Error sending out mail:</p><div><code>
[
ns_quotehtml
$errmsg
]
</code></div>"
lappend error_list
"<p>Error sending out mail to:
$email
</p><div><code>
[
ns_quotehtml
$errmsg
]
</code></div>"
ad_script_abort
}
if
{
$throttle
_seconds > 0
}
{
im_exec sleep
$throttle
_seconds
}
}
}
}
...
@@ -312,5 +328,11 @@ if {$process_mail_queue_now_p} {
...
@@ -312,5 +328,11 @@ if {$process_mail_queue_now_p} {
# This page has not confirmation screen but just returns
# This page has not confirmation screen but just returns
# ---------------------------------------------------------------
# ---------------------------------------------------------------
if
{
""
ne
$error
_list
}
{
ad_return_complaint 1
"<ul><li>
[
join
$error
_list
"
\n
<li>"
]
</ul>"
}
ad_returnredirect
$return
_url
ad_returnredirect
$return
_url
www/users/view.tcl
View file @
ec1e7742
...
@@ -80,35 +80,41 @@ if {!$read} {
...
@@ -80,35 +80,41 @@ if {!$read} {
set
result
[
db_0or1row users_info_query
"
set
result
[
db_0or1row users_info_query
"
select
select
u
.first_names,
pe
.first_names,
u
.last_name,
pe
.last_name,
im_name_from_user_id(u.user_id) as name,
im_name_from_user_id(u.user_id) as name,
u
.email,
pa
.email,
u
.url,
pa
.url,
u
.creation_date as registration_date,
o
.creation_date as registration_date,
u
.creation_ip as registration_ip,
o
.creation_ip as registration_ip,
to_char(u.last_visit, :date_format) as last_visit,
to_char(u.last_visit, :date_format) as last_visit,
u.screen_name,
u.screen_name,
u.username,
u.username,
u.member_state,
(select member_state from membership_rels where rel_id in (
u.creation_user as creation_user_id,
select rel_id from acs_rels where object_id_two = u.user_id and object_id_one = -2
im_name_from_user_id(u.creation_user) as creation_user_name,
)) as member_state,
o.creation_user as creation_user_id,
im_name_from_user_id(o.creation_user) as creation_user_name,
auth.short_name as authority_short_name,
auth.short_name as authority_short_name,
auth.pretty_name as authority_pretty_name
auth.pretty_name as authority_pretty_name
from
from acs_objects o,
cc_users u
persons pe,
parties pa,
users u
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
LEFT OUTER JOIN auth_authorities auth ON (u.authority_id = auth.authority_id)
where
where u.user_id = :user_id_from_search and
u.user_id = :user_id_from_search
u.user_id = pe.person_id and
u.user_id = pa.party_id and
u.user_id = o.object_id
"
]
"
]
if
{
$result
> 1
}
{
if
{
$result
> 1
}
{
ad_return_complaint 1
"<b>
[
_ intranet-core.Bad_User
]
</b>:<br>
ad_return_complaint 1
"<b>
[
_ intranet-core.Bad_User
]
</b>:<br>
<li>There is more then one user with the ID
$user
_id_from_search"
<li>There is more then one user with the ID
$user
_id_from_search"
ad_script_abort
ad_script_abort
}
}
if
{
$result
== 0
}
{
if
{
$result
== 0
}
{
set party_id
[
db_string party
"select party_id from parties where party_id=:user_id_from_search"
-default 0
]
set party_id
[
db_string party
"select party_id from parties where party_id=:user_id_from_search"
-default 0
]
set person_id
[
db_string person
"select person_id from persons where person_id=:user_id_from_search"
-default 0
]
set person_id
[
db_string person
"select person_id from persons where person_id=:user_id_from_search"
-default 0
]
set user_id
[
db_string user
"select user_id from users where user_id=:user_id_from_search"
-default 0
]
set user_id
[
db_string user
"select user_id from users where user_id=:user_id_from_search"
-default 0
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment