Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
b178a859
Commit
b178a859
authored
May 25, 2018
by
Cecilia Vela Gurovic
Browse files
Bug 1773707: Catching exception in delete users script
behatnotneeded Change-Id: I9f2bf9d7db925e135107659e2d8e4e8b38d5f7ef
parent
c6f82f81
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/cli/delete_inactive_users.php
View file @
b178a859
...
...
@@ -155,7 +155,14 @@ if ($records = get_records_sql_array($selectsql . $joinsql . $wheresql, $values)
if
(
!
$dryrun
)
{
$cli
->
cli_print
(
"--- "
.
date
(
'Y-m-d H:i:s'
,
time
())
.
" ---"
);
foreach
(
$records
as
$record
)
{
delete_user
(
$record
->
id
);
try
{
$DB_IGNORE_SQL_EXCEPTIONS
=
true
;
delete_user
(
$record
->
id
);
$DB_IGNORE_SQL_EXCEPTIONS
=
false
;
}
catch
(
SQLException
$e
)
{
$cli
->
cli_print
(
get_string
(
'cli_deleteinactiveusers_userunabletodelete'
,
'admin'
,
$record
->
username
,
$record
->
id
));
}
if
(
$cleanusers
)
{
try
{
$DB_IGNORE_SQL_EXCEPTIONS
=
true
;
...
...
htdocs/lang/en.utf8/admin.php
View file @
b178a859
...
...
@@ -1343,6 +1343,7 @@ $string['cli_deleteinactiveusers_neverloggedin'] = 'Delete users that have never
$string
[
'cli_param_baddate'
]
=
'The supplied date "%s" is not valid.'
;
$string
[
'cli_deleteinactiveusers_usercount'
]
=
'There are "%s" users to delete'
;
$string
[
'cli_deleteinactiveusers_userunabletoclean'
]
=
'Unable to fully delete user "%s" (ID %s)'
;
$string
[
'cli_deleteinactiveusers_userunabletodelete'
]
=
'Unable to delete user "%s" (ID %s)'
;
$string
[
'cli_deleteinactiveusers_nouserstodelete'
]
=
'There are no users to delete.'
;
$string
[
'cli_deleteinactiveusers_onlydryrun1'
]
=
'This is only a dry run with the following settings
Institution: %s
...
...
Write
Preview
Supports
Markdown
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