Skip to content

Commit

Permalink
Merge branch 'w40_MDL-41999_m26_userpw' of https://github.com/skodak/…
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 1, 2013
2 parents c9e4ade + 92911ef commit 00a6df6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion calendar/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
$weekend = intval($CFG->calendar_weekend);
}

$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)). $CFG->calendar_exportsalt);
// Let's populate some vars to let "common tasks" be somewhat smart...
// If today it's weekend, give the "next week" option
$allownextweek = $weekend & (1 << $now['wday']);
Expand Down
2 changes: 1 addition & 1 deletion calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
echo $OUTPUT->single_button(new moodle_url('/calendar/managesubscriptions.php', array('course'=>$courseid)), get_string('managesubscriptions', 'calendar'));
}
if (isloggedin()) {
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)) . $CFG->calendar_exportsalt);
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken));
$icon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/ical'), 'height'=>'14', 'width'=>'36', 'alt'=>get_string('ical', 'calendar'), 'title'=>get_string('quickdownloadcalendar', 'calendar')));
echo html_writer::tag('a', $icon, array('href'=>$link));
Expand Down
1 change: 1 addition & 0 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ information provided here is intended especially for developers.
* Implement new method get_enabled_plugins() method in subplugin info classes.
* Each plugin should include version information in version.php.
* Module and block tables do not contain version column any more, use get_config('xx_yy', 'version') instead.
* $USER->password field is intentionally unset so that session data does not contain password hashes.

DEPRECATIONS:
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices
Expand Down
4 changes: 2 additions & 2 deletions mod/chat/gui_header_js/jsupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
}

//Get the user theme and enough info to be used in chat_format_message() which passes it along to
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
print_error('invaliduser');
}
$USER->description = '';
\core\session\manager::set_user($user);

//Setup course, lang and theme
$PAGE->set_course($course);
Expand Down
4 changes: 2 additions & 2 deletions mod/chat/gui_header_js/jsupdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@

//Get the user theme and enough info to be used in chat_format_message() which passes it along to
// chat_format_message_manually() -- and only id and timezone are used.
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
print_error('invaliduser');
}
$USER->description = '';
\core\session\manager::set_user($user);

//Setup course, lang and theme
$PAGE->set_course($course);
Expand Down
5 changes: 2 additions & 3 deletions mod/chat/gui_header_js/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
}

//Get the user theme and enough info to be used in chat_format_message() which passes it along to
if (!$USER = $DB->get_record('user', array('id'=>$chatuser->userid))) { // no optimisation here, it would break again in future!
if (!$user = $DB->get_record('user', array('id'=>$chatuser->userid, 'deleted'=>0, 'suspended'=>0))) { // no optimisation here, it would break again in future!
print_error('invaliduser');
}
\core\session\manager::set_user($user);

$PAGE->set_pagelayout('embedded');

$USER->description = '';

//Setup course, lang and theme
$PAGE->set_course($course);

Expand Down

0 comments on commit 00a6df6

Please sign in to comment.