KGreeterPlugin Class Reference

#include <kgreeterplugin.h>

Inheritance diagram for KGreeterPlugin:
KClassicGreeter KPamGreeter KWinbindGreeter

List of all members.

Public Types

enum  Function { Authenticate, AuthChAuthTok, ChAuthTok }
enum  Context {
  Login, Shutdown, Unlock, ChangeTok,
  ExUnlock, ExChangeTok
}

Public Member Functions

 KGreeterPlugin (KGreeterPluginHandler *h)
virtual void loadUsers (const TQStringList &users)=0
virtual void presetEntity (const TQString &entity, int field)=0
virtual TQString getEntity () const =0
virtual void setUser (const TQString &user)=0
virtual void setEnabled (bool on)=0
virtual bool textMessage (const char *message, bool error)=0
virtual void textPrompt (const char *prompt, bool echo, bool nonBlocking)=0
virtual bool binaryPrompt (const char *prompt, bool nonBlocking)=0
virtual void start ()=0
virtual void suspend ()=0
virtual void resume ()=0
virtual void next ()=0
virtual void abort ()=0
virtual void succeeded ()=0
virtual void failed ()=0
virtual void revive ()=0
virtual void clear ()=0
TQLayoutItem * getLayoutItem () const

Protected Attributes

KGreeterPluginHandlerhandler
TQLayoutItem * layoutItem

Detailed Description

Abstract base class for conversation plugins ("talkers") to be used with KDM, kdesktop_lock, etc. The authentication method used by a particular instance of a plugin may be configurable, but the instance must handle exactly one method, i.e., info->method must be determined at the latest at init() time.


Member Enumeration Documentation

Contexts the talker can be used in:

  • Login: kdm login dialog
  • Shutdown: kdm shutdown dialog
  • Unlock: kdm unlock dialog (TODO)
  • ChangeTok: kdm password change dialog (TODO)
  • ExUnlock: kdesktop_lock unlock dialog
  • ExChangeTok: kdepasswd password change dialog (TODO)

The Ex* contexts exist within a running session; the talker must know how to obtain the currently logged in user (+ domain/realm, etc.) itself (i.e., fixedEntity will be null). The non-Ex variants will have a fixedEntity passed in.

Variations of the talker:

  • Authenticate: authentication
  • AuthChAuthTok: authentication and password change
  • ChAuthTok: password change

Member Function Documentation

virtual void KGreeterPlugin::abort (  )  [pure virtual]

Abort auth cycle. Note that this should _not_ clear out already entered auth tokens if they are still on the screen. Will be called only when running and stops it.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual bool KGreeterPlugin::binaryPrompt ( const char *  prompt,
bool  nonBlocking 
) [pure virtual]

Request binary authentication data from the talker. Reply by calling handler->gplugReturnBinary().

Parameters:
prompt prompt in pam_client format
nonBlocking if true, report whatever is already available, otherwise wait for user input.
Returns:
always true for now

TODO:

Returns:
if true, the prompt was handled by the talker, otherwise the handler has to use libpam_client to obtain the authentication data. In that state the talker still can abort the data fetch by gplugReturn()ing a null array. When the data was obtained, another binaryPrompt with a null prompt will be issued.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::clear (  )  [pure virtual]

Clear any edit widgets, particularily anything set by setUser. Will be called only when not running.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::failed (  )  [pure virtual]

Indicate unsuccessful end of the current phase. This is mostly a request to disable all editable widgets. The widget will be treated as dead until revive() is called. Will be called only when running and stops it.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual TQString KGreeterPlugin::getEntity (  )  const [pure virtual]

Obtain the actually logged in entity. Will be called only after succeeded() was called.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

TQLayoutItem* KGreeterPlugin::getLayoutItem (  )  const [inline]

Obtain the TQLayoutItem containg the widget(s) to actually handle the conversation. See TQLayout and TQWidgetItem for possible implementations.

Reimplemented in KPamGreeter.

virtual void KGreeterPlugin::loadUsers ( const TQStringList &  users  )  [pure virtual]

Provide the talker with a list of selectable users. This can be used for autocompletion, etc. Will be called only when not running.

Parameters:
users the users to load.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::next (  )  [pure virtual]

The "login" button was pressed in the greeter. This might call gplugReturn* or gplugStart. Will be called only when running.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::presetEntity ( const TQString &  entity,
int  field 
) [pure virtual]

Preload the talker with an (opaque to the greeter) entity. Will be called only when not running.

Parameters:
entity the entity to preload the talker with. That will usually be something like "user" or "user@domain".
field the sub-widget (probably line edit) to put the cursor into. If -1, preselect the user for timed login. This means pre-filling the password field with anything, disabling it, and placing the cursor in the user name field.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::resume (  )  [pure virtual]

Request to resume the auth from the point it was suspended at. Will be called only when suspended.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::revive (  )  [pure virtual]

Prepare retrying the previously failed phase. This is mostly a request to re-enable all editable widgets failed() disabled previously, clear the probably incorrect authentication tokens and to set the input focus appropriately. Will be called only after failed() (possibly with clear() in between), or after presetEntity() with field -1.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::setEnabled ( bool  on  )  [pure virtual]

En-/disable any widgets contained in the talker. Will be called only when not running.

Parameters:
on the state to set

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::setUser ( const TQString &  user  )  [pure virtual]

"Push" a user into the talker. That can be a click into the user list or successful authentication without the talker calling gplugSetUser. Will be called only when running.

Parameters:
user the user to set. Note that this is a UNIX login, not a canonical entity

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::start (  )  [pure virtual]

This can either

  • Start a processing cycle. Will be called only when not running.
  • Restart authTok cycle - will be called while running and implies revive(). PAM is a bit too clever, so we need this. In any case the talker is running afterwards.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::succeeded (  )  [pure virtual]

Indicate successful end of the current phase. This is more or less a request to disable editable widgets responsible for the that phase. There will be no further attempt to enter that phase until the widget is destroyed. Will be called only when running and stops it.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::suspend (  )  [pure virtual]

Request to suspend the auth. Make sure that a second talker of any type will be able to operate while this one is suspended (no busy device nodes, etc.). Will be called only if running within Login context. (Actually it won't be called at all, but be prepared.)

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual bool KGreeterPlugin::textMessage ( const char *  message,
bool  error 
) [pure virtual]

Called when a message from the authentication backend arrives.

Parameters:
message the message received from the backend
error if true, message is an error message, otherwise it's an informational message
Returns:
true means that the talker already handled the message, false that the greeter should display it in a message box

FIXME: Filtering a message usually means that the backend issued a prompt and obtains the authentication data itself. However, in that state the backend is unresponsive, e.g., no shutdown is possible. The frontend could send the backend a signal, but the "escape path" within the backend is unclear (PAM won't like simply longjmp()ing out of it).

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.

virtual void KGreeterPlugin::textPrompt ( const char *  prompt,
bool  echo,
bool  nonBlocking 
) [pure virtual]

Prompt the user for data. Reply by calling handler->gplugReturnText().

Parameters:
propmt the prompt to display. It may be null, in which case "Username"/"Password" should be shown and the replies should be tagged with the respective Is* flag.
echo if true, a normal input widget can be used, otherwise one that visually obscures the user's input.
nonBlocking if true, report whatever is already available, otherwise wait for user input.

Implemented in KClassicGreeter, KPamGreeter, and KWinbindGreeter.


The documentation for this class was generated from the following file:

Generated on Sat Oct 2 22:59:35 2010 by  doxygen 1.6.1