You are here

function deploy_uuid_generate_users in Deploy - Content Staging 6

Generate uuids for any existing users at install-time

1 call to deploy_uuid_generate_users()
deploy_uuid_install in modules/deploy_uuid/deploy_uuid.install
Implementation of hook_install().

File

modules/deploy_uuid/deploy_uuid.install, line 162

Code

function deploy_uuid_generate_users() {
  $result = db_query("SELECT uid FROM {users}");
  while ($row = db_fetch_array($result)) {
    $uuid = uniqid(rand(), TRUE);
    db_query("INSERT INTO {users_uuid} (uid, uuid) values (%d, '%s')", $row['uid'], $uuid);
  }
}