summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-24 00:26:22 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-24 00:26:22 +0000
commit63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5 (patch)
treedb9522b8dc1c02af74c6c5050a58e7fd002bdc55 /perl-install/any.pm
parent685a29887953bf36c2d0dab4e7bce8a64bd8934e (diff)
downloaddrakx-backup-do-not-use-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar
drakx-backup-do-not-use-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.gz
drakx-backup-do-not-use-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.bz2
drakx-backup-do-not-use-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.xz
drakx-backup-do-not-use-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.zip
no_comment
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
new file mode 100644
index 000000000..5b2fef5c3
--- /dev/null
+++ b/perl-install/any.pm
@@ -0,0 +1,37 @@
+package any;
+
+use diagnostics;
+use strict;
+
+#-######################################################################################
+#- misc imports
+#-######################################################################################
+use common qw(:file :system :common :functional);
+
+sub addKdmUsers {
+ my ($prefix, @users) = @_;
+ require timezone;
+ my @u1 = my @users_male = qw(tie default curly);
+ my @u2 = my @users_female = qw(brunette girl woman-blond);
+ foreach (@users) {
+ my $l = rand() < timezone::sexProb($_->{name}) ? \@u2 : \@u1;
+ my $u = splice(@$l, rand(@$l), 1); #- known biased (see cookbook for better)
+ symlink "../../../../icons/user-$u-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/$_.xpm";
+ @u1 = @users_male unless @u1;
+ @u2 = @users_female unless @u2;
+ }
+ symlinkf "../../../../icons/user-hat-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/root.xpm" unless $::isStandalone;
+}
+
+sub addUsers {
+ my ($prefix, @users) = @_;
+ my $msec = "$prefix/etc/security/msec";
+ foreach my $u (@users) {
+ substInFile { s/^$u\n//; $_ .= "$u\n" if eof } "$msec/user.conf" if -d $msec;
+ }
+ run_program::rooted($prefix, "/etc/security/msec/init-sh/grpuser.sh --refresh");
+
+ addKdmUsers($prefix, @users);
+}
+
+1;