From 0f1d6b3b234a1f8d8c6b9dff38388ab58f695b64 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Tue, 13 Mar 2007 13:50:58 -0400 Subject: deprecate the user properties and add unix-user properties Also added deprecated notes to the docs. New code should be using GetUnixUser instead of GetUser etc. --- doc/ConsoleKit.html | 141 +++++++++++++++++++--------------- doc/dbus-introspect-docs.dtd | 2 +- doc/spec/ck-manager.xml | 22 ++++++ doc/spec/ck-session.xml | 21 +++++ doc/tools/spec-to-docbook.xsl | 75 +++++++++++++++--- doc/xml/ref-ck-manager.xml | 15 +++- doc/xml/ref-ck-session.xml | 24 ++++-- src/ck-manager.c | 25 ++++-- src/ck-manager.h | 4 + src/ck-manager.xml | 5 ++ src/ck-session.c | 44 ++++++++--- src/ck-session.h | 8 +- src/ck-session.xml | 4 + tools/linux/ck-collect-session-info.c | 2 +- tools/list-sessions.c | 2 +- 15 files changed, 295 insertions(+), 99 deletions(-) diff --git a/doc/ConsoleKit.html b/doc/ConsoleKit.html index 16289eb..c1ef05d 100644 --- a/doc/ConsoleKit.html +++ b/doc/ConsoleKit.html @@ -2,22 +2,22 @@ ConsoleKit 0.1.3 Documentation

ConsoleKit 0.1.3 Documentation

William Jon McCann


            
-          

Version 0.1.3


Introduction

-

Part I. Concepts

Chapter 1. Introduction

About

+          

Version 0.1.3


Table of Contents

Introduction
I. Concepts
1. Introduction
About
Defining the Problem
Relevant art
2. Terminology
Session
Session leader
Seat
3. Design
II. Reference
I. D-Bus API Reference
org.freedesktop.ConsoleKit.Manager — Manager interface
org.freedesktop.ConsoleKit.Seat — Seat interface
org.freedesktop.ConsoleKit.Session — Session interface
Index

Introduction

+

Part I. Concepts

Chapter 1. Introduction

About

ConsoleKit is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them. -

Defining the Problem

-

Relevant art

-

Chapter 2. Terminology

Table of Contents

Session
Session leader
Seat

Session

+

Defining the Problem

+

Relevant art

+

Chapter 2. Terminology

Table of Contents

Session
Session leader
Seat

Session

ConsoleKit is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them. -

Session leader

-

Seat

-

Chapter 3. Design

Part II. Reference

D-Bus API Reference


+

Session leader

+

Seat

+

Chapter 3. Design

Part II. Reference

D-Bus API Reference


ConsoleKit provides a D-Bus API for programs to obtain information about the users, sessions, and seats that are present on a system.

@@ -36,17 +36,19 @@ GetSessionForUnixProcess (in 'u' pid, out 'o' ssid) GetCurrentSession (out 'o' ssid) +GetSessionsForUnixUser (in 'u' uid, + out 'ao' sessions) GetSessionsForUser (in 'u' uid, out 'ao' sessions) GetSystemIdleHint (out 'b' idle_hint) GetSystemIdleSinceHint (out 's' iso8601_datetime) -

Signals

SeatAdded             ('o' sid)
+

Signals

SeatAdded             ('o' sid)
 SeatRemoved           ('o' sid)
 SystemIdleHintChanged ('b' hint)
-

Implemented Interfaces

org.freedesktop.ConsoleKit.Manager implements +

Implemented Interfaces

org.freedesktop.ConsoleKit.Manager implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties -

Properties

Description

Details

OpenSession ()

OpenSession (out 's' cookie)

This method requests that a new Session +

Properties

Description

Details

OpenSession ()

OpenSession (out 's' cookie)

This method requests that a new Session be created for the calling process. The properties of this new Session are set automatically from information collected about the calling process.

This new session exists until the calling process disconnects from the system bus or @@ -88,7 +90,7 @@

cookie:
The secret cookie that is used to identify the new session

See also: -OpenSessionWithParameters()

OpenSessionWithParameters ()

