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
fb60fb4d
Commit
fb60fb4d
authored
May 28, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
May 28, 2018
Browse files
Merge "Bug 1773707: Catching exception in delete users script"
parents
e7be2559
b178a859
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/cli/delete_inactive_users.php
View file @
fb60fb4d
...
...
@@ -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 @
fb60fb4d
...
...
@@ -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