summaryrefslogtreecommitdiff
path: root/src/libaccountsservice/act-user.c
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <jasuarez@igalia.com>2015-03-16 09:12:26 +0000
committerRay Strode <rstrode@redhat.com>2015-03-16 07:23:32 -0400
commit36b424b4aad91aaf91eeb6b6285cf550b15fcfeb (patch)
tree7d53accbc78b9ec67b1fe698ab292a7708fc0bc0 /src/libaccountsservice/act-user.c
parent46c4a6ceed751aff599a6a79c662b8a06164176e (diff)
accountsservice: Add SetPasswordHint function
So far the only way of setting the password hint is by setting also the password. But there are several cases where setting the password isn't done through AccountsService, but still we want to set the password hint. For instance GDM setups the pasword for new used directly from PAM. Thus, let's add a new function to set the hint without changing the password. https://bugs.freedesktop.org/show_bug.cgi?id=89588
Diffstat (limited to 'src/libaccountsservice/act-user.c')
-rw-r--r--src/libaccountsservice/act-user.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index 8073d72..4a820ae 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -1880,6 +1880,34 @@ act_user_set_password (ActUser *user,
}
/**
+ * act_uset_set_password_hint:
+ * @user: the user object to alter.
+ * @hint: a hint to help user recall password
+ *
+ * Sets the password hint of @user.
+ * @hint is displayed to the user if they forget the password.
+ *
+ * Note this function is synchronous and ignores errors.
+ **/
+void
+act_user_set_password_hint (ActUser *user,
+ const gchar *hint)
+{
+ GError *error = NULL;
+
+ g_return_if_fail (ACT_IS_USER (user));
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+
+ if (!accounts_user_call_set_password_hint_sync (user->accounts_proxy,
+ hint,
+ NULL,
+ &error)) {
+ g_warning ("SetPasswordHint call failed: %s", error->message);
+ g_error_free (error);
+ }
+}
+
+/**
* act_user_set_password_mode:
* @user: the user object to alter.
* @password_mode: a #ActUserPasswordMode