diff options
Diffstat (limited to 'libsylph/utils.c')
| -rw-r--r-- | libsylph/utils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libsylph/utils.c b/libsylph/utils.c index 6ecf328..3bbcbcf 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c | |||
| @@ -4598,6 +4598,36 @@ gchar *input_query_password(const gchar *server, const gchar *user) | |||
| 4598 | return NULL; | 4598 | return NULL; |
| 4599 | } | 4599 | } |
| 4600 | 4600 | ||
| 4601 | static QueryMasterPasswordFunc query_master_password_func = NULL; | ||
| 4602 | |||
| 4603 | void set_input_query_master_password_func(QueryMasterPasswordFunc func) | ||
| 4604 | { | ||
| 4605 | query_master_password_func = func; | ||
| 4606 | } | ||
| 4607 | |||
| 4608 | gchar *input_query_master_password(void) | ||
| 4609 | { | ||
| 4610 | if (query_master_password_func) | ||
| 4611 | return query_master_password_func(); | ||
| 4612 | else | ||
| 4613 | return NULL; | ||
| 4614 | } | ||
| 4615 | |||
| 4616 | static SetNewPasswordFunc set_new_password_func = NULL; | ||
| 4617 | |||
| 4618 | void set_input_set_new_password_func(SetNewPasswordFunc func) | ||
| 4619 | { | ||
| 4620 | set_new_password_func = func; | ||
| 4621 | } | ||
| 4622 | |||
| 4623 | gchar *input_set_new_password(guint max_attempts) | ||
| 4624 | { | ||
| 4625 | if (set_new_password_func) | ||
| 4626 | return set_new_password_func(max_attempts); | ||
| 4627 | else | ||
| 4628 | return NULL; | ||
| 4629 | } | ||
| 4630 | |||
| 4601 | /* logging */ | 4631 | /* logging */ |
| 4602 | 4632 | ||
| 4603 | static FILE *log_fp = NULL; | 4633 | static FILE *log_fp = NULL; |