OpenSessionWithParameters (in  'a(sv)' parameters,
+OpenSessionWithParameters()

OpenSessionWithParameters ()

OpenSessionWithParameters (in  'a(sv)' parameters,
                            out 's'     cookie)

This method requests that a new Session be created for the calling process. The properties of this new Session are from the parameters provided. @@ -100,63 +102,70 @@ See also: as members of this session.

See the Session properties for a list of valid parameters.

parameters:
An array of sets of property names and values
cookie:
The secret cookie that is used to identify the new session

This method is restricted to privileged users by D-Bus policy.

See also: -org.freedesktop.ConsoleKit.Session

CloseSession ()

CloseSession (in  's' cookie,
+org.freedesktop.ConsoleKit.Session

CloseSession ()

CloseSession (in  's' cookie,
               out 'b' result)

This method is used to close the session identified by the supplied cookie.

The session can only be closed by the same process that opened the session. -

cookie:
The secret cookie that is used to identify the session
result:
Whether the session was successfully closed

GetSeats ()

GetSeats (out 'ao' seats)

This gets a list of all the Seats +

cookie:
The secret cookie that is used to identify the session
result:
Whether the session was successfully closed

GetSeats ()

GetSeats (out 'ao' seats)

This gets a list of all the Seats that are currently present on the system.

Each Seat ID is an D-Bus object path for the object that implements the Seat interface.

seats:
an array of Seat IDs

See also: -org.freedesktop.ConsoleKit.Seat

GetSessionForCookie ()

GetSessionForCookie (in  's' cookie,
+org.freedesktop.ConsoleKit.Seat

GetSessionForCookie ()

GetSessionForCookie (in  's' cookie,
                      out 'o' ssid)

Returns the session ID that is associated with the specified cookie. -

cookie:
The secret cookie that is used to identify the session
ssid:
The object identifier for the current session

GetSessionForUnixProcess ()

GetSessionForUnixProcess (in  'u' pid,
+          

cookie:
The secret cookie that is used to identify the session
ssid:
The object identifier for the current session

GetSessionForUnixProcess ()

GetSessionForUnixProcess (in  'u' pid,
                           out 'o' ssid)

Attempts to determine the session ID for the specified POSIX process ID (pid). -

pid:
The POSIX process ID
ssid:
The object identifier for the current session

GetCurrentSession ()

GetCurrentSession (out 'o' ssid)

Attempts to determine the session ID that the caller belongs to. +

pid:
The POSIX process ID
ssid:
The object identifier for the current session

GetCurrentSession ()

GetCurrentSession (out 'o' ssid)

Attempts to determine the session ID that the caller belongs to.

See this example of using dbus-send:

   dbus-send --system --dest=org.freedesktop.ConsoleKit \
   --type=method_call --print-reply --reply-timeout=2000 \
   /org/freedesktop/ConsoleKit/Manager \
   org.freedesktop.ConsoleKit.Manager.GetCurrentSession
-          
ssid:
The object identifier for the current session

GetSessionsForUser ()

GetSessionsForUser (in  'u'  uid,
+          
ssid:
The object identifier for the current session

GetSessionsForUnixUser ()

GetSessionsForUnixUser (in  'u'  uid,
+                        out 'ao' sessions)

This gets a list of all the Sessions + that are currently open for the specified user.

Each Session ID is an D-Bus object path for the object that implements the + Session interface.

uid:
POSIX User identification
sessions:
an array of Session IDs

GetSessionsForUser ()

GetSessionsForUser (in  'u'  uid,
                     out 'ao' sessions)

This gets a list of all the Sessions that are currently open for the specified user.

Each Session ID is an D-Bus object path for the object that implements the - Session interface.

uid:
User identification
sessions:
an array of Session IDs

GetSystemIdleHint ()

GetSystemIdleHint (out 'b' idle_hint)

Returns TRUE if the idle-hint + Session interface.

uid:
User identification
sessions:
an array of Session IDs

Warning

GetSessionsForUser is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + GetSessionsForUnixUser +instead.

GetSystemIdleHint ()

GetSystemIdleHint (out 'b' idle_hint)

Returns TRUE if the idle-hint property of every open session is TRUE or if there are no open sessions. -

idle_hint:
The value of the system-idle-hint

GetSystemIdleSinceHint ()

GetSystemIdleSinceHint (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to +

idle_hint:
The value of the system-idle-hint

GetSystemIdleSinceHint ()

GetSystemIdleSinceHint (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to the time of the last change of the system-idle-hint. -

iso8601_datetime:
An ISO 8601 format date-type string

Signal Details

The SeatAdded signal

SeatAdded ('o' sid)

Emitted when a Seat has been added to the system. -

sid:
The Seat ID for the added seat

The SeatRemoved signal

SeatRemoved ('o' sid)

Emitted when a Seat has been removed from the system. -

sid:
The Seat ID for the removed seat

The SystemIdleHintChanged signal

SystemIdleHintChanged ('b' hint)

Emitted when the value of the system-idle-hint has changed. -

hint:
The value of the system-idle-hint

Property Details


Name

org.freedesktop.ConsoleKit.Seat — Seat interface

Methods

GetId            (out 'o'  sid)
+          

iso8601_datetime:
An ISO 8601 format date-type string

Signal Details

The SeatAdded signal

SeatAdded ('o' sid)

Emitted when a Seat has been added to the system. +

sid:
The Seat ID for the added seat

The SeatRemoved signal

SeatRemoved ('o' sid)

Emitted when a Seat has been removed from the system. +

sid:
The Seat ID for the removed seat

The SystemIdleHintChanged signal

SystemIdleHintChanged ('b' hint)

Emitted when the value of the system-idle-hint has changed. +

hint:
The value of the system-idle-hint

Property Details


Name

org.freedesktop.ConsoleKit.Seat — Seat interface

Methods

GetId            (out 'o'  sid)
 GetSessions      (out 'ao' sessions)
 GetActiveSession (out 'o'  ssid)
 ActivateSession  (in  'o'  ssid)
-

Signals

ActiveSessionChanged ('o' ssid)
+

Signals

ActiveSessionChanged ('o' ssid)
 SessionAdded         ('o' ssid)
 SessionRemoved       ('o' ssid)
-

Implemented Interfaces

org.freedesktop.ConsoleKit.Seat implements +

Implemented Interfaces

org.freedesktop.ConsoleKit.Seat implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties -

Properties

Description

+

Properties

Description

A seat is a collection of sessions and a set of hardware (usually at least a keyboard and mouse). Only one session may be active on a seat at a time.

-

Details

GetId ()

GetId (out 'o' sid)
Returns the ID for Seat. -
sid:
Seat ID

GetSessions ()

GetSessions (out 'ao' sessions)

This gets a list of all the Sessions +

Details

GetId ()

GetId (out 'o' sid)
Returns the ID for Seat. +
sid:
Seat ID

GetSessions ()

GetSessions (out 'ao' sessions)

This gets a list of all the Sessions that are currently attached to this seat.

Each Session ID is an D-Bus object path for the object that implements the - Session interface.

sessions:
an array of Session IDs

GetActiveSession ()

GetActiveSession (out 'o' ssid)

Gets the Session ID that is currently active on this Seat.

Returns NULL if there is no active session.

ssid:
Session ID

ActivateSession ()

ActivateSession (in  'o' ssid)

Attempt to activate the specified session. In most + Session interface.

sessions:
an array of Session IDs

GetActiveSession ()

GetActiveSession (out 'o' ssid)

Gets the Session ID that is currently active on this Seat.

Returns NULL if there is no active session.

ssid:
Session ID

ActivateSession ()

ActivateSession (in  'o' ssid)

Attempt to activate the specified session. In most cases, if successful, this will cause the session to become visible and take control of the hardware that is associated with this seat.

ssid:
Session ID

See also: -Activate()

Signal Details

The ActiveSessionChanged signal

ActiveSessionChanged ('o' ssid)

Emitted when the active session has changed.

ssid:
Session ID

The SessionAdded signal

SessionAdded ('o' ssid)

Emitted when a session has been added to the seat.

ssid:
Session ID

The SessionRemoved signal

SessionRemoved ('o' ssid)

Emitted when a session has been removed from the seat.

ssid:
Session ID

Property Details


Name

org.freedesktop.ConsoleKit.Session — Session interface

Methods

GetId               (out 'o' ssid)
+Activate()

Signal Details

The ActiveSessionChanged signal

ActiveSessionChanged ('o' ssid)

Emitted when the active session has changed.

ssid:
Session ID

The SessionAdded signal

SessionAdded ('o' ssid)

Emitted when a session has been added to the seat.

ssid:
Session ID

The SessionRemoved signal

SessionRemoved ('o' ssid)

Emitted when a session has been removed from the seat.

ssid:
Session ID

Property Details


Name

org.freedesktop.ConsoleKit.Session — Session interface

Methods

GetId               (out 'o' ssid)
 GetSeatId           (out 'o' sid)
 GetSessionType      (out 's' type)
 GetUser             (out 'i' uid)
+GetUnixUser         (out 'i' uid)
 GetX11Display       (out 's' display)
 GetX11DisplayDevice (out 's' x11_display_device)
 GetDisplayDevice    (out 's' display_device)
@@ -170,14 +179,15 @@ See also:
 GetIdleHint         (out 'b' idle_hint)
 GetIdleSinceHint    (out 's' iso8601_datetime)
 SetIdleHint         (in  'b' idle_hint)
-

Signals

ActiveChanged   ('b' is_active)
+

Signals

ActiveChanged   ('b' is_active)
 IdleHintChanged ('b' hint)
 Lock            ()
 Unlock          ()
-

Implemented Interfaces

org.freedesktop.ConsoleKit.Session implements +

Implemented Interfaces

org.freedesktop.ConsoleKit.Session implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties -

Properties

'user'               readwrite 'u'
+    

Properties

'unix-user'          readwrite 'u'
+'user'               readwrite 'u'
 'session-type'       readwrite 's'
 'remote-host-name'   readwrite 's'
 'display-device'     readwrite 's'
@@ -186,7 +196,7 @@ See also:
 'active'             readwrite 'b'
 'is-local'           readwrite 'b'
 'idle-hint'          readwrite 'b'
-

Description

+

Description

Session objects represent and store information related to a user session. @@ -195,94 +205,103 @@ See also: specifically refer to the properties of the "session leader".

-

Details

GetId ()

GetId (out 'o' ssid)

Returns the ID for Session.

ssid:
Session ID

GetSeatId ()

GetSeatId (out 'o' sid)

Returns the ID for the Seat the Session is +

Details

GetId ()

GetId (out 'o' ssid)

Returns the ID for Session.

ssid:
Session ID

GetSeatId ()

GetSeatId (out 'o' sid)

Returns the ID for the Seat the Session is attached to.

sid:
Seat ID

See also: -org.freedesktop.ConsoleKit.Seat

GetSessionType ()

GetSessionType (out 's' type)

Returns the type of the session.

Warning: we haven't yet defined the allowed values for this property. +org.freedesktop.ConsoleKit.Seat

GetSessionType ()

GetSessionType (out 's' type)

Returns the type of the session.

Warning: we haven't yet defined the allowed values for this property. It is probably best to avoid this until we do.

type:
Session type

See also: -session-type

GetUser ()

GetUser (out 'i' uid)

Returns the user that the session belongs to.

uid:
User ID

+session-type

GetUser ()

GetUser (out 'i' uid)

Returns the user that the session belongs to.

uid:
User ID

Warning

GetUser is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + GetUnixUser +instead.

+See also: +user

GetUnixUser ()

GetUnixUser (out 'i' uid)

Returns the POSIX user ID that the session belongs to.

uid:
POSIX User ID

See also: -user

GetX11Display ()

GetX11Display (out 's' display)

Returns the value of the X11 DISPLAY for this session +unix-user

GetX11Display ()

GetX11Display (out 's' display)

Returns the value of the X11 DISPLAY for this session if one is present.

display:
The value of the X11 display

See also: -x11-display

GetX11DisplayDevice ()

GetX11DisplayDevice (out 's' x11_display_device)

Returns the value of the display device (aka TTY) that the +x11-display

GetX11DisplayDevice ()

GetX11DisplayDevice (out 's' x11_display_device)

Returns the value of the display device (aka TTY) that the X11 display for the session is connected to. If there is no x11-display set then this value is undefined.

x11_display_device:
The value of the X11 display device

See also: -x11-display-device

GetDisplayDevice ()

GetDisplayDevice (out 's' display_device)

Returns the value of the display device (aka TTY) that the +x11-display-device

GetDisplayDevice ()

GetDisplayDevice (out 's' display_device)

Returns the value of the display device (aka TTY) that the session is connected to.

display_device:
The value of the display device

See also: -display-device

GetRemoteHostName ()

GetRemoteHostName (out 's' remote_host_name)

Returns the value of the remote host name for the session. +display-device

GetRemoteHostName ()

GetRemoteHostName (out 's' remote_host_name)

Returns the value of the remote host name for the session.

remote_host_name:
The remote host name

See also: -remote-host-name

IsActive ()

IsActive (out 'b' active)

Returns whether the session is active on the Seat that +remote-host-name

IsActive ()

IsActive (out 'b' active)

Returns whether the session is active on the Seat that it is attached to.

If the session is not attached to a seat this value is undefined.

active:
TRUE if the session is active, otherwise FALSE

See also: -active

IsLocal ()

IsLocal (out 'b' local)

Returns whether the session is local

FIXME: we need to come up with a concrete definition for this value. +active

IsLocal ()

IsLocal (out 'b' local)

Returns whether the session is local

FIXME: we need to come up with a concrete definition for this value. It was originally used as a way to identify XDMCP sessions that originate from a remote system.

local:
TRUE if the session is local, otherwise FALSE

See also: -is-local

GetCreationTime ()

GetCreationTime (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to +is-local

GetCreationTime ()

GetCreationTime (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to the time that the session was opened. -

iso8601_datetime:
An ISO 8601 format date-type string

Activate ()

Activate ()

Attempt to activate the this session. In most +

iso8601_datetime:
An ISO 8601 format date-type string

Activate ()

Activate ()

Attempt to activate the this session. In most cases, if successful, this will cause the session to become visible and become active on the seat that it is attached to.

See also: -Seat.ActivateSession()

Lock ()

Lock ()

This will cause a Lock +Seat.ActivateSession()

Lock ()

Lock ()

This will cause a Lock signal to be emitted for this session.

See also: -Lock signal

Unlock ()

Unlock ()

This will cause an Unlock +Lock signal

Unlock ()

Unlock ()

This will cause an Unlock signal to be emitted for this session.

This can be used by login managers to unlock a session before it is re-activated during fast-user-switching.

See also: -Unlock signal

GetIdleHint ()

GetIdleHint (out 'b' idle_hint)

Gets the value of the idle-hint +Unlock signal

GetIdleHint ()

GetIdleHint (out 'b' idle_hint)

Gets the value of the idle-hint property.

idle_hint:
The value of the idle-hint

See also: -idle-hint

GetIdleSinceHint ()

GetIdleSinceHint (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to +idle-hint

GetIdleSinceHint ()

GetIdleSinceHint (out 's' iso8601_datetime)

Returns an ISO 8601 date-time string that corresponds to the time of the last change of the idle-hint. -

iso8601_datetime:
An ISO 8601 format date-type string

SetIdleHint ()

SetIdleHint (in  'b' idle_hint)

This may be used by the session to indicate that +

iso8601_datetime:
An ISO 8601 format date-type string

SetIdleHint ()

SetIdleHint (in  'b' idle_hint)

This may be used by the session to indicate that it is idle.

Use of this method is restricted to the user - that owns the session.

idle_hint:
boolean value to set the idle-hint to

Signal Details

The ActiveChanged signal

ActiveChanged ('b' is_active)

Emitted when the active property has changed.

is_active:
TRUE if the session is active, otherwise FALSE

The IdleHintChanged signal

IdleHintChanged ('b' hint)

Emitted when the idle-hint property has changed.

hint:
the new value of idle-hint

The Lock signal

Lock ()

Emitted in response to a call to the Lock() method.

It is intended that the screensaver for the session should lock the screen in response to this signal.

The Unlock signal

Unlock ()

Emitted in response to a call to the Unlock() method.

It is intended that the screensaver for the session should unlock the screen in response to this signal.

Property Details

The "user" property

'user'  readwrite 'u'
-

The user assigned to the session.

The "session-type" property

'session-type'  readwrite 's'
+          that owns the session.

idle_hint:
boolean value to set the idle-hint to

Signal Details

The ActiveChanged signal

ActiveChanged ('b' is_active)

Emitted when the active property has changed.

is_active:
TRUE if the session is active, otherwise FALSE

The IdleHintChanged signal

IdleHintChanged ('b' hint)

Emitted when the idle-hint property has changed.

hint:
the new value of idle-hint

The Lock signal

Lock ()

Emitted in response to a call to the Lock() method.

It is intended that the screensaver for the session should lock the screen in response to this signal.

The Unlock signal

Unlock ()

Emitted in response to a call to the Unlock() method.

It is intended that the screensaver for the session should unlock the screen in response to this signal.

Property Details

The "unix-user" property

'unix-user'  readwrite 'u'
+

The user assigned to the session.

The "user" property

'user'  readwrite 'u'
+

The user assigned to the session.

Warning

user is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + unix-user +instead.

The "session-type" property

'session-type'  readwrite 's'
 

The type of the session.

Warning: we haven't yet defined the allowed values for this property. It is probably best to avoid this until we do. -

The "remote-host-name" property

'remote-host-name'  readwrite 's'
+          

The "remote-host-name" property

'remote-host-name'  readwrite 's'
 

The remote host name for the session.

This will be set in situations where the session is opened and controlled from a remote system.

For example, this value will be set when the session is created from an SSH or XDMCP connection. -

The "display-device" property

'display-device'  readwrite 's'
+          

The "display-device" property

'display-device'  readwrite 's'
 

The display device (aka TTY) that the session is connected to. -

The "x11-display" property

'x11-display'  readwrite 's'
+          

The "x11-display" property

'x11-display'  readwrite 's'
 

Value of the X11 DISPLAY for this session if one is present. -

The "x11-display-device" property

'x11-display-device'  readwrite 's'
+          

The "x11-display-device" property

'x11-display-device'  readwrite 's'
 

The display device (aka TTY) that the X11 display for the session is connected to. If there is no x11-display set then this value is undefined. -

The "active" property

'active'  readwrite 'b'
+          

The "active" property

'active'  readwrite 'b'
 

Whether the session is active on the Seat that it is attached to.

If the session is not attached to a seat this value is undefined. -

The "is-local" property

'is-local'  readwrite 'b'
+          

The "is-local" property

'is-local'  readwrite 'b'
 

Whether the session is local

FIXME: we need to come up with a concrete definition for this value. It was originally used as a way to identify XDMCP sessions that originate from a remote system. -

The "idle-hint" property

'idle-hint'  readwrite 'b'
+          

The "idle-hint" property

'idle-hint'  readwrite 'b'
 

This is a hint used to indicate that the session may be idle.

@@ -295,4 +314,4 @@ See also: on the activity detected on the display-device itself.

This should not be considered authoritative. -

Index

A

Activate
Session, Activate ()
ActivateSession
Seat, ActivateSession ()
active
Session, The "active" property
ActiveChanged
Session, The ActiveChanged signal
ActiveSessionChanged
Seat, The ActiveSessionChanged signal

C

CloseSession
Manager, CloseSession ()

D

display-device
Session, The "display-device" property

G

GetActiveSession
Seat, GetActiveSession ()
GetCreationTime
Session, GetCreationTime ()
GetCurrentSession
Manager, GetCurrentSession ()
GetDisplayDevice
Session, GetDisplayDevice ()
GetId
Seat, GetId ()
Session, GetId ()
GetIdleHint
Session, GetIdleHint ()
GetIdleSinceHint
Session, GetIdleSinceHint ()
GetRemoteHostName
Session, GetRemoteHostName ()
GetSeatId
Session, GetSeatId ()
GetSeats
Manager, GetSeats ()
GetSessionForCookie
Manager, GetSessionForCookie ()
GetSessionForUnixProcess
Manager, GetSessionForUnixProcess ()
GetSessions
Seat, GetSessions ()
GetSessionsForUser
Manager, GetSessionsForUser ()
GetSessionType
Session, GetSessionType ()
GetSystemIdleHint
Manager, GetSystemIdleHint ()
GetSystemIdleSinceHint
Manager, GetSystemIdleSinceHint ()
GetUser
Session, GetUser ()
GetX11Display
Session, GetX11Display ()
GetX11DisplayDevice
Session, GetX11DisplayDevice ()

I

idle-hint
Session, The "idle-hint" property
IdleHintChanged
Session, The IdleHintChanged signal
is-local
Session, The "is-local" property
IsActive
Session, IsActive ()
IsLocal
Session, IsLocal ()

L

Lock
Session, Lock (), The Lock signal

O

OpenSession
Manager, OpenSession ()
OpenSessionWithParameters
Manager, OpenSessionWithParameters ()

R

remote-host-name
Session, The "remote-host-name" property

S

SeatAdded
Manager, The SeatAdded signal
SeatRemoved
Manager, The SeatRemoved signal
session-type
Session, The "session-type" property
SessionAdded
Seat, The SessionAdded signal
SessionRemoved
Seat, The SessionRemoved signal
SetIdleHint
Session, SetIdleHint ()
SystemIdleHintChanged
Manager, The SystemIdleHintChanged signal

U

Unlock
Session, Unlock (), The Unlock signal
user
Session, The "user" property

X

x11-display
Session, The "x11-display" property
x11-display-device
Session, The "x11-display-device" property
+

Index

A

Activate
Session, Activate ()
ActivateSession
Seat, ActivateSession ()
active
Session, The "active" property
ActiveChanged
Session, The ActiveChanged signal
ActiveSessionChanged
Seat, The ActiveSessionChanged signal

C

CloseSession
Manager, CloseSession ()

D

display-device
Session, The "display-device" property

G

GetActiveSession
Seat, GetActiveSession ()
GetCreationTime
Session, GetCreationTime ()
GetCurrentSession
Manager, GetCurrentSession ()
GetDisplayDevice
Session, GetDisplayDevice ()
GetId
Seat, GetId ()
Session, GetId ()
GetIdleHint
Session, GetIdleHint ()
GetIdleSinceHint
Session, GetIdleSinceHint ()
GetRemoteHostName
Session, GetRemoteHostName ()
GetSeatId
Session, GetSeatId ()
GetSeats
Manager, GetSeats ()
GetSessionForCookie
Manager, GetSessionForCookie ()
GetSessionForUnixProcess
Manager, GetSessionForUnixProcess ()
GetSessions
Seat, GetSessions ()
GetSessionsForUnixUser
Manager, GetSessionsForUnixUser ()
GetSessionsForUser
Manager, GetSessionsForUser ()
GetSessionType
Session, GetSessionType ()
GetSystemIdleHint
Manager, GetSystemIdleHint ()
GetSystemIdleSinceHint
Manager, GetSystemIdleSinceHint ()
GetUnixUser
Session, GetUnixUser ()
GetUser
Session, GetUser ()
GetX11Display
Session, GetX11Display ()
GetX11DisplayDevice
Session, GetX11DisplayDevice ()

I

idle-hint
Session, The "idle-hint" property
IdleHintChanged
Session, The IdleHintChanged signal
is-local
Session, The "is-local" property
IsActive
Session, IsActive ()
IsLocal
Session, IsLocal ()

L

Lock
Session, Lock (), The Lock signal

O

OpenSession
Manager, OpenSession ()
OpenSessionWithParameters
Manager, OpenSessionWithParameters ()

R

remote-host-name
Session, The "remote-host-name" property

S

SeatAdded
Manager, The SeatAdded signal
SeatRemoved
Manager, The SeatRemoved signal
session-type
Session, The "session-type" property
SessionAdded
Seat, The SessionAdded signal
SessionRemoved
Seat, The SessionRemoved signal
SetIdleHint
Session, SetIdleHint ()
SystemIdleHintChanged
Manager, The SystemIdleHintChanged signal

U

unix-user
Session, The "unix-user" property
Unlock
Session, Unlock (), The Unlock signal
user
Session, The "user" property

X

x11-display
Session, The "x11-display" property
x11-display-device
Session, The "x11-display-device" property
diff --git a/doc/dbus-introspect-docs.dtd b/doc/dbus-introspect-docs.dtd index ce7204e..a3817cc 100644 --- a/doc/dbus-introspect-docs.dtd +++ b/doc/dbus-introspect-docs.dtd @@ -8,7 +8,7 @@ - + diff --git a/doc/spec/ck-manager.xml b/doc/spec/ck-manager.xml index 998df32..077782f 100644 --- a/doc/spec/ck-manager.xml +++ b/doc/spec/ck-manager.xml @@ -192,6 +192,27 @@ + + + + + POSIX User identification + + + + + an array of Session IDs + + + + + This gets a list of all the Sessions + that are currently open for the specified user. + Each Session ID is an D-Bus object path for the object that implements the + Session interface. + + + @@ -211,6 +232,7 @@ Each Session ID is an D-Bus object path for the object that implements the Session interface. + diff --git a/doc/spec/ck-session.xml b/doc/spec/ck-session.xml index 5b1d843..c927c8c 100644 --- a/doc/spec/ck-session.xml +++ b/doc/spec/ck-session.xml @@ -61,9 +61,22 @@ Returns the user that the session belongs to. + user + + + + POSIX User ID + + + + Returns the POSIX user ID that the session belongs to. + + unix-user + + @@ -291,11 +304,19 @@ + + + + The user assigned to the session. + + + The user assigned to the session. + diff --git a/doc/tools/spec-to-docbook.xsl b/doc/tools/spec-to-docbook.xsl index a0959fb..fccf887 100644 --- a/doc/tools/spec-to-docbook.xsl +++ b/doc/tools/spec-to-docbook.xsl @@ -108,6 +108,7 @@ + @@ -145,6 +146,7 @@ + @@ -199,6 +201,48 @@ + + + + + /> + + + + + + + is deprecated since version and should not be used in newly-written code. Use + + + + + : + + + :: + + + . + + + + + + + + + + + + + + + +instead. + + + @@ -213,23 +257,35 @@ See also: - + + + + + - - + + - - + + - - + + - - + + + + + + + + + + @@ -242,6 +298,7 @@ See also: + diff --git a/doc/xml/ref-ck-manager.xml b/doc/xml/ref-ck-manager.xml index dc01375..2aceef8 100644 --- a/doc/xml/ref-ck-manager.xml +++ b/doc/xml/ref-ck-manager.xml @@ -19,6 +19,8 @@ GetSessionForUnixProcess (in 'u' pid, out 'o' ssid) GetCurrentSession (out 'o' ssid) +GetSessionsForUnixUser (in 'u' uid, + out 'ao' sessions) GetSessionsForUser (in 'u' uid, out 'ao' sessions) GetSystemIdleHint (out 'b' idle_hint) @@ -143,13 +145,22 @@ See also: /org/freedesktop/ConsoleKit/Manager \ org.freedesktop.ConsoleKit.Manager.GetCurrentSession - ssid:The object identifier for the current session<anchor role="function" id="Manager.GetSessionsForUser"/>GetSessionsForUser ()GetSessionsForUserManagerGetSessionsForUser (in 'u' uid, + ssid:The object identifier for the current session<anchor role="function" id="Manager.GetSessionsForUnixUser"/>GetSessionsForUnixUser ()GetSessionsForUnixUserManagerGetSessionsForUnixUser (in 'u' uid, + out 'ao' sessions) + This gets a list of all the Sessions + that are currently open for the specified user. + Each Session ID is an D-Bus object path for the object that implements the + Session interface. + uid:POSIX User identificationsessions:an array of Session IDs<anchor role="function" id="Manager.GetSessionsForUser"/>GetSessionsForUser ()GetSessionsForUserManagerGetSessionsForUser (in 'u' uid, out 'ao' sessions) This gets a list of all the Sessions that are currently open for the specified user. Each Session ID is an D-Bus object path for the object that implements the Session interface. - uid:User identificationsessions:an array of Session IDs<anchor role="function" id="Manager.GetSystemIdleHint"/>GetSystemIdleHint ()GetSystemIdleHintManagerGetSystemIdleHint (out 'b' idle_hint) + uid:User identificationsessions:an array of Session IDsGetSessionsForUser is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + GetSessionsForUnixUser +instead.<anchor role="function" id="Manager.GetSystemIdleHint"/>GetSystemIdleHint ()GetSystemIdleHintManagerGetSystemIdleHint (out 'b' idle_hint) Returns TRUE if the idle-hint property of every open session is TRUE or if there are no open sessions. diff --git a/doc/xml/ref-ck-session.xml b/doc/xml/ref-ck-session.xml index 2c5d369..9b32318 100644 --- a/doc/xml/ref-ck-session.xml +++ b/doc/xml/ref-ck-session.xml @@ -12,6 +12,7 @@ GetSeatId (out 'o' sid) GetSessionType (out 's' type) GetUser (out 'i' uid) +GetUnixUser (out 'i' uid) GetX11Display (out 's' display) GetX11DisplayDevice (out 's' x11_display_device) GetDisplayDevice (out 's' display_device) @@ -44,7 +45,8 @@ Properties - 'user' readwrite 'u' + 'unix-user' readwrite 'u' +'user' readwrite 'u' 'session-type' readwrite 's' 'remote-host-name' readwrite 's' 'display-device' readwrite 's' @@ -81,9 +83,15 @@ See also: type:Session type See also: session-type<anchor role="function" id="Session.GetUser"/>GetUser ()GetUserSessionGetUser (out 'i' uid)Returns the user that the session belongs to. - uid:User ID + uid:User IDGetUser is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + GetUnixUser +instead. See also: -user<anchor role="function" id="Session.GetX11Display"/>GetX11Display ()GetX11DisplaySessionGetX11Display (out 's' display)Returns the value of the X11 DISPLAY for this session +user<anchor role="function" id="Session.GetUnixUser"/>GetUnixUser ()GetUnixUserSessionGetUnixUser (out 'i' uid)Returns the POSIX user ID that the session belongs to. + uid:POSIX User ID +See also: +unix-user<anchor role="function" id="Session.GetX11Display"/>GetX11Display ()GetX11DisplaySessionGetX11Display (out 's' display)Returns the value of the X11 DISPLAY for this session if one is present. display:The value of the X11 display See also: @@ -167,10 +175,16 @@ See also: Emitted in response to a call to the Unlock() method. It is intended that the screensaver for the session should unlock the screen in response to this signal. - Property Details<anchor role="function" id="Session:user"/>The "user" propertyuserSession'user' readwrite 'u' + Property Details<anchor role="function" id="Session:unix-user"/>The "unix-user" propertyunix-userSession'unix-user' readwrite 'u' + + The user assigned to the session. + <anchor role="function" id="Session:user"/>The "user" propertyuserSession'user' readwrite 'u' The user assigned to the session. - <anchor role="function" id="Session:session-type"/>The "session-type" propertysession-typeSession'session-type' readwrite 's' + user is deprecated since version 0.1.3 and should not be used in newly-written code. Use + + unix-user +instead.<anchor role="function" id="Session:session-type"/>The "session-type" propertysession-typeSession'session-type' readwrite 's' The type of the session. Warning: we haven't yet defined the allowed values for this property. diff --git a/src/ck-manager.c b/src/ck-manager.c index 8e66419..4575eb1 100644 --- a/src/ck-manager.c +++ b/src/ck-manager.c @@ -1473,14 +1473,14 @@ typedef struct { } GetSessionsData; static void -get_sessions_for_user_iter (char *id, - CkSession *session, - GetSessionsData *data) +get_sessions_for_unix_user_iter (char *id, + CkSession *session, + GetSessionsData *data) { guint uid; gboolean res; - res = ck_session_get_user (session, &uid, NULL); + res = ck_session_get_unix_user (session, &uid, NULL); if (res && uid == data->uid) { g_ptr_array_add (data->sessions, g_strdup (id)); @@ -1488,9 +1488,9 @@ get_sessions_for_user_iter (char *id, } gboolean -ck_manager_get_sessions_for_user (CkManager *manager, - guint uid, - DBusGMethodInvocation *context) +ck_manager_get_sessions_for_unix_user (CkManager *manager, + guint uid, + DBusGMethodInvocation *context) { GetSessionsData *data; @@ -1500,7 +1500,7 @@ ck_manager_get_sessions_for_user (CkManager *manager, data->uid = uid; data->sessions = g_ptr_array_new (); - g_hash_table_foreach (manager->priv->sessions, (GHFunc)get_sessions_for_user_iter, data); + g_hash_table_foreach (manager->priv->sessions, (GHFunc)get_sessions_for_unix_user_iter, data); dbus_g_method_return (context, data->sessions); @@ -1511,6 +1511,15 @@ ck_manager_get_sessions_for_user (CkManager *manager, return TRUE; } +/* This is deprecated */ +gboolean +ck_manager_get_sessions_for_user (CkManager *manager, + guint uid, + DBusGMethodInvocation *context) +{ + return ck_manager_get_sessions_for_unix_user (manager, uid, context); +} + static void listify_seat_ids (char *id, CkSeat *seat, diff --git a/src/ck-manager.h b/src/ck-manager.h index 331a5c4..a6fd670 100644 --- a/src/ck-manager.h +++ b/src/ck-manager.h @@ -87,6 +87,10 @@ gboolean ck_manager_get_session_for_cookie (CkManager gboolean ck_manager_get_session_for_unix_process (CkManager *manager, guint pid, DBusGMethodInvocation *context); +gboolean ck_manager_get_sessions_for_unix_user (CkManager *manager, + guint uid, + DBusGMethodInvocation *context); +/* deprecated */ gboolean ck_manager_get_sessions_for_user (CkManager *manager, guint uid, DBusGMethodInvocation *context); diff --git a/src/ck-manager.xml b/src/ck-manager.xml index 5dc9213..f40d6d5 100644 --- a/src/ck-manager.xml +++ b/src/ck-manager.xml @@ -32,6 +32,11 @@ + + + + + diff --git a/src/ck-session.c b/src/ck-session.c index c88cbbc..725a355 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -87,6 +87,7 @@ enum { PROP_ID, PROP_COOKIE, PROP_USER, + PROP_UNIX_USER, PROP_X11_DISPLAY, PROP_X11_DISPLAY_DEVICE, PROP_DISPLAY_DEVICE, @@ -441,9 +442,9 @@ ck_session_get_seat_id (CkSession *session, } gboolean -ck_session_get_user (CkSession *session, - guint *uid, - GError **error) +ck_session_get_unix_user (CkSession *session, + guint *uid, + GError **error) { g_return_val_if_fail (CK_IS_SESSION (session), FALSE); @@ -454,6 +455,15 @@ ck_session_get_user (CkSession *session, return TRUE; } +/* deprecated */ +gboolean +ck_session_get_user (CkSession *session, + guint *uid, + GError **error) +{ + return ck_session_get_unix_user (session, uid, error); +} + gboolean ck_session_get_x11_display (CkSession *session, char **x11_display, @@ -606,9 +616,9 @@ ck_session_set_seat_id (CkSession *session, } gboolean -ck_session_set_user (CkSession *session, - guint uid, - GError **error) +ck_session_set_unix_user (CkSession *session, + guint uid, + GError **error) { g_return_val_if_fail (CK_IS_SESSION (session), FALSE); @@ -717,8 +727,11 @@ ck_session_set_property (GObject *object, case PROP_DISPLAY_DEVICE: ck_session_set_display_device (self, g_value_get_string (value), NULL); break; - case PROP_USER: - ck_session_set_user (self, g_value_get_uint (value), NULL); + case PROP_UNIX_USER: + ck_session_set_unix_user (self, g_value_get_uint (value), NULL); + break; + case PROP_USER: /* deprecated */ + ck_session_set_unix_user (self, g_value_get_uint (value), NULL); break; case PROP_REMOTE_HOST_NAME: ck_session_set_remote_host_name (self, g_value_get_string (value), NULL); @@ -767,7 +780,10 @@ ck_session_get_property (GObject *object, case PROP_DISPLAY_DEVICE: g_value_set_string (value, self->priv->display_device); break; - case PROP_USER: + case PROP_UNIX_USER: + g_value_set_uint (value, self->priv->uid); + break; + case PROP_USER: /* deprecated */ g_value_set_uint (value, self->priv->uid); break; case PROP_REMOTE_HOST_NAME: @@ -1014,6 +1030,16 @@ ck_session_class_init (CkSessionClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_object_class_install_property (object_class, + PROP_UNIX_USER, + g_param_spec_uint ("unix-user", + "POSIX User Id", + "POSIX User Id", + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + /* deprecated */ g_object_class_install_property (object_class, PROP_USER, g_param_spec_uint ("user", diff --git a/src/ck-session.h b/src/ck-session.h index 40c5e9d..fea3a71 100644 --- a/src/ck-session.h +++ b/src/ck-session.h @@ -89,7 +89,7 @@ gboolean ck_session_set_cookie (CkSession *se gboolean ck_session_set_seat_id (CkSession *session, const char *sid, GError **error); -gboolean ck_session_set_user (CkSession *session, +gboolean ck_session_set_unix_user (CkSession *session, guint uid, GError **error); gboolean ck_session_set_x11_display (CkSession *session, @@ -123,7 +123,7 @@ gboolean ck_session_is_active (CkSession *se gboolean ck_session_is_local (CkSession *session, gboolean *local, GError **error); -gboolean ck_session_get_user (CkSession *session, +gboolean ck_session_get_unix_user (CkSession *session, guint *uid, GError **error); gboolean ck_session_get_x11_display (CkSession *session, @@ -144,6 +144,10 @@ gboolean ck_session_get_remote_host_name (CkSession *se gboolean ck_session_get_creation_time (CkSession *session, char **iso8601_datetime, GError **error); +/*deprecated*/ +gboolean ck_session_get_user (CkSession *session, + guint *uid, + GError **error); /* Non-authoritative properties */ gboolean ck_session_get_idle_hint (CkSession *session, diff --git a/src/ck-session.xml b/src/ck-session.xml index 5699c04..5fc85d0 100644 --- a/src/ck-session.xml +++ b/src/ck-session.xml @@ -13,6 +13,9 @@ + + + @@ -61,6 +64,7 @@ + diff --git a/tools/linux/ck-collect-session-info.c b/tools/linux/ck-collect-session-info.c index ec6dda2..5e8e07d 100644 --- a/tools/linux/ck-collect-session-info.c +++ b/tools/linux/ck-collect-session-info.c @@ -318,7 +318,7 @@ fill_session_info (SessionInfo *si) static void print_session_info (SessionInfo *si) { - printf ("user = %u\n", si->uid); + printf ("unix-user = %u\n", si->uid); if (si->x11_display != NULL) { printf ("x11-display = %s\n", si->x11_display); } diff --git a/tools/list-sessions.c b/tools/list-sessions.c index 1ea9110..75828ed 100644 --- a/tools/list-sessions.c +++ b/tools/list-sessions.c @@ -192,7 +192,7 @@ list_session (DBusGConnection *connection, creation_time = NULL; idle_since_hint = NULL; - get_int (proxy, "GetUser", &uid); + get_int (proxy, "GetUnixUser", &uid); get_path (proxy, "GetSeatId", &sid); get_string (proxy, "GetSessionType", &session_type); get_string (proxy, "GetX11Display", &x11_display); -- cgit