Skip to content

Instantly share code, notes, and snippets.

@luukverhoeven
Last active May 1, 2018 12:03
Show Gist options
  • Save luukverhoeven/e19959dd18a6d5e10db28016d7efab0f to your computer and use it in GitHub Desktop.
Save luukverhoeven/e19959dd18a6d5e10db28016d7efab0f to your computer and use it in GitHub Desktop.
<?php
# handy Moodle snippets
# Config catch all mails.
$CFG->divertallemailsto = 'debug@ldesign.nl';
# Force debugging.
@ini_set('display_errors', '1');
$CFG->debug = 32767;
$CFG->debugdisplay = true;
$CFG->debugusers = '2';
# Query - remove user details.
UPDATE `mdl_user` SET
`username` = CONCAT( FLOOR( RAND( ) * 90000000 ) , FLOOR( RAND( ) * 90000000 ) ) ,
`email` = CONCAT( FLOOR( RAND( ) * 90000000 ) , '@mijnapp.nl' ) ,
`firstname` = CONCAT( FLOOR( RAND( ) * 90000000 ) , '-firstname' ),
`lastname` = CONCAT( FLOOR( RAND( ) * 90000000 ) , '-lastname' ),
`password` = "fa820cc1ad39a4e99283e9fa555035ec" ,
`address` = "",
`idnumber` = CONCAT( FLOOR( RAND( ) * 90000000 ) , 'id' ) ,
`city` = "",
`lastip` = "",
`phone1` = "",
`phone2` = "",
`institution` = "",
`department` = ""
WHERE id > 2
# fa820cc1ad39a4e99283e9fa555035ec = test001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment