Summary: | Groups in Users= and NoUsers= lines | ||
---|---|---|---|
Product: | kdm | Reporter: | gurubert-kdm |
Component: | general | Assignee: | kdm bugs tracker <kdm-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Other | ||
Latest Commit: | Version Fixed In: |
Description
gurubert-kdm
2001-06-22 08:59:12 UTC
--Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Hi! Attached is a patch to kdm 2.2.2 that allows to put groups in the "User=" line of kdmrc. The group name must start with the @-sign to mark the name as a group name. With that patch it is possible to show only members of one or some specific groups in the kdm login dialog. Greetings -- Robert Sander Department Head Information Systems www.epigenomics.com Kastanienallee 24 +493024345330 10435 Berlin --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="kdm.patch" diff -ru kdm.orig/kfrontend/kgreeter.cpp kdm/kfrontend/kgreeter.cpp --- kdm.orig/kfrontend/kgreeter.cppMon Jul 30 03:27:19 2001 +++ kdm/kfrontend/kgreeter.cppTue Mar 12 18:02:31 2002 @@ -626 +627 @@ #include <sys/param.h> #include <pwd.h> +#include <grp.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -16513 +16628 @@ endpwent(); } else { QStringList::ConstIterator it = kdmcfg->_users.begin(); +const char *grp_name; for( ; it != kdmcfg->_users.end(); ++it) { - QPixmap p( locate("user_pic" - *it + QString::fromLatin1(".png"))); - if( p.isNull()) -p = default_pix; - QIconViewItem *item = new QIconViewItem( iconview *it p); - item->setDragEnabled(false); + grp_name = (*it).ascii(); + if (grp_name && grp_name[0] == '@') { + group *grp; + grp = getgrnam(grp_name+1); + if (grp) { + while (*(grp->gr_mem)) { + kdmcfg->_users.append(QString::fromUtf8(*(grp->gr_mem))); + grp->gr_mem++; + } + // free(grp); + } + free((void *)grp_name); + } else { + QPixmap p( locate("user_pic" + *it + QString::fromLatin1(".png"))); + if( p.isNull()) + p = default_pix; + QIconViewItem *item = new QIconViewItem( iconview *it p); + item->setDragEnabled(false); + } } } if( kdmcfg->_sortUsers) --Nq2Wo0NMKNjxTN9z-- implemented for kde 3.3. note that the options were renamed to SelectedUsers and HiddenUsers some time ago. NoPassUsers now accepts groups as well. |