~ubuntu-branches/ubuntu/maverick/system-tools-backends/maverick

« back to all changes in this revision

Viewing changes to UserConfig.pm

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-02-04 23:46:30 UTC
  • mfrom: (1.1.29 upstream) (1.2.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100204234630-nvy5v68fd8a429s0
Tags: 2.9.1-0ubuntu1
* Sync with Debian testing
* New upstream release (LP: #506365)
  - New users and groups protocol
  - Fix D-Bus .service files to work with new users and groups version
  - Add a new authentication interface allowing to check for PolicyKit 
    authorizations before committing
  - Fix SelfConfig and improve security checks
* debian/watch:
  - Watch 2.9.x series
* debian/control:
  - Bump libpolkit-gobject-1-dev build-dep
* Drop debian/patches/08_use_md5t.patch: Obsolete with new version
* Refresh 02ubuntu_chmod_network_interfaces_when_using_key.patch
* debian/patches/04_dont_use_authen_pam.patch:
  - Drop superfluous "use Authen::PAM", as it's not needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
# Copyright (C) 2007 Carlos Garnacho
6
6
#
7
 
# Authors: Carlos Garnacho Parro  <carlosg@gnome.org>
 
7
# Authors: Carlos Garnacho Parro  <carlosg@gnome.org>,
 
8
#          Milan Bouchet-Valat <nalimilan@club.fr>.
8
9
#
9
10
# This program is free software; you can redistribute it and/or modify
10
11
# it under the terms of the GNU Library General Public License as published
26
27
use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX);
27
28
use Users::Users;
28
29
 
29
 
my $OBJECT_NAME = "UserConfig";
 
30
my $OBJECT_NAME = "UserConfig2";
30
31
my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";
31
 
my $format = [ "uint32", "string", [ "array", "string" ]];
 
32
 
 
33
# base user struct, also used in UsersConfig
 
34
# variables: login, password, UID, main group GID, GECOS fields, home, shell,
 
35
# password flags, encrypted home, home dir flags, locale, location
 
36
our $USER_FORMAT = [ "struct", "string", "string", "uint32", "uint32", [ "array", "string" ], "string", "string",
 
37
                     "int32", "bool", "int32", "string", "string" ];
32
38
 
33
39
sub new
34
40
{
40
46
  return $self;
41
47
}
42
48
 
43
 
dbus_method ("get", [ "uint32" ], $format);
44
 
dbus_method ("set", $format, []);
 
49
dbus_method ("get", [ "string" ], [ $USER_FORMAT ]);
 
50
dbus_method ("set", [ $USER_FORMAT ], []);
 
51
dbus_method ("add", [ $USER_FORMAT ], [ $USER_FORMAT ]);
 
52
dbus_method ("del", [ $USER_FORMAT ], []);
45
53
 
46
54
sub get
47
55
{
48
 
  my ($self, $uid) = @_;
 
56
  my ($self, $login) = @_;
49
57
 
50
 
  return Users::Users::get_user ($uid);
 
58
  return Users::Users::get_user ($login);
51
59
}
52
60
 
53
61
sub set
57
65
  Users::Users::set_user (@config);
58
66
}
59
67
 
 
68
sub add
 
69
{
 
70
  my ($self, @config) = @_;
 
71
 
 
72
  return Users::Users::add_user (@config);
 
73
}
 
74
 
 
75
sub del
 
76
{
 
77
  my ($self, @config) = @_;
 
78
 
 
79
  Users::Users::del_user (@config);
 
80
}
 
81
 
60
82
sub getFiles
61
83
{
62
84
  my ($self) = @_;