~ubuntu-branches/ubuntu/trusty/unity-control-center/trusty

« back to all changes in this revision

Viewing changes to panels/user-accounts/run-passwd.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-01-08 16:29:18 UTC
  • Revision ID: package-import@ubuntu.com-20140108162918-g29dd08tr913y2qh
Tags: upstream-14.04.0
ImportĀ upstreamĀ versionĀ 14.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/* run-passwd.h: this file is part of users-admin, a gnome-system-tools frontend
 
3
 * for user administration.
 
4
 *
 
5
 * Copyright (C) 2010 Milan Bouchet-Valat
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as
 
9
 * published by the Free Software Foundation; either version 2 of the
 
10
 * License, or (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
20
 *
 
21
 * Authors: Milan Bouchet-Valat <nalimilan@club.fr>
 
22
 */
 
23
 
 
24
#ifndef _RUN_PASSWD_H
 
25
#define _RUN_PASSWD_H
 
26
 
 
27
struct PasswdHandler;
 
28
 
 
29
typedef struct PasswdHandler PasswdHandler;
 
30
 
 
31
typedef void (*PasswdCallback) (PasswdHandler *passwd_handler, GError *error, const gpointer user_data);
 
32
 
 
33
/* Error codes */
 
34
typedef enum {
 
35
        PASSWD_ERROR_REJECTED,          /* New password is not secure enough */
 
36
        PASSWD_ERROR_AUTH_FAILED,       /* Wrong old password, or PAM failure */
 
37
        PASSWD_ERROR_REAUTH_FAILED,     /* Password has changed since first authentication */
 
38
        PASSWD_ERROR_BACKEND,           /* Backend error */
 
39
        PASSWD_ERROR_UNKNOWN            /* General error */
 
40
} PasswdError;
 
41
 
 
42
 
 
43
PasswdHandler *passwd_init                (void);
 
44
 
 
45
void           passwd_destroy             (PasswdHandler *passwd_handler);
 
46
 
 
47
void           passwd_authenticate        (PasswdHandler *passwd_handler,
 
48
                                           const char    *current_password,
 
49
                                           PasswdCallback cb,
 
50
                                           gpointer       user_data);
 
51
 
 
52
gboolean       passwd_change_password     (PasswdHandler *passwd_handler,
 
53
                                           const char    *new_password,
 
54
                                           PasswdCallback cb,
 
55
                                           const gpointer user_data);
 
56
 
 
57
#endif /* _RUN_PASSWD_H */
 
58