index
:
drakx
distro/mdv2007.1
distro/mdv2008.0
distro/mdv2008.1
distro/mdv2009.0
distro/mdv2009.1
distro/mdv2010.0
distro/mes5
distro/mes5-2.6.33
distro/mes6
distro/mga1
distro/mga2
distro/mga3
distro/mga4
distro/mga5
distro/mga6
distro/mga7
distro/mga8
distro/mga9
master
topic/Corpo_2_1
topic/KA9_0
topic/MDK-10-update
topic/MDK-10_1-update
topic/MDK-10_2-update
topic/MDK-2006_0-update
topic/MDK92-branch
topic/MDKC_1_0
topic/PCMCIA_CS_DISTRO
topic/R9_0-64bit-branch
topic/R9_1_HP-branch
topic/a
topic/before_matchbox_wm
topic/bug-13680
topic/dietlibc
topic/efi
topic/extlinux
topic/firewall
topic/gdk-pixbuf-0-branch
topic/gi-ppc
topic/ia64-8_1
topic/mandrakesoft
topic/mlcd4
topic/ppp
topic/rp-pppoe
topic/switching_to_dnf
topic/switching_to_urpmi
topic/unlabeled-1.1.1
topic/v_webmin_0_87
topic/x86_64-branch
user/animtim/designWork
user/colin/rescue-systemd
user/ennael/mga6
user/erwan/bug-13680
user/jibz/aarch64
user/martinw/mga6
user/pterjan/arm64
Mageia Installer and base platform for many utilities
Thierry Vignaud [tv]
summary
refs
log
tree
commit
diff
stats
log msg
author
committer
range
Branch
Commit message
Author
Age
master
Manage also Wayland session in MCC
Aurelian R
12 days
user/jibz/aarch64
fix(install): grub2-efi was not found using default_bootloader()
Jybz
8 months
distro/mga9
18.66
Martin Whitaker
16 months
user/pterjan/arm64
foo
Pascal Terjan
19 months
distro/mga8
drakxtools/stage2: 18.45: update NEWS
Thomas Backlund
4 years
distro/mga7
18.21.1
Thomas Backlund
5 years
distro/mga6
17.88.3
Martin Whitaker
6 years
topic/extlinux
bootloader: add cma=256M@512M for Raspberry Pi DRM/VC4#!/usr/bin/perl -w use strict; use Template; use Net::LDAP; use File::Slurp; use YAML qw/LoadFile/; use LWP::UserAgent; my $config_file = '/etc/mgapeople.conf'; my $config = LoadFile($ENV{MGAPEOPLE_CONF} ? $ENV{MGAPEOPLE_CONF} : $config_file); my %maintdb; my %groups; my %users; sub process_template { my ($template, $src, $vars, $dest) = @_; for my $extension (@{$config->{output_format}}) { next unless -f "$config->{tmpl_dir}/$src.$extension"; $template->process("$src.$extension", $vars, "$dest.$extension"); } } sub loadmaintdb { return unless $config->{maintdburl}; my $ua = LWP::UserAgent->new; my $r = $ua->get($config->{maintdburl}); return unless $r->is_success; for my $line (split /^/, $r->decoded_content) { my ($pkg, $user) = split ' ', $line; push @{$maintdb{$user}}, $pkg; } } sub loaduser { my ($ldap, $user) = @_; my $m = $ldap->search( base => $user, scope => 'base', filter => '(objectClass=inetOrgPerson)', ); die $m->error if $m->is_error; my $res = $m->as_struct; if (exists $res->{$user}) { $res->{$user}->{groups} = []; $users{$user} = $res->{$user}; } } sub loadgroups { my ($ldap) = @_; my $m = $ldap->search( base => $config->{groupbase}, filter => '(objectClass=groupOfNames)', ); die $m->error if $m->is_error; my $res = $m->as_struct; for my $groupname (keys %$res) { $groups{$groupname} = $res->{$groupname}; for my $user (@{$groups{$groupname}->{member}}) { loaduser($ldap, $user) unless exists $users{$user}; if (exists $users{$user}) { push @{$users{$user}->{groups}}, $groupname; } } $res->{$groupname}->{member} = [ grep { exists $users{$_} } @{$groups{$groupname}->{member}} ]; } } sub output_users { my $template = Template->new({ INCLUDE_PATH => $config->{tmpl_dir}, OUTPUT_PATH => "$config->{output_dir}/u", }); for my $user (keys %users) { my $vars = { config => $config, user => $user, users => \%users, groups => \%groups, maintdb => \%maintdb, }; my $uid = $users{$user}->{uid}->[0]; process_template($template, 'user', $vars, $uid); } my $vars = { config => $config, users => \%users, groups => \%groups, maintdb => \%maintdb, }; process_template($template, 'userindex', $vars, 'index'); } sub output_groups { my $template = Template->new({ INCLUDE_PATH => $config->{tmpl_dir}, OUTPUT_PATH => "$config->{output_dir}/g", }); for my $group (keys %groups) { my $vars = { config => $config, group => $group, users => \%users, groups => \%groups, maintdb => \%maintdb, }; my $cn = $groups{$group}->{cn}->[0]; process_template($template, 'group', $vars, $cn); } my $vars = { config => $config, users => \%users, groups => \%groups, maintdb => \%maintdb, }; process_template($template, 'groupindex', $vars, 'index'); } sub output_index { my $template = Template->new({ INCLUDE_PATH => $config->{tmpl_dir}, OUTPUT_PATH => "$config->{output_dir}", }); my $vars = { config => $config, users => \%users, groups => \%groups, maintdb => \%maintdb, }; process_template($template, 'index', $vars, 'index'); } my $bindpw = read_file($config->{bindpwfile}); chomp $bindpw; my $ldap = Net::LDAP->new($config->{ldapserver}) or die "$@"; my $m; $m = $ldap->start_tls(verify => 'none'); die $m->error if $m->is_error; $m = $ldap->bind($config->{binddn}, password => $bindpw); die $m->error if $m->is_error; loadmaintdb; loadgroups($ldap); output_users(); output_groups(); output_index();