Commit b3cd93a0 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review

Merge changes I5cb8f297,I05a77e06 into 1.6_STABLE

* changes: Check that account is valid before logging in via password reset Bug1075760: reporting objectional material with no message doesn't get sent to admin with digest emails
parents 30d1409c 3475f03a
......@@ -232,6 +232,8 @@ function forgotpasschange_submit(Pieform $form, $values) {
// Remove the password request(s) for the user
delete_records('usr_password_request', 'usr', $values['user']);
ensure_user_account_is_active($user);
$USER->reanimate($user->id, $user->authinstance);
$SESSION->add_ok_msg(get_string('passwordchangedok'));
redirect();
......
......@@ -857,7 +857,10 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
}
$post->posttime = strftime(get_string('strftimedaydatetime'), $post->ctime);
$this->message = strip_tags(str_shorten_html($post->body, 200, true)); // For internal notifications.
// Some messages are all html and when they're 'cleaned' with
// strip_tags(str_shorten_html($post->body, 200, true)) for display,
// they are left empty. Use html2text instead.
$this->message = str_shorten_html(trim(html2text($post->body)), 200, true); // For internal notifications.
$post->textbody = trim(html2text($post->body));
$post->htmlbody = clean_html($post->body);
......
......@@ -4587,6 +4587,9 @@ function objection_form() {
'title' => get_string('complaint', 'view'),
'rows' => 5,
'cols' => 80,
'rules' => array(
'required' => true
)
);
$form['elements']['submit'] = array(
'type' => 'submitcancel',
......
......@@ -35,7 +35,10 @@ class PluginNotificationEmaildigest extends PluginNotification {
$toinsert = new StdClass;
$toinsert->type = $data->type;
$toinsert->usr = $user->id;
$toinsert->message = $data->message;
// Some messages are all html (or the message is not required).
// When they're 'cleaned' for display, they are left empty.
// Make sure something is in the field as it's NOT NULL in the database.
$toinsert->message = (empty($data->message) ? ' ' : $data->message);
$toinsert->ctime = db_format_timestamp(time());
if (!empty($data->url)) {
$toinsert->url = $data->url;
......
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