Mercurial > pidgin.yaz
annotate libpurple/plugins/one_time_password.c @ 32816:ec6371d4cae8
Add purple_account_is_disconnecting() accessor function.
author | andrew.victor@mxit.com |
---|---|
date | Sun, 06 Nov 2011 20:31:14 +0000 |
parents | 425fc6b6c110 |
children |
rev | line source |
---|---|
25455
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
1 /* |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
2 * One Time Password support plugin for libpurple |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
3 * |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
4 * Copyright (C) 2009, Daniel Atallah <datallah@pidgin.im> |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
5 * |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
6 * This program is free software; you can redistribute it and/or |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
7 * modify it under the terms of the GNU General Public License as |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
8 * published by the Free Software Foundation; either version 2 of the |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
9 * License, or (at your option) any later version. |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
10 * |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, but |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
12 * WITHOUT ANY WARRANTY; without even the implied warranty of |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
14 * General Public License for more details. |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
15 * |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
19 * 02111-1301, USA. |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
20 */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
21 #include "internal.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
22 #include "debug.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
23 #include "plugin.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
24 #include "version.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
25 #include "account.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
26 #include "accountopt.h" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
27 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
28 #define PLUGIN_ID "core-one_time_password" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
29 #define PREF_NAME PLUGIN_ID "_enabled" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
30 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
31 static void |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
32 signed_on_cb(PurpleConnection *conn, void *data) |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
33 { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
34 PurpleAccount *account = purple_connection_get_account(conn); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
35 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
36 if (purple_account_get_bool(account, PREF_NAME, FALSE)) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
37 if(purple_account_get_remember_password(account)) |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
38 purple_debug_error("One Time Password", |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
39 "Unable to enforce one time password for account %s (%s).\n" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
40 "Account is set to remember the password.\n", |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
41 purple_account_get_username(account), |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
42 purple_account_get_protocol_name(account)); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
43 else { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
44 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
45 purple_debug_info("One Time Password", "Clearing password for account %s (%s).\n", |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
46 purple_account_get_username(account), |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
47 purple_account_get_protocol_name(account)); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
48 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
49 purple_account_set_password(account, NULL); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
50 /* TODO: Do we need to somehow clear conn->password ? */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
51 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
52 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
53 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
54 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
55 static gboolean |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
56 plugin_load(PurplePlugin *plugin) |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
57 { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
58 PurplePlugin *prpl; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
59 PurplePluginProtocolInfo *prpl_info; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
60 PurpleAccountOption *option; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
61 GList *l; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
62 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
63 /* Register protocol preference. */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
64 for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
65 prpl = (PurplePlugin *)l->data; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
66 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
67 if (prpl_info != NULL && !(prpl_info->options & OPT_PROTO_NO_PASSWORD)) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
68 option = purple_account_option_bool_new(_("One Time Password"), |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
69 PREF_NAME, FALSE); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
70 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
71 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
72 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
73 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
74 /* Register callback. */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
75 purple_signal_connect(purple_connections_get_handle(), "signed-on", |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
76 plugin, PURPLE_CALLBACK(signed_on_cb), NULL); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
77 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
78 return TRUE; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
79 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
80 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
81 static gboolean |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
82 plugin_unload(PurplePlugin *plugin) |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
83 { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
84 PurplePlugin *prpl; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
85 PurplePluginProtocolInfo *prpl_info; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
86 PurpleAccountOption *option; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
87 GList *l, *options; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
88 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
89 /* Remove protocol preference. */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
90 for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
91 prpl = (PurplePlugin *)l->data; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
92 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
93 if (prpl_info != NULL && !(prpl_info->options & OPT_PROTO_NO_PASSWORD)) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
94 options = prpl_info->protocol_options; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
95 while (options != NULL) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
96 option = (PurpleAccountOption *) options->data; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
97 if (strcmp(PREF_NAME, purple_account_option_get_setting(option)) == 0) { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
98 prpl_info->protocol_options = g_list_delete_link(prpl_info->protocol_options, options); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
99 purple_account_option_destroy(option); |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
100 break; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
101 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
102 options = options->next; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
103 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
104 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
105 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
106 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
107 /* Callback will be automagically unregistered */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
108 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
109 return TRUE; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
110 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
111 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
112 static PurplePluginInfo info = |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
113 { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
114 PURPLE_PLUGIN_MAGIC, |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
115 PURPLE_MAJOR_VERSION, |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
116 PURPLE_MINOR_VERSION, |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
117 PURPLE_PLUGIN_STANDARD, /**< type */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
118 NULL, /**< ui_requirement */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
119 0, /**< flags */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
120 NULL, /**< dependencies */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
121 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
122 PLUGIN_ID, /**< id */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
123 N_("One Time Password Support"), /**< name */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
124 DISPLAY_VERSION, /**< version */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
125 /** summary */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
126 N_("Enforce that passwords are used only once."), |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
127 /** description */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
128 N_("Allows you to enforce on a per-account basis that passwords not " |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
129 "being saved are only used in a single successful connection.\n" |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
130 "Note: The account password must not be saved for this to work."), |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
131 "Daniel Atallah <datallah@pidgin.im>", /**< author */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
132 PURPLE_WEBSITE, /**< homepage */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
133 plugin_load, /**< load */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
134 plugin_unload, /**< unload */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
135 NULL, /**< destroy */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
136 NULL, /**< ui_info */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
137 NULL, /**< extra_info */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
138 NULL, /**< prefs_info */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
139 NULL, /**< actions */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
140 NULL, /**< reserved 1 */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
141 NULL, /**< reserved 2 */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
142 NULL, /**< reserved 3 */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
143 NULL /**< reserved 4 */ |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
144 }; |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
145 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
146 static void |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
147 init_plugin(PurplePlugin *plugin) |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
148 { |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
149 } |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
150 |
425fc6b6c110
Implementation of a plugin to facilitate use of One Time Passwords by
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
151 PURPLE_INIT_PLUGIN(one_time_password, init_plugin, info) |