public function execute() {
        global $DB;
        if (is_enabled_auth('ldap')) {
            $auth = get_auth_plugin('ldap');
            $users = $DB->get_records('user', array('auth' => 'ldap'));
            foreach ($users as $user) {
                $auth->sync_roles($user);
            }
        }
    }