function remove_submit(Pieform $form, $values)
{
    $eschool = Doctrine::getTable('GcrEschool')->findOneById($values['eschoolid']);
    $owner = $eschool->getOwnerUser();
    ArtefactTypeEschooladmin::authorize_eschool($eschool);
    foreach ($values['users'] as $user) {
        if ($user != $owner->getObject()->username) {
            $mdl_user_obj = $eschool->selectFromMdlTable('user', 'username', $user, true);
            if ($mdl_user_obj) {
                $mdl_user = new GcrMdlUser($mdl_user_obj, $eschool);
                $mdl_user->removeAccess();
            }
        }
    }
    redirect("/artefact/eschooladmin/migrateusers.php?eschoolid=" . $values['eschoolid']);
}
function potentialusers_submit(Pieform $form, $values)
{
    $result = ArtefactTypeEschooladmin::add_to_course($values);
    redirect("/artefact/eschooladmin/assignroles.php?roleid=" . $values['roleid'] . "&courseid=" . $values['courseid'] . "&eschoolid=" . $values['eschoolid']);
}