#!/usr/bin/perl -w
# This script (sophomorix-allusers) is maintained by Rüdiger Beck
# It is Free Software (License GPLv3)
# If you find errors, contact the author
# jeffbeck@web.de  or  jeffbeck@gmx.de


# Dieses Script ist NICHT im Paket sophomorix-developer enthalten



# Bibliotheken
use strict;
use Getopt::Long;
use Sophomorix::SophomorixConfig;
use Sophomorix::SophomorixBase;
use Sophomorix::SophomorixAPI;
#use Sophomorix::SophomorixFiles;
use Sophomorix::SophomorixPgLdap;
use Sophomorix::SophomorixTest;
use Test::More "no_plan";
Getopt::Long::Configure ("bundling");

use DBI;
use Crypt::SmbHash;
use Net::LDAP;
#use DebAux::Debconf;
use IMAP::Admin;

my $all_user="allusers";


my @students=&Sophomorix::SophomorixAPI::fetchstudents_from_school();

my @teachers=&Sophomorix::SophomorixPgLdap::fetchstudents_from_adminclass("teachers");


my @users=(@students,@teachers);


my $gidnumber=&create_class_db_entry($all_user);



foreach my $user (@users){
    # add user to a group
    &Sophomorix::SophomorixPgLdap::adduser_to_project($user,$all_user,0);
    print "$user\n";

    # rm a dir in the home
    #my ($home)=&Sophomorix::SophomorixPgLdap::fetchdata_from_account($user);
    #my $command="rmdir $home/\\\$user_attic";
    #print "$command\n";
    #system("$command");


}






############################################################
# sub
############################################################
