Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
328143f8
Commit
328143f8
authored
11 years ago
by
Christopher Smith
Browse files
Options
Downloads
Patches
Plain Diff
enable email notifications & alert messages for imported users
parent
ae1afd2f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/plugins/usermanager/admin.php
+21
-7
21 additions, 7 deletions
lib/plugins/usermanager/admin.php
lib/plugins/usermanager/lang/en/lang.php
+2
-1
2 additions, 1 deletion
lib/plugins/usermanager/lang/en/lang.php
with
23 additions
and
8 deletions
lib/plugins/usermanager/admin.php
+
21
−
7
View file @
328143f8
...
...
@@ -606,12 +606,16 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
/**
* send password change notification email
*/
function
_notifyUser
(
$user
,
$password
)
{
function
_notifyUser
(
$user
,
$password
,
$status_alert
=
true
)
{
if
(
$sent
=
auth_sendPassword
(
$user
,
$password
))
{
msg
(
$this
->
lang
[
'notify_ok'
],
1
);
if
(
$status_alert
)
{
msg
(
$this
->
lang
[
'notify_ok'
],
1
);
}
}
else
{
msg
(
$this
->
lang
[
'notify_fail'
],
-
1
);
if
(
$status_alert
)
{
msg
(
$this
->
lang
[
'notify_fail'
],
-
1
);
}
}
return
$sent
;
...
...
@@ -770,7 +774,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
array_splice
(
$raw
,
1
,
0
,
auth_pwgen
());
// splice in a generated password
$clean
=
$this
->
_cleanImportUser
(
$raw
,
$error
);
if
(
$clean
&&
$this
->
_addImportUser
(
$clean
,
$error
))
{
# $this->_notifyUser($clean[0],$clean[1]);
$sent
=
$this
->
_notifyUser
(
$clean
[
0
],
$clean
[
1
],
false
);
if
(
!
$sent
){
msg
(
sprintf
(
$this
->
lang
[
'import_notify_fail'
],
$clean
[
0
],
$clean
[
3
]),
-
1
);
}
$import_success_count
++
;
}
else
{
$import_fail_count
++
;
...
...
@@ -817,9 +824,16 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
return
false
;
}
if
(
!
(
$this
->
_auth
->
canDo
(
'modMail'
)
xor
empty
(
$mail
))){
$error
=
$this
->
lang
[
'import_error_badmail'
];
return
false
;
if
(
$this
->
_auth
->
canDo
(
'modMail'
))
{
if
(
empty
(
$mail
)
||
!
mail_isvalid
(
$mail
))
{
$error
=
$this
->
lang
[
'import_error_badmail'
];
return
false
;
}
}
else
{
if
(
!
empty
(
$mail
))
{
$error
=
$this
->
lang
[
'import_error_badmail'
];
return
false
;
}
}
return
$cleaned
;
...
...
This diff is collapsed.
Click to expand it.
lib/plugins/usermanager/lang/en/lang.php
+
2
−
1
View file @
328143f8
...
...
@@ -67,9 +67,10 @@ $lang['import_failure_count'] = 'User Import: %d failed. Failures are listed bel
$lang
[
'import_error_fields'
]
=
"Insufficient fields, found %d, require 4."
;
$lang
[
'import_error_baduserid'
]
=
"User-id missing"
;
$lang
[
'import_error_badname'
]
=
'Bad name'
;
$lang
[
'import_error_badmail'
]
=
'Bad mail'
;
$lang
[
'import_error_badmail'
]
=
'Bad
e
mail
address
'
;
$lang
[
'import_error_upload'
]
=
'Import Failed. The csv file could not be uploaded or is empty.'
;
$lang
[
'import_error_readfail'
]
=
'Import Failed. Unable to read uploaded file.'
;
$lang
[
'import_error_create'
]
=
'Unable to create the user'
;
$lang
[
'import_notify_fail'
]
=
'Notification message could not be sent for imported user, %s with email %s.'
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment