[gnome-control-center] user-accounts: Rename UmRealmManager to CcRealmManager
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Rename UmRealmManager to CcRealmManager
- Date: Tue, 13 Nov 2018 21:16:07 +0000 (UTC)
commit feaa29bfc03d5f1161e89a045846194daba72df7
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Nov 8 10:56:19 2018 +1300
user-accounts: Rename UmRealmManager to CcRealmManager
Um is a naming hangover from before this was part of g-c-c.
panels/user-accounts/cc-add-user-dialog.c | 90 ++++++------
.../{um-realm-manager.c => cc-realm-manager.c} | 152 ++++++++++-----------
.../{um-realm-manager.h => cc-realm-manager.h} | 44 +++---
panels/user-accounts/cc-user-panel.c | 29 ++--
panels/user-accounts/meson.build | 6 +-
po/POTFILES.in | 2 +-
6 files changed, 161 insertions(+), 162 deletions(-)
---
diff --git a/panels/user-accounts/cc-add-user-dialog.c b/panels/user-accounts/cc-add-user-dialog.c
index e0cd5eb17..7a09747e9 100644
--- a/panels/user-accounts/cc-add-user-dialog.c
+++ b/panels/user-accounts/cc-add-user-dialog.c
@@ -26,7 +26,7 @@
#include <act/act.h>
#include "cc-add-user-dialog.h"
-#include "um-realm-manager.h"
+#include "cc-realm-manager.h"
#include "um-utils.h"
#include "pw-utils.h"
@@ -96,8 +96,8 @@ struct _CcAddUserDialog {
gint local_password_timeout_id;
guint realmd_watch;
- UmRealmManager *realm_manager;
- UmRealmObject *selected_realm;
+ CcRealmManager *realm_manager;
+ CcRealmObject *selected_realm;
gboolean enterprise_check_credentials;
gint enterprise_domain_timeout_id;
gboolean enterprise_domain_chosen;
@@ -557,20 +557,20 @@ enterprise_validate (CcAddUserDialog *self)
static void
enterprise_add_realm (CcAddUserDialog *self,
- UmRealmObject *realm)
+ CcRealmObject *realm)
{
GtkTreeModel *model;
GtkTreeIter iter;
- UmRealmCommon *common;
+ CcRealmCommon *common;
const gchar *realm_name;
gboolean match;
gboolean ret;
gchar *name;
- common = um_realm_object_get_common (realm);
+ common = cc_realm_object_get_common (realm);
g_return_if_fail (common != NULL);
- realm_name = um_realm_common_get_name (common);
+ realm_name = cc_realm_common_get_name (common);
/*
* Don't add a second realm if we already have one with this name.
@@ -600,7 +600,7 @@ enterprise_add_realm (CcAddUserDialog *self,
-1);
/* Prefill domain entry by the existing one */
- if (!self->enterprise_domain_chosen && um_realm_is_configured (realm)) {
+ if (!self->enterprise_domain_chosen && cc_realm_is_configured (realm)) {
gtk_entry_set_text (self->enterprise_domain_entry, realm_name);
}
@@ -611,8 +611,8 @@ enterprise_add_realm (CcAddUserDialog *self,
}
static void
-on_manager_realm_added (UmRealmManager *manager,
- UmRealmObject *realm,
+on_manager_realm_added (CcRealmManager *manager,
+ CcRealmObject *realm,
gpointer user_data)
{
CcAddUserDialog *self = CC_ADD_USER_DIALOG (user_data);
@@ -658,7 +658,7 @@ on_permit_user_login (GObject *source,
gpointer user_data)
{
CcAddUserDialog *self = CC_ADD_USER_DIALOG (user_data);
- UmRealmCommon *common;
+ CcRealmCommon *common;
ActUserManager *manager;
GError *error = NULL;
gchar *login;
@@ -668,8 +668,8 @@ on_permit_user_login (GObject *source,
return;
}
- common = UM_REALM_COMMON (source);
- um_realm_common_call_change_login_policy_finish (common, result, &error);
+ common = CC_REALM_COMMON (source);
+ cc_realm_common_call_change_login_policy_finish (common, result, &error);
if (error == NULL) {
/*
@@ -678,7 +678,7 @@ on_permit_user_login (GObject *source,
* sure all that is functional.
*/
manager = act_user_manager_get_default ();
- login = um_realm_calculate_login (common, gtk_entry_get_text (self->enterprise_login_entry));
+ login = cc_realm_calculate_login (common, gtk_entry_get_text (self->enterprise_login_entry));
g_return_if_fail (login != NULL);
g_debug ("Caching remote user: %s", login);
@@ -701,13 +701,13 @@ on_permit_user_login (GObject *source,
static void
enterprise_permit_user_login (CcAddUserDialog *self)
{
- UmRealmCommon *common;
+ CcRealmCommon *common;
gchar *login;
const gchar *add[2];
const gchar *remove[1];
GVariant *options;
- common = um_realm_object_get_common (self->selected_realm);
+ common = cc_realm_object_get_common (self->selected_realm);
if (common == NULL) {
g_debug ("Failed to register account: failed to get d-bus interface");
show_error_dialog (self, _("Failed to register account"), NULL);
@@ -715,7 +715,7 @@ enterprise_permit_user_login (CcAddUserDialog *self)
return;
}
- login = um_realm_calculate_login (common, gtk_entry_get_text (self->enterprise_login_entry));
+ login = cc_realm_calculate_login (common, gtk_entry_get_text (self->enterprise_login_entry));
g_return_if_fail (login != NULL);
add[0] = login;
@@ -725,7 +725,7 @@ enterprise_permit_user_login (CcAddUserDialog *self)
g_debug ("Permitting login for: %s", login);
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
- um_realm_common_call_change_login_policy (common, "",
+ cc_realm_common_call_change_login_policy (common, "",
add, remove, options,
self->cancellable,
on_permit_user_login,
@@ -751,7 +751,7 @@ on_join_response (GtkDialog *dialog,
g_debug ("Logging in as admin user: %s", gtk_entry_get_text (self->join_name));
/* Prompted for some admin credentials, try to use them to log in */
- um_realm_login (self->selected_realm,
+ cc_realm_login (self->selected_realm,
gtk_entry_get_text (self->join_name),
gtk_entry_get_text (self->join_password),
self->cancellable,
@@ -763,24 +763,24 @@ static void
join_show_prompt (CcAddUserDialog *self,
GError *error)
{
- UmRealmKerberosMembership *membership;
- UmRealmKerberos *kerberos;
+ CcRealmKerberosMembership *membership;
+ CcRealmKerberos *kerberos;
const gchar *name;
gtk_entry_set_text (self->join_password, "");
gtk_widget_grab_focus (GTK_WIDGET (self->join_password));
- kerberos = um_realm_object_get_kerberos (self->selected_realm);
- membership = um_realm_object_get_kerberos_membership (self->selected_realm);
+ kerberos = cc_realm_object_get_kerberos (self->selected_realm);
+ membership = cc_realm_object_get_kerberos_membership (self->selected_realm);
gtk_label_set_text (self->join_domain,
- um_realm_kerberos_get_domain_name (kerberos));
+ cc_realm_kerberos_get_domain_name (kerberos));
clear_entry_validation_error (self->join_name);
clear_entry_validation_error (self->join_password);
if (!self->join_prompted) {
- name = um_realm_kerberos_membership_get_suggested_administrator (membership);
+ name = cc_realm_kerberos_membership_get_suggested_administrator (membership);
if (name && !g_str_equal (name, "")) {
g_debug ("Suggesting admin user: %s", name);
gtk_entry_set_text (self->join_name, name);
@@ -788,7 +788,7 @@ join_show_prompt (CcAddUserDialog *self,
gtk_widget_grab_focus (GTK_WIDGET (self->join_name));
}
- } else if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_PASSWORD)) {
+ } else if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_PASSWORD)) {
g_debug ("Bad admin password: %s", error->message);
set_entry_validation_error (self->join_password, error->message);
@@ -824,11 +824,11 @@ on_join_login (GObject *source,
return;
}
- creds = um_realm_login_finish (result, &error);
+ creds = cc_realm_login_finish (result, &error);
/* Logged in as admin successfully, use creds to join domain */
if (error == NULL) {
- if (!um_realm_join_as_admin (self->selected_realm,
+ if (!cc_realm_join_as_admin (self->selected_realm,
gtk_entry_get_text (self->join_name),
gtk_entry_get_text (self->join_password),
creds, self->cancellable, on_realm_joined,
@@ -890,7 +890,7 @@ on_realm_joined (GObject *source,
return;
}
- um_realm_join_finish (self->selected_realm,
+ cc_realm_join_finish (self->selected_realm,
result, &error);
/* Yay, joined the domain, register the user locally */
@@ -899,8 +899,8 @@ on_realm_joined (GObject *source,
enterprise_permit_user_login (self);
/* Credential failure while joining domain, prompt for admin creds */
- } else if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_LOGIN) ||
- g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_PASSWORD)) {
+ } else if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_LOGIN) ||
+ g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_PASSWORD)) {
g_debug ("Joining realm failed due to credentials");
join_show_prompt (self, error);
@@ -930,13 +930,13 @@ on_realm_login (GObject *source,
return;
}
- creds = um_realm_login_finish (result, &error);
+ creds = cc_realm_login_finish (result, &error);
/*
* User login is valid, but cannot authenticate right now (eg: user needs
* to change password at next login etc.)
*/
- if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_CANNOT_AUTH)) {
+ if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_CANNOT_AUTH)) {
g_clear_error (&error);
creds = NULL;
}
@@ -944,13 +944,13 @@ on_realm_login (GObject *source,
if (error == NULL) {
/* Already joined to the domain, just register this user */
- if (um_realm_is_configured (self->selected_realm)) {
+ if (cc_realm_is_configured (self->selected_realm)) {
g_debug ("Already joined to this realm");
enterprise_permit_user_login (self);
/* Join the domain, try using the user's creds */
} else if (creds == NULL ||
- !um_realm_join_as_user (self->selected_realm,
+ !cc_realm_join_as_user (self->selected_realm,
gtk_entry_get_text (self->enterprise_login_entry),
gtk_entry_get_text (self->enterprise_password_entry),
creds, self->cancellable,
@@ -965,14 +965,14 @@ on_realm_login (GObject *source,
g_bytes_unref (creds);
/* A problem with the user's login name or password */
- } else if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_LOGIN)) {
+ } else if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_LOGIN)) {
g_debug ("Problem with the user's login: %s", error->message);
message = _("That login name didn’t work.\nPlease try again.");
gtk_label_set_text (self->enterprise_hint_label, message);
finish_action (self);
gtk_widget_grab_focus (GTK_WIDGET (self->enterprise_login_entry));
- } else if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_PASSWORD)) {
+ } else if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_PASSWORD)) {
g_debug ("Problem with the user's password: %s", error->message);
message = _("That login password didn’t work.\nPlease try again.");
gtk_label_set_text (self->enterprise_hint_label, message);
@@ -996,7 +996,7 @@ enterprise_check_login (CcAddUserDialog *self)
{
g_assert (self->selected_realm);
- um_realm_login (self->selected_realm,
+ cc_realm_login (self->selected_realm,
gtk_entry_get_text (self->enterprise_login_entry),
gtk_entry_get_text (self->enterprise_password_entry),
self->cancellable,
@@ -1019,7 +1019,7 @@ on_realm_discover_input (GObject *source,
return;
}
- realms = um_realm_manager_discover_finish (self->realm_manager,
+ realms = cc_realm_manager_discover_finish (self->realm_manager,
result, &error);
/* Found a realm, log user into domain */
@@ -1039,7 +1039,7 @@ on_realm_discover_input (GObject *source,
g_message ("Couldn't discover domain: %s", error->message);
g_dbus_error_strip_remote_error (error);
- if (g_error_matches (error, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC)) {
+ if (g_error_matches (error, CC_REALM_ERROR, CC_REALM_ERROR_GENERIC)) {
message = g_strdup (_("Unable to find the domain. Maybe you misspelled it?"));
} else {
message = g_strdup_printf ("%s.", error->message);
@@ -1077,7 +1077,7 @@ enterprise_check_domain (CcAddUserDialog *self)
begin_action (self);
self->join_prompted = FALSE;
- um_realm_manager_discover (self->realm_manager,
+ cc_realm_manager_discover (self->realm_manager,
domain,
self->cancellable,
on_realm_discover_input,
@@ -1117,7 +1117,7 @@ on_realm_manager_created (GObject *source,
clear_realm_manager (self);
- self->realm_manager = um_realm_manager_new_finish (result, &error);
+ self->realm_manager = cc_realm_manager_new_finish (result, &error);
if (error != NULL) {
g_warning ("Couldn't contact realmd service: %s", error->message);
g_object_unref (self);
@@ -1131,7 +1131,7 @@ on_realm_manager_created (GObject *source,
}
/* Lookup all the realm objects */
- realms = um_realm_manager_get_realms (self->realm_manager);
+ realms = cc_realm_manager_get_realms (self->realm_manager);
for (l = realms; l != NULL; l = g_list_next (l))
enterprise_add_realm (self, l->data);
g_list_free (realms);
@@ -1139,7 +1139,7 @@ on_realm_manager_created (GObject *source,
G_CALLBACK (on_manager_realm_added), self);
/* When no realms try to discover a sensible default, triggers realm-added signal */
- um_realm_manager_discover (self->realm_manager, "", self->cancellable,
+ cc_realm_manager_discover (self->realm_manager, "", self->cancellable,
NULL, NULL);
/* Show the 'Enterprise Login' stuff, and update mode */
@@ -1155,7 +1155,7 @@ on_realmd_appeared (GDBusConnection *connection,
gpointer user_data)
{
CcAddUserDialog *self = CC_ADD_USER_DIALOG (user_data);
- um_realm_manager_new (self->cancellable, on_realm_manager_created,
+ cc_realm_manager_new (self->cancellable, on_realm_manager_created,
g_object_ref (self));
}
diff --git a/panels/user-accounts/um-realm-manager.c b/panels/user-accounts/cc-realm-manager.c
similarity index 85%
rename from panels/user-accounts/um-realm-manager.c
rename to panels/user-accounts/cc-realm-manager.c
index 4c675a15e..4d6ef17fb 100644
--- a/panels/user-accounts/um-realm-manager.c
+++ b/panels/user-accounts/cc-realm-manager.c
@@ -20,7 +20,7 @@
#include "config.h"
-#include "um-realm-manager.h"
+#include "cc-realm-manager.h"
#include <krb5/krb5.h>
@@ -34,10 +34,10 @@
#include <fcntl.h>
-struct _UmRealmManager {
- UmRealmObjectManagerClient parent_instance;
+struct _CcRealmManager {
+ CcRealmObjectManagerClient parent_instance;
- UmRealmProvider *provider;
+ CcRealmProvider *provider;
guint diagnostics_sig;
};
@@ -48,14 +48,14 @@ enum {
static gint signals[NUM_SIGNALS] = { 0, };
-G_DEFINE_TYPE (UmRealmManager, um_realm_manager, UM_REALM_TYPE_OBJECT_MANAGER_CLIENT);
+G_DEFINE_TYPE (CcRealmManager, cc_realm_manager, CC_REALM_TYPE_OBJECT_MANAGER_CLIENT);
GQuark
-um_realm_error_get_quark (void)
+cc_realm_error_get_quark (void)
{
static GQuark quark = 0;
if (quark == 0)
- quark = g_quark_from_static_string ("um-realm-error");
+ quark = g_quark_from_static_string ("cc-realm-error");
return quark;
}
@@ -107,16 +107,16 @@ on_object_added (GDBusObjectManager *manager,
}
static void
-um_realm_manager_init (UmRealmManager *self)
+cc_realm_manager_init (CcRealmManager *self)
{
g_signal_connect (self, "object-added", G_CALLBACK (on_object_added), self);
g_signal_connect (self, "interface-added", G_CALLBACK (on_interface_added), self);
}
static void
-um_realm_manager_dispose (GObject *obj)
+cc_realm_manager_dispose (GObject *obj)
{
- UmRealmManager *self = UM_REALM_MANAGER (obj);
+ CcRealmManager *self = CC_REALM_MANAGER (obj);
GDBusConnection *connection;
g_clear_object (&self->provider);
@@ -128,20 +128,20 @@ um_realm_manager_dispose (GObject *obj)
self->diagnostics_sig = 0;
}
- G_OBJECT_CLASS (um_realm_manager_parent_class)->dispose (obj);
+ G_OBJECT_CLASS (cc_realm_manager_parent_class)->dispose (obj);
}
static void
-um_realm_manager_class_init (UmRealmManagerClass *klass)
+cc_realm_manager_class_init (CcRealmManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = um_realm_manager_dispose;
+ object_class->dispose = cc_realm_manager_dispose;
- signals[REALM_ADDED] = g_signal_new ("realm-added", UM_TYPE_REALM_MANAGER,
+ signals[REALM_ADDED] = g_signal_new ("realm-added", CC_TYPE_REALM_MANAGER,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL,
g_cclosure_marshal_generic,
- G_TYPE_NONE, 1, UM_REALM_TYPE_OBJECT);
+ G_TYPE_NONE, 1, CC_REALM_TYPE_OBJECT);
}
static void
@@ -169,10 +169,10 @@ on_provider_new (GObject *source,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
- UmRealmManager *manager = g_task_get_task_data (task);
+ CcRealmManager *manager = g_task_get_task_data (task);
GError *error = NULL;
- manager->provider = um_realm_provider_proxy_new_finish (result, &error);
+ manager->provider = cc_realm_provider_proxy_new_finish (result, &error);
if (error == NULL) {
g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (manager->provider), -1);
g_debug ("Created realm manager");
@@ -190,7 +190,7 @@ on_manager_new (GObject *source,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
- UmRealmManager *manager;
+ CcRealmManager *manager;
GDBusConnection *connection;
GError *error = NULL;
GObject *object;
@@ -198,7 +198,7 @@ on_manager_new (GObject *source,
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source), result, &error);
if (error == NULL) {
- manager = UM_REALM_MANAGER (object);
+ manager = CC_REALM_MANAGER (object);
connection = g_dbus_object_manager_client_get_connection (G_DBUS_OBJECT_MANAGER_CLIENT
(object));
g_debug ("Connected to realmd");
@@ -217,7 +217,7 @@ on_manager_new (GObject *source,
g_task_set_task_data (task, manager, g_object_unref);
- um_realm_provider_proxy_new (connection,
+ cc_realm_provider_proxy_new (connection,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
"org.freedesktop.realmd",
"/org/freedesktop/realmd",
@@ -230,7 +230,7 @@ on_manager_new (GObject *source,
}
void
-um_realm_manager_new (GCancellable *cancellable,
+cc_realm_manager_new (GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
@@ -239,24 +239,24 @@ um_realm_manager_new (GCancellable *cancellable,
g_debug ("Connecting to realmd...");
task = g_task_new (NULL, cancellable, callback, user_data);
- g_task_set_source_tag (task, um_realm_manager_new);
+ g_task_set_source_tag (task, cc_realm_manager_new);
- g_async_initable_new_async (UM_TYPE_REALM_MANAGER, G_PRIORITY_DEFAULT,
+ g_async_initable_new_async (CC_TYPE_REALM_MANAGER, G_PRIORITY_DEFAULT,
cancellable, on_manager_new, task,
"flags", G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
"name", "org.freedesktop.realmd",
"bus-type", G_BUS_TYPE_SYSTEM,
"object-path", "/org/freedesktop/realmd",
- "get-proxy-type-func", um_realm_object_manager_client_get_proxy_type,
+ "get-proxy-type-func", cc_realm_object_manager_client_get_proxy_type,
NULL);
}
-UmRealmManager *
-um_realm_manager_new_finish (GAsyncResult *result,
+CcRealmManager *
+cc_realm_manager_new_finish (GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, NULL), NULL);
- g_return_val_if_fail (g_async_result_is_tagged (result, um_realm_manager_new), NULL);
+ g_return_val_if_fail (g_async_result_is_tagged (result, cc_realm_manager_new), NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -273,7 +273,7 @@ on_provider_discover (GObject *source,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
- UmRealmManager *manager = g_task_get_source_object (task);
+ CcRealmManager *manager = g_task_get_source_object (task);
GDBusObject *object;
GError *error = NULL;
gboolean no_membership = FALSE;
@@ -282,7 +282,7 @@ on_provider_discover (GObject *source,
gint i;
GList *kerberos_realms = NULL;
- um_realm_provider_call_discover_finish (UM_REALM_PROVIDER (source), &relevance,
+ cc_realm_provider_call_discover_finish (CC_REALM_PROVIDER (source), &relevance,
&realms, result, &error);
if (error == NULL) {
for (i = 0; realms[i]; i++) {
@@ -303,10 +303,10 @@ on_provider_discover (GObject *source,
g_strfreev (realms);
if (!kerberos_realms && no_membership) {
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_GENERIC,
_("Cannot automatically join this type of domain"));
} else if (!kerberos_realms) {
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_GENERIC,
_("No such domain or realm found"));
} else {
kerberos_realms = g_list_reverse (kerberos_realms);
@@ -320,7 +320,7 @@ on_provider_discover (GObject *source,
}
void
-um_realm_manager_discover (UmRealmManager *self,
+cc_realm_manager_discover (CcRealmManager *self,
const gchar *input,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -329,42 +329,42 @@ um_realm_manager_discover (UmRealmManager *self,
GTask *task;
GVariant *options;
- g_return_if_fail (UM_IS_REALM_MANAGER (self));
+ g_return_if_fail (CC_IS_REALM_MANAGER (self));
g_return_if_fail (input != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
g_debug ("Discovering realms for: %s", input);
task = g_task_new (G_OBJECT (self), cancellable, callback, user_data);
- g_task_set_source_tag (task, um_realm_manager_discover);
+ g_task_set_source_tag (task, cc_realm_manager_discover);
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
- um_realm_provider_call_discover (self->provider, input, options, cancellable,
+ cc_realm_provider_call_discover (self->provider, input, options, cancellable,
on_provider_discover, task);
}
GList *
-um_realm_manager_discover_finish (UmRealmManager *self,
+cc_realm_manager_discover_finish (CcRealmManager *self,
GAsyncResult *result,
GError **error)
{
- g_return_val_if_fail (UM_IS_REALM_MANAGER (self), NULL);
+ g_return_val_if_fail (CC_IS_REALM_MANAGER (self), NULL);
g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (self)), NULL);
- g_return_val_if_fail (g_async_result_is_tagged (result, um_realm_manager_discover), NULL);
+ g_return_val_if_fail (g_async_result_is_tagged (result, cc_realm_manager_discover), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
GList *
-um_realm_manager_get_realms (UmRealmManager *self)
+cc_realm_manager_get_realms (CcRealmManager *self)
{
GList *objects;
GList *realms = NULL;
GList *l;
- g_return_val_if_fail (UM_IS_REALM_MANAGER (self), NULL);
+ g_return_val_if_fail (CC_IS_REALM_MANAGER (self), NULL);
objects = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (self));
for (l = objects; l != NULL; l = g_list_next (l)) {
@@ -393,18 +393,18 @@ string_replace (GString *string,
}
gchar *
-um_realm_calculate_login (UmRealmCommon *realm,
+cc_realm_calculate_login (CcRealmCommon *realm,
const gchar *username)
{
GString *string;
const gchar *const *formats;
gchar *login = NULL;
- formats = um_realm_common_get_login_formats (realm);
+ formats = cc_realm_common_get_login_formats (realm);
if (formats[0] != NULL) {
string = g_string_new (formats[0]);
string_replace (string, "%U", username);
- string_replace (string, "%D", um_realm_common_get_name (realm));
+ string_replace (string, "%D", cc_realm_common_get_name (realm));
login = g_string_free (string, FALSE);
}
@@ -413,15 +413,15 @@ um_realm_calculate_login (UmRealmCommon *realm,
}
gboolean
-um_realm_is_configured (UmRealmObject *realm)
+cc_realm_is_configured (CcRealmObject *realm)
{
- UmRealmCommon *common;
+ CcRealmCommon *common;
const gchar *configured;
gboolean is = FALSE;
- common = um_realm_object_get_common (realm);
+ common = cc_realm_object_get_common (realm);
if (common != NULL) {
- configured = um_realm_common_get_configured (common);
+ configured = cc_realm_common_get_configured (common);
is = configured != NULL && !g_str_equal (configured, "");
g_object_unref (common);
}
@@ -430,7 +430,7 @@ um_realm_is_configured (UmRealmObject *realm)
}
static const gchar *
-find_supported_credentials (UmRealmKerberosMembership *membership,
+find_supported_credentials (CcRealmKerberosMembership *membership,
const gchar *owner)
{
const gchar *cred_owner;
@@ -438,7 +438,7 @@ find_supported_credentials (UmRealmKerberosMembership *membership,
GVariant *supported;
GVariantIter iter;
- supported = um_realm_kerberos_membership_get_supported_join_credentials (membership);
+ supported = cc_realm_kerberos_membership_get_supported_join_credentials (membership);
g_return_val_if_fail (supported != NULL, NULL);
g_variant_iter_init (&iter, supported);
@@ -455,7 +455,7 @@ find_supported_credentials (UmRealmKerberosMembership *membership,
}
static gboolean
-realm_join_as_owner (UmRealmObject *realm,
+realm_join_as_owner (CcRealmObject *realm,
const gchar *owner,
const gchar *login,
const gchar *password,
@@ -464,14 +464,14 @@ realm_join_as_owner (UmRealmObject *realm,
GAsyncReadyCallback callback,
gpointer user_data)
{
- UmRealmKerberosMembership *membership;
+ CcRealmKerberosMembership *membership;
GVariant *contents;
GVariant *options;
GVariant *option;
GVariant *creds;
const gchar *type;
- membership = um_realm_object_get_kerberos_membership (realm);
+ membership = cc_realm_object_get_kerberos_membership (realm);
g_return_val_if_fail (membership != NULL, FALSE);
type = find_supported_credentials (membership, owner);
@@ -502,7 +502,7 @@ realm_join_as_owner (UmRealmObject *realm,
g_debug ("Calling the Join() method with %s credentials", owner);
- um_realm_kerberos_membership_call_join (membership, creds, options,
+ cc_realm_kerberos_membership_call_join (membership, creds, options,
cancellable, callback, user_data);
g_object_unref (membership);
@@ -510,7 +510,7 @@ realm_join_as_owner (UmRealmObject *realm,
}
gboolean
-um_realm_join_as_user (UmRealmObject *realm,
+cc_realm_join_as_user (CcRealmObject *realm,
const gchar *login,
const gchar *password,
GBytes *credentials,
@@ -518,7 +518,7 @@ um_realm_join_as_user (UmRealmObject *realm,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_return_val_if_fail (UM_REALM_IS_OBJECT (realm), FALSE);
+ g_return_val_if_fail (CC_REALM_IS_OBJECT (realm), FALSE);
g_return_val_if_fail (credentials != NULL, FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (login != NULL, FALSE);
@@ -530,7 +530,7 @@ um_realm_join_as_user (UmRealmObject *realm,
}
gboolean
-um_realm_join_as_admin (UmRealmObject *realm,
+cc_realm_join_as_admin (CcRealmObject *realm,
const gchar *login,
const gchar *password,
GBytes *credentials,
@@ -538,7 +538,7 @@ um_realm_join_as_admin (UmRealmObject *realm,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_return_val_if_fail (UM_REALM_IS_OBJECT (realm), FALSE);
+ g_return_val_if_fail (CC_REALM_IS_OBJECT (realm), FALSE);
g_return_val_if_fail (credentials != NULL, FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (login != NULL, FALSE);
@@ -550,21 +550,21 @@ um_realm_join_as_admin (UmRealmObject *realm,
}
gboolean
-um_realm_join_finish (UmRealmObject *realm,
+cc_realm_join_finish (CcRealmObject *realm,
GAsyncResult *result,
GError **error)
{
- UmRealmKerberosMembership *membership;
+ CcRealmKerberosMembership *membership;
GError *call_error = NULL;
gchar *dbus_error;
- g_return_val_if_fail (UM_REALM_IS_OBJECT (realm), FALSE);
+ g_return_val_if_fail (CC_REALM_IS_OBJECT (realm), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- membership = um_realm_object_get_kerberos_membership (realm);
+ membership = cc_realm_object_get_kerberos_membership (realm);
g_return_val_if_fail (membership != NULL, FALSE);
- um_realm_kerberos_membership_call_join_finish (membership, result, &call_error);
+ cc_realm_kerberos_membership_call_join_finish (membership, result, &call_error);
g_object_unref (membership);
if (call_error == NULL) {
@@ -583,7 +583,7 @@ um_realm_join_finish (UmRealmObject *realm,
if (g_str_equal (dbus_error, "org.freedesktop.realmd.Error.AuthenticationFailed")) {
g_debug ("Join() failed because of invalid/insufficient credentials");
- g_set_error (error, UM_REALM_ERROR, UM_REALM_ERROR_BAD_LOGIN,
+ g_set_error (error, CC_REALM_ERROR, CC_REALM_ERROR_BAD_LOGIN,
"%s", call_error->message);
g_error_free (call_error);
} else {
@@ -728,13 +728,13 @@ kinit_thread_func (GTask *task,
case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN:
case KRB5KDC_ERR_POLICY:
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_BAD_LOGIN,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_BAD_LOGIN,
_("Cannot log in as %s at the %s domain"),
login->user, login->domain);
break;
case KRB5KDC_ERR_PREAUTH_FAILED:
case KRB5KRB_AP_ERR_BAD_INTEGRITY:
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_BAD_PASSWORD,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_BAD_PASSWORD,
_("Invalid password, please try again"));
break;
case KRB5_PREAUTH_FAILED:
@@ -742,12 +742,12 @@ kinit_thread_func (GTask *task,
case KRB5KDC_ERR_CLIENT_REVOKED:
case KRB5KDC_ERR_ETYPE_NOSUPP:
case KRB5_PROG_ETYPE_NOSUPP:
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_CANNOT_AUTH,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_CANNOT_AUTH,
_("Cannot log in as %s at the %s domain"),
login->user, login->domain);
break;
default:
- g_task_return_new_error (task, UM_REALM_ERROR, UM_REALM_ERROR_GENERIC,
+ g_task_return_new_error (task, CC_REALM_ERROR, CC_REALM_ERROR_GENERIC,
_("Couldn’t connect to the %s domain: %s"),
login->domain, krb5_get_error_message (k5, code));
break;
@@ -766,7 +766,7 @@ kinit_thread_func (GTask *task,
}
void
-um_realm_login (UmRealmObject *realm,
+cc_realm_login (CcRealmObject *realm,
const gchar *user,
const gchar *password,
GCancellable *cancellable,
@@ -775,22 +775,22 @@ um_realm_login (UmRealmObject *realm,
{
GTask *task;
LoginClosure *login;
- UmRealmKerberos *kerberos;
+ CcRealmKerberos *kerberos;
- g_return_if_fail (UM_REALM_IS_OBJECT (realm));
+ g_return_if_fail (CC_REALM_IS_OBJECT (realm));
g_return_if_fail (user != NULL);
g_return_if_fail (password != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- kerberos = um_realm_object_get_kerberos (realm);
+ kerberos = cc_realm_object_get_kerberos (realm);
g_return_if_fail (kerberos != NULL);
task = g_task_new (NULL, cancellable, callback, user_data);
- g_task_set_source_tag (task, um_realm_login);
+ g_task_set_source_tag (task, cc_realm_login);
login = g_slice_new0 (LoginClosure);
- login->domain = g_strdup (um_realm_kerberos_get_domain_name (kerberos));
- login->realm = g_strdup (um_realm_kerberos_get_realm_name (kerberos));
+ login->domain = g_strdup (cc_realm_kerberos_get_domain_name (kerberos));
+ login->realm = g_strdup (cc_realm_kerberos_get_realm_name (kerberos));
login->user = g_strdup (user);
login->password = g_strdup (password);
g_task_set_task_data (task, login, login_closure_free);
@@ -802,11 +802,11 @@ um_realm_login (UmRealmObject *realm,
}
GBytes *
-um_realm_login_finish (GAsyncResult *result,
+cc_realm_login_finish (GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, NULL), FALSE);
- g_return_val_if_fail (g_async_result_is_tagged (result, um_realm_login), FALSE);
+ g_return_val_if_fail (g_async_result_is_tagged (result, cc_realm_login), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return g_task_propagate_pointer (G_TASK (result), error);
diff --git a/panels/user-accounts/um-realm-manager.h b/panels/user-accounts/cc-realm-manager.h
similarity index 73%
rename from panels/user-accounts/um-realm-manager.h
rename to panels/user-accounts/cc-realm-manager.h
index 8f7292909..7e68e8e37 100644
--- a/panels/user-accounts/um-realm-manager.h
+++ b/panels/user-accounts/cc-realm-manager.h
@@ -20,54 +20,54 @@
#pragma once
-#include "um-realm-generated.h"
+#include "cc-realm-generated.h"
G_BEGIN_DECLS
typedef enum {
- UM_REALM_ERROR_BAD_LOGIN,
- UM_REALM_ERROR_BAD_PASSWORD,
- UM_REALM_ERROR_CANNOT_AUTH,
- UM_REALM_ERROR_GENERIC,
-} UmRealmErrors;
+ CC_REALM_ERROR_BAD_LOGIN,
+ CC_REALM_ERROR_BAD_PASSWORD,
+ CC_REALM_ERROR_CANNOT_AUTH,
+ CC_REALM_ERROR_GENERIC,
+} CcRealmErrors;
-#define UM_REALM_ERROR (um_realm_error_get_quark ())
+#define CC_REALM_ERROR (cc_realm_error_get_quark ())
-GQuark um_realm_error_get_quark (void) G_GNUC_CONST;
+GQuark cc_realm_error_get_quark (void) G_GNUC_CONST;
-#define UM_TYPE_REALM_MANAGER (um_realm_manager_get_type ())
-G_DECLARE_FINAL_TYPE (UmRealmManager, um_realm_manager, UM, REALM_MANAGER, UmRealmObjectManagerClient)
+#define CC_TYPE_REALM_MANAGER (cc_realm_manager_get_type ())
+G_DECLARE_FINAL_TYPE (CcRealmManager, cc_realm_manager, CC, REALM_MANAGER, CcRealmObjectManagerClient)
-void um_realm_manager_new (GCancellable *cancellable,
+void cc_realm_manager_new (GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-UmRealmManager * um_realm_manager_new_finish (GAsyncResult *result,
+CcRealmManager * cc_realm_manager_new_finish (GAsyncResult *result,
GError **error);
-void um_realm_manager_discover (UmRealmManager *self,
+void cc_realm_manager_discover (CcRealmManager *self,
const gchar *input,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-GList * um_realm_manager_discover_finish (UmRealmManager *self,
+GList * cc_realm_manager_discover_finish (CcRealmManager *self,
GAsyncResult *result,
GError **error);
-GList * um_realm_manager_get_realms (UmRealmManager *self);
+GList * cc_realm_manager_get_realms (CcRealmManager *self);
-void um_realm_login (UmRealmObject *realm,
+void cc_realm_login (CcRealmObject *realm,
const gchar *login,
const gchar *password,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-GBytes * um_realm_login_finish (GAsyncResult *result,
+GBytes * cc_realm_login_finish (GAsyncResult *result,
GError **error);
-gboolean um_realm_join_as_user (UmRealmObject *realm,
+gboolean cc_realm_join_as_user (CcRealmObject *realm,
const gchar *login,
const gchar *password,
GBytes *credentials,
@@ -76,7 +76,7 @@ gboolean um_realm_join_as_user (UmRealmObject *realm,
gpointer user_data)
G_GNUC_WARN_UNUSED_RESULT;
-gboolean um_realm_join_as_admin (UmRealmObject *realm,
+gboolean cc_realm_join_as_admin (CcRealmObject *realm,
const gchar *login,
const gchar *password,
GBytes *credentials,
@@ -85,13 +85,13 @@ gboolean um_realm_join_as_admin (UmRealmObject *realm,
gpointer user_data)
G_GNUC_WARN_UNUSED_RESULT;
-gboolean um_realm_join_finish (UmRealmObject *realm,
+gboolean cc_realm_join_finish (CcRealmObject *realm,
GAsyncResult *result,
GError **error);
-gboolean um_realm_is_configured (UmRealmObject *realm);
+gboolean cc_realm_is_configured (CcRealmObject *realm);
-gchar * um_realm_calculate_login (UmRealmCommon *realm,
+gchar * cc_realm_calculate_login (CcRealmCommon *realm,
const gchar *username);
G_END_DECLS
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 776eb657a..a31ad256e 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -44,6 +44,7 @@
#include "cc-language-chooser.h"
#include "cc-login-history-dialog.h"
#include "cc-password-dialog.h"
+#include "cc-realm-manager.h"
#include "cc-user-accounts-resources.h"
#include "cc-user-image.h"
#include "um-fingerprint-dialog.h"
@@ -52,8 +53,6 @@
#include "cc-common-language.h"
#include "cc-util.h"
-#include "um-realm-manager.h"
-
#define USER_ACCOUNTS_PERMISSION "org.gnome.controlcenter.user-accounts.administration"
struct _CcUserPanel {
@@ -430,7 +429,7 @@ enterprise_user_revoked (GObject *source,
{
AsyncDeleteData *data = user_data;
CcUserPanel *self = data->self;
- UmRealmCommon *common = UM_REALM_COMMON (source);
+ CcRealmCommon *common = CC_REALM_COMMON (source);
GError *error = NULL;
if (g_cancellable_is_cancelled (data->cancellable)) {
@@ -438,7 +437,7 @@ enterprise_user_revoked (GObject *source,
return;
}
- um_realm_common_call_change_login_policy_finish (common, result, &error);
+ cc_realm_common_call_change_login_policy_finish (common, result, &error);
if (error != NULL) {
show_error_dialog (self, _("Failed to revoke remotely managed user"), error);
g_error_free (error);
@@ -447,22 +446,22 @@ enterprise_user_revoked (GObject *source,
async_delete_data_free (data);
}
-static UmRealmCommon *
-find_matching_realm (UmRealmManager *realm_manager, const gchar *login)
+static CcRealmCommon *
+find_matching_realm (CcRealmManager *realm_manager, const gchar *login)
{
- UmRealmCommon *common = NULL;
+ CcRealmCommon *common = NULL;
GList *realms, *l;
- realms = um_realm_manager_get_realms (realm_manager);
+ realms = cc_realm_manager_get_realms (realm_manager);
for (l = realms; l != NULL; l = g_list_next (l)) {
const gchar * const *permitted_logins;
gint i;
- common = um_realm_object_get_common (l->data);
+ common = cc_realm_object_get_common (l->data);
if (common == NULL)
continue;
- permitted_logins = um_realm_common_get_permitted_logins (common);
+ permitted_logins = cc_realm_common_get_permitted_logins (common);
for (i = 0; permitted_logins[i] != NULL; i++) {
if (g_strcmp0 (permitted_logins[i], login) == 0)
break;
@@ -485,8 +484,8 @@ realm_manager_found (GObject *source,
{
AsyncDeleteData *data = user_data;
CcUserPanel *self = data->self;
- UmRealmCommon *common;
- UmRealmManager *realm_manager;
+ CcRealmCommon *common;
+ CcRealmManager *realm_manager;
const gchar *add[1];
const gchar *remove[2];
GVariant *options;
@@ -497,7 +496,7 @@ realm_manager_found (GObject *source,
return;
}
- realm_manager = um_realm_manager_new_finish (result, &error);
+ realm_manager = cc_realm_manager_new_finish (result, &error);
if (error != NULL) {
show_error_dialog (self, _("Failed to revoke remotely managed user"), error);
g_error_free (error);
@@ -521,7 +520,7 @@ realm_manager_found (GObject *source,
remove[1] = NULL;
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
- um_realm_common_call_change_login_policy (common, "",
+ cc_realm_common_call_change_login_policy (common, "",
add, remove, options,
data->cancellable,
enterprise_user_revoked,
@@ -548,7 +547,7 @@ enterprise_user_uncached (GObject *source,
act_user_manager_uncache_user_finish (manager, res, &error);
if (error == NULL) {
/* Find realm manager */
- um_realm_manager_new (self->cancellable, realm_manager_found, data);
+ cc_realm_manager_new (self->cancellable, realm_manager_found, data);
}
else {
show_error_dialog (self, _("Failed to revoke remotely managed user"), error);
diff --git a/panels/user-accounts/meson.build b/panels/user-accounts/meson.build
index 353d5053a..cda198a23 100644
--- a/panels/user-accounts/meson.build
+++ b/panels/user-accounts/meson.build
@@ -95,8 +95,8 @@ i18n.merge_file(
common_sources = files(
'cc-add-user-dialog.c',
+ 'cc-realm-manager.c',
'pw-utils.c',
- 'um-realm-manager.c',
'um-utils.c'
)
@@ -136,10 +136,10 @@ common_sources += gnome.compile_resources(
realmd_namespace = 'org.freedesktop.realmd'
common_sources += gnome.gdbus_codegen(
- 'um-realm-generated',
+ 'cc-realm-generated',
'data/' + realmd_namespace + '.xml',
interface_prefix: realmd_namespace + '.',
- namespace: 'UmRealm',
+ namespace: 'CcRealm',
object_manager: true,
annotations: ['org.freedesktop.realmd.Realm', 'org.gtk.GDBus.C.Name', 'Common']
)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6e0db3108..f1ee0795e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -201,6 +201,7 @@ panels/user-accounts/cc-login-history-dialog.c
panels/user-accounts/cc-login-history-dialog.ui
panels/user-accounts/cc-password-dialog.c
panels/user-accounts/cc-password-dialog.ui
+panels/user-accounts/cc-realm-manager.c
panels/user-accounts/cc-user-panel.c
panels/user-accounts/cc-user-panel.ui
panels/user-accounts/data/account-fingerprint.ui
@@ -210,7 +211,6 @@ panels/user-accounts/org.gnome.controlcenter.user-accounts.policy.in
panels/user-accounts/pw-utils.c
panels/user-accounts/run-passwd.c
panels/user-accounts/um-fingerprint-dialog.c
-panels/user-accounts/um-realm-manager.c
panels/user-accounts/um-utils.c
panels/wacom/button-mapping.ui
panels/wacom/calibrator/calibrator.ui
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]