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