Commit 4c9e818a authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1446017: Adding send message when approving new user account"

parents fac9f25f fae98e44
......@@ -35,6 +35,13 @@ if ($action == 'approve') {
$message = get_string('approveregistrationmessage', 'admin', $inst->displayname);
$submitbtn = get_string('approve', 'admin');
define('TITLE', get_string('approveregistrationfor2', 'admin', $registration->firstname, $registration->lastname, $registration->email));
$elements['message'] = array(
'type' => 'textarea',
'title' => get_string('registrationapprovedmessage', 'admin'),
'description' => get_string('registrationapproveddesc', 'admin'),
'cols' => 50,
'rows' => 10,
);
if ($registration->institution != 'mahara') {
$elements['institutionstaff'] = array(
'type' => 'switchbox',
......@@ -86,7 +93,7 @@ function denyregistration_submit(Pieform $form, $values) {
if (isset($values['message']) && !empty($values['message'])) {
$message = get_string('registrationdeniedmessagereason', 'auth.internal',
$values['firstname'], get_config('sitename'), $values['message'], display_name($USER));
$values['firstname'], get_config('sitename'), hsc($values['message']), display_name($USER));
}
else {
$message = get_string('registrationdeniedmessage', 'auth.internal',
......@@ -143,30 +150,59 @@ function approveregistration_submit(Pieform $form, $values) {
$user->firstname = $values['firstname'];
$user->lastname = $values['lastname'];
$user->email = $values['email'];
if (isset($values['message']) && !empty($values['message'])) {
$message = get_string(
'registeredemailmessagetextmessage',
'auth.webservice',
$user->firstname,
get_config('sitename'),
hsc($values['message']),
get_config('wwwroot'),
$values['key'],
get_config('sitename')
);
$htmlmessage = get_string(
'registeredemailmessagehtmlmessage',
'auth.webservice',
$user->firstname,
get_config('sitename'),
hsc($values['message']),
get_config('wwwroot'),
$values['key'],
get_config('wwwroot'),
$values['key'],
get_config('sitename')
);
}
else {
$message = get_string(
'registeredemailmessagetext',
'auth.internal',
$user->firstname,
get_config('sitename'),
get_config('wwwroot'),
$values['key'],
get_config('sitename')
);
$htmlmessage = get_string(
'registeredemailmessagehtml',
'auth.internal',
$user->firstname,
get_config('sitename'),
get_config('wwwroot'),
$values['key'],
get_config('wwwroot'),
$values['key'],
get_config('sitename')
);
}
email_user(
$user,
null,
get_string('registeredemailsubject', 'auth.internal', get_config('sitename')),
get_string(
'registeredemailmessagetext',
'auth.internal',
$user->firstname,
get_config('sitename'),
get_config('wwwroot'),
$values['key'],
get_config('sitename')
),
get_string(
'registeredemailmessagehtml',
'auth.internal',
$user->firstname,
get_config('sitename'),
get_config('wwwroot'),
$values['key'],
get_config('wwwroot'),
$values['key'],
get_config('sitename')
)
$user,
null,
get_string('registeredemailsubject', 'auth.internal', get_config('sitename')),
$message,
$htmlmessage
);
$SESSION->add_ok_msg(get_string('registrationapprovedsuccessfully', 'admin'));
......
......@@ -35,12 +35,46 @@ The link will expire in 24 hours.
--
Regards,
The %s Team';
$string['registeredemailmessagetextmessage'] = 'Hello %s,
Thank you for registering an account on %s.
%s
Please follow this link to
complete the signup process:
%sregister.php?key=%s
The link will expire in 24 hours.
--
Regards,
The %s Team';
$string['registeredemailmessagehtmlmessage'] = '<p>Hello %s,</p>
<p>Thank you for registering an account on %s.</p>
<p>%s</p>
<p>Please follow this link
to complete the signup process:</p>
<p><a href="%sregister.php?key=%s">%sregister.php?key=%s</a></p>
<p>The link will expire in 24 hours.</p>
<pre>--
Regards,
The %s Team</pre>';
$string['registeredemailmessagehtml'] = '<p>Hello %s,</p>
<p>Thank you for registering an account on %s. Please follow this link
to complete the signup process:</p>
<p><a href="%sregister.php?key=%s">%sregister.php?key=%s</a></p>
<p>The link will expire in 24 hours.</p>
<pre>--
Regards,
The %s Team</pre>';
......@@ -398,4 +432,4 @@ $string['featuredisabled'] = 'This web services feature is not enabled. Please c
$string['institutionunknown'] = '- unknown -';
$string['unabletodeleteadmin'] = 'Unable to delete user with ID "%s" as they are an admin';
$string['notuserblog'] = 'The journal is not owned by "%s"';
$string['oneof'] = 'One of';
\ No newline at end of file
$string['oneof'] = 'One of';
......@@ -1119,6 +1119,8 @@ $string['pendingdeletiondesc'] = 'Approve or deny the deletion of users who wish
$string['pendingusercompletion'] = 'Approval sent, waiting on user completion';
$string['nosuchinstitution'] = 'No such institution.';
$string['registrationapprovedsuccessfully'] = 'Registration approved successfully.';
$string['registrationapprovedmessage'] = 'Registration message:';
$string['registrationapproveddesc'] = 'Additional information for newly registered users.';
$string['registrationdeniedreason'] = 'Denial reason';
$string['registrationdeniedreasondesc'] = 'Information as to why the application was denied that might help the user.';
$string['registrationdeniedsuccessful'] = 'Registration denied successfully.';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment