Difference between revisions of "Moodle"

From assela Pathirana
Jump to navigationJump to search
 
Line 1: Line 1:
[[File:Koninginnedag_2011_DSC_1884.JPG|thumb|300px|]]
==Changing The Root Password==
==Changing The Root Password==
* Forgotten the root password. E-mail is not provided when creating the account or no e-mail working.  
* Forgotten the root password. E-mail is not provided when creating the account or no e-mail working.  

Latest revision as of 08:24, 2 May 2011

Koninginnedag 2011 DSC 1884.JPG

Changing The Root Password

  • Forgotten the root password. E-mail is not provided when creating the account or no e-mail working.
<?php
include('config.php'); # need to run at the moodle root via web browser!
//////////
$username = 'foo';
$newpassword = 'bar';
/////////
if ($userobj = get_record_select('user', "username='$username'", 'id, password')) {
        $userobj->password = md5($newpassword);
            update_record('user', $userobj);
                echo 'Password changed';
} else {
        echo 'Invalid username';
}

?>