Commit e75240bf authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Merge commit 'origin/master' into feedback

parents 968411f1 1d6f8211
......@@ -77,6 +77,7 @@ $string['moreoptions'] = 'More options';
$string['mustspecifytitle'] = 'You must specify a title for your post';
$string['mustspecifycontent'] = 'You must specify some content for your post';
$string['myblogs'] = 'My Blogs';
$string['myblog'] = 'My Blog';
$string['name'] = 'Name';
$string['newattachmentsexceedquota'] = 'The total size of the new files that you have uploaded to this post would exceed your quota. You may be able to save the post if you remove some of the attachments you have just added.';
$string['newblog'] = 'New Blog';
......
......@@ -48,11 +48,12 @@ class PluginArtefactBlog extends PluginArtefact {
}
public static function menu_items() {
global $USER;
return array(
array(
'path' => 'myportfolio/blogs',
'url' => 'artefact/blog/',
'title' => get_string('myblogs', 'artefact.blog'),
'title' => $USER->get_account_preference('multipleblogs') ? get_string('myblogs', 'artefact.blog') : get_string('myblog', 'artefact.blog'),
'weight' => 30,
),
);
......
......@@ -270,6 +270,7 @@ function profileform_submit(Pieform $form, $values) {
$key = get_random_key();
$key_url = get_config('wwwroot') . 'artefact/internal/validate.php?email=' . rawurlencode($email) . '&key=' . $key;
$key_url_decline = $key_url . '&decline=1';
try {
email_user(
......@@ -285,7 +286,7 @@ function profileform_submit(Pieform $form, $values) {
),
null,
get_string('emailvalidation_subject', 'artefact.internal'),
get_string('emailvalidation_body', 'artefact.internal', $USER->get('firstname'), $email, $key_url)
get_string('emailvalidation_body', 'artefact.internal', $USER->get('firstname'), $email, $key_url, $key_url_decline)
);
}
catch (EmailException $e) {
......
......@@ -90,7 +90,11 @@ $string['emailvalidation_subject'] = 'Email validation';
$string['emailvalidation_body'] = <<<EOF
Hello %s,
The email address %s has been added to your user account in Mahara. Please visit the link below to activate this address.
You have added email address %s to your user account in Mahara. Please visit the link below to activate this address.
%s
If this email belongs to you but you have not requested adding it to your Mahara account, follow the link below to decline email activation.
%s
EOF;
......@@ -101,6 +105,7 @@ $string['emailactivation'] = 'Email Activation';
$string['emailactivationsucceeded'] = 'Email Activation Successful';
$string['emailalreadyactivated'] = 'Email already activiated';
$string['emailactivationfailed'] = 'Email Activation Failed';
$string['emailactivationdeclined'] = 'Email Activation Declined Successfully';
$string['verificationlinkexpired'] = 'Verification link expired';
$string['invalidemailaddress'] = 'Invalid email address';
$string['unvalidatedemailalreadytaken'] = 'The e-mail address you are trying to validate is already taken';
......
......@@ -37,10 +37,16 @@ define('TITLE', get_string('emailactivation','artefact.internal'));
$email = param_variable('email');
$key = param_variable('key');
$decline = param_boolean('decline');
$row = get_record('artefact_internal_profile_email', 'email', $email, 'key', $key, null,null,'owner,artefact,email,verified,' . db_format_tsfield('expiry'));
if ($row) {
if ($decline) {
delete_records_select('artefact_internal_profile_email', 'verified=0 AND key=? AND email=?', array($key, $email));
$SESSION->add_ok_msg(get_string('emailactivationdeclined', 'artefact.internal'));
redirect(get_config('wwwroot'));
}
if ($row->expiry > time()) {
if ($row->artefact) {
$artefact = new ArtefactTypeEmail($row->artefact);
......
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