fill_users.php 995 B

123456789101112131415161718192021222324252627
  1. <?php //$id$
  2. /**
  3. * This script contains a data filling procedure for users
  4. * @author Yannick Warnier <yannick.warnier@dokeos.com>
  5. *
  6. */
  7. /**
  8. * Initialisation section
  9. */
  10. require_once '../../main/inc/global.inc.php';
  11. require_once '../../main/inc/lib/usermanager.lib.php';
  12. /**
  13. * Loads the data and injects it into the Dokeos database, using the Dokeos
  14. * internal functions.
  15. * @return array List of user IDs for the users that have just been inserted
  16. */
  17. function fill_users() {
  18. $users = array(); //declare only to avoid parsing notice
  19. require_once 'data_users.php'; //fill the $users array
  20. $output = array();
  21. foreach ($users as $i => $user) {
  22. //first check that the first item doesn't exist already
  23. echo $user['firstname'];
  24. $output[] = UserManager::create_user($user['firstname'],$user['lastname'],$user['status'],$user['email'],$user['username'],$user['pass'],null,null,null,null,$user['auth_source'],null,$user['active']);
  25. }
  26. return $output;
  27. }