Skip to content

Commit

Permalink
Use big random number for parent password generation
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Apr 27, 2022
1 parent ff762f1 commit 1e1c7fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -5,6 +5,7 @@ Changes in 8.9.5
----------------
- Fix stored XSS security issue: do not allow unsanitized XML & HTML in FileUpload.fnc.php, thanks to @nhienit2010
- Fix stored XSS security issue: escape HTML attribute in StudentAssignments.fnc.php, thanks to @dungtuanha
- Use big random number for parent password generation in NotifyParents.php & CreateParents.php, thanks to @intrapus

Changes in 8.9.4
----------------
Expand Down
7 changes: 3 additions & 4 deletions modules/Custom/CreateParents.php
Expand Up @@ -188,11 +188,10 @@

$user = $user[1];

//FJ change parent password generation
//$password = $passwords[rand(0,count( $passwords )-1)];
$password = $username . rand( 100, 999 );
// Use big random number for parent password generation.
$password = $username . rand( 1, 99999999999 );

// FJ Moodle integrator / password.
// Moodle integrator / password.
$password = ucfirst( $password ) . '*';

if ( ! $test_email )
Expand Down
6 changes: 3 additions & 3 deletions modules/Custom/NotifyParents.php
Expand Up @@ -56,9 +56,9 @@
{
$staff_id = $staff['STAFF_ID'];

//FJ change parent password generation
$password = $staff['USERNAME'] . rand( 1000, 9999 );
//FJ add password encryption
// Use big random number for parent password generation.
$password = $staff['USERNAME'] . rand( 1, 9999999999 );

$password_encrypted = encrypt_password( $password );
DBQuery( "UPDATE STAFF SET PASSWORD='" . $password_encrypted . "' WHERE STAFF_ID='" . $staff_id . "'" );

Expand Down

0 comments on commit 1e1c7fc

Please sign in to comment.