[gnome-system-tools] Add user profiles configuration file



commit 4b3806048a0e0913b78615c85db6c43853151d1f
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Mon Jan 11 19:43:58 2010 +0100

    Add user profiles configuration file
    
    This file is used by GstUserProfiles, but only shipped by distributors. Include it in the tree, waiting for packagers to upstream the changes they need (groups). This version is veyr limited: we only define groups for two profiles, other settings will be chosen by the platforms.
    
    Move this file to $(sysconfdir)/gnome-system-tools/user-profiles.conf.

 DirsMakefile                    |    5 ++++-
 po/POTFILES.in                  |    1 +
 src/users/Makefile.am           |   10 ++++++++--
 src/users/user-profiles.c       |   18 +++++++++---------
 src/users/user-profiles.conf.in |   10 ++++++++++
 5 files changed, 32 insertions(+), 12 deletions(-)
---
diff --git a/DirsMakefile b/DirsMakefile
index 764734c..a7f7b40 100644
--- a/DirsMakefile
+++ b/DirsMakefile
@@ -4,8 +4,11 @@
 
 pixmapsdir = $(pkgdatadir)/pixmaps
 interfacesdir = $(pkgdatadir)/ui
+confdir = $(sysconfdir)/gnome-system-tools
 
 INCLUDES = -DPIXMAPS_DIR=\""$(pixmapsdir)"\"		\
 	   -DINTERFACES_DIR=\""$(interfacesdir)"\"	\
 	   -DFRONTEND_DIR=\""$(frontenddir)"\"		\
-	   -DDESKTOP_DATA_DIR=\""$(desktopdatadir)"\"
+	   -DDESKTOP_DATA_DIR=\""$(desktopdatadir)"\"	\
+	   -DCONF_DIR=\""$(confdir)"\"
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a74a5cc..33d0195 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -48,6 +48,7 @@ src/users/groups-table.c
 src/users/main.c
 src/users/passwd.c
 src/users/privileges-table.c
+[type: gettext/ini]src/users/user-profiles.conf.in
 src/users/table.c
 src/users/users.desktop.in.in
 src/users/user-settings.c
diff --git a/src/users/Makefile.am b/src/users/Makefile.am
index a171870..11073a2 100644
--- a/src/users/Makefile.am
+++ b/src/users/Makefile.am
@@ -12,8 +12,6 @@ bin_PROGRAMS = users-admin
 
 SUBDIRS = 
 INCLUDES += $(GST_TOOL_CFLAGS)
-CLEANFILES = $(GST_TOOL_CLEANFILES)
-EXTRA_DIST = $(GST_TOOL_EXTRA_DIST)
 
 users_admin_LDADD = $(GST_TOOL_LIBS) 
 users_admin_DEPENDENCIES = $(GST_TOOL_DEPENDENCIES) 
@@ -35,3 +33,11 @@ users_admin_SOURCES = \
 toolpixmaps =
 
 -include $(top_srcdir)/git.mk
+
+profilesdir = $(confdir)
+profiles_in_files = user-profiles.conf.in
+profiles_DATA = $(profiles_in_files:.conf.in=.conf)
+user-profiles.conf: user-profiles.conf.in @INTLTOOL_MERGE@ $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< user-profiles.conf
+
+CLEANFILES = $(GST_TOOL_CLEANFILES) user-profiles.conf
+EXTRA_DIST = $(GST_TOOL_EXTRA_DIST) user-profiles.conf.in
diff --git a/src/users/user-profiles.c b/src/users/user-profiles.c
index d39b86d..bc9a111 100644
--- a/src/users/user-profiles.c
+++ b/src/users/user-profiles.c
@@ -28,7 +28,7 @@
 
 extern GstTool *tool;
 
-#define PROFILES_FILE "/etc/gnome-system-tools/users/profiles"
+#define PROFILES_FILE CONF_DIR "/user-profiles.conf"
 #define GST_USER_PROFILES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_USER_PROFILES, GstUserProfilesPrivate))
 
 typedef struct _GstUserProfilesPrivate GstUserProfilesPrivate;
@@ -66,15 +66,15 @@ create_profile (GKeyFile    *key_file,
 	GstUserProfile *profile;
 
 	profile = g_new0 (GstUserProfile, 1);
-	profile->name = g_key_file_get_locale_string (key_file, group, "name", NULL, NULL);
+	profile->name = g_key_file_get_locale_string (key_file, group, "Name", NULL, NULL);
 	profile->description = g_key_file_get_locale_string (key_file, group,
-	                                                     "description", NULL, NULL);
-	profile->is_default = g_key_file_get_boolean (key_file, group, "default", NULL);
-	profile->shell = g_key_file_get_string (key_file, group, "shell", NULL);
-	profile->home_prefix = g_key_file_get_string (key_file, group, "home-prefix", NULL);
-	profile->groups = g_key_file_get_string_list (key_file, group, "groups", NULL, NULL);
-	profile->uid_min = g_key_file_get_integer (key_file, group, "uid-min", NULL);
-	profile->uid_max = g_key_file_get_integer (key_file, group, "uid-max", NULL);
+	                                                     "Description", NULL, NULL);
+	profile->is_default = g_key_file_get_boolean (key_file, group, "Default", NULL);
+	profile->shell = g_key_file_get_string (key_file, group, "Shell", NULL);
+	profile->home_prefix = g_key_file_get_string (key_file, group, "HomePrefix", NULL);
+	profile->groups = g_key_file_get_string_list (key_file, group, "Groups", NULL, NULL);
+	profile->uid_min = g_key_file_get_integer (key_file, group, "MinUID", NULL);
+	profile->uid_max = g_key_file_get_integer (key_file, group, "MaxUID", NULL);
 
 	return profile;
 }
diff --git a/src/users/user-profiles.conf.in b/src/users/user-profiles.conf.in
new file mode 100644
index 0000000..379ff8f
--- /dev/null
+++ b/src/users/user-profiles.conf.in
@@ -0,0 +1,10 @@
+[Desktop]
+_Name=Desktop user
+_Description=Can perform common tasks. Can't install software or change settings affecting all users.
+Default=1
+Groups=cdrom,floppy,dialout,tape,dip,adm,plugdev,fax,audio,scanner,fuse,video
+
+[Administrator]
+_Name=Administrator
+_Description=Can change anything on the system, including installing and upgrading software.
+Groups=cdrom,floppy,dialout,tape,dip,adm,plugdev,fax,audio,scanner,fuse,admin,sambashare,lpadmin,video



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]