summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-07-30 13:31:39 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-07-30 13:31:39 +0000
commit2f28f2508d942c9ee82c9afcdca43bbdc82d1e58 (patch)
tree1c39e305e987720fbd9e731938384661e9a7b298 /lasso
parent98803fde55a244f37b331b82ea480667f30ab0db (diff)
downloadlasso-2f28f2508d942c9ee82c9afcdca43bbdc82d1e58.tar.gz
lasso-2f28f2508d942c9ee82c9afcdca43bbdc82d1e58.tar.xz
lasso-2f28f2508d942c9ee82c9afcdca43bbdc82d1e58.zip
Added new attribute is_durty in LassoIdentity & LassoSession classes
Diffstat (limited to 'lasso')
-rw-r--r--lasso/id-ff/identity.c17
-rw-r--r--lasso/id-ff/identity.h2
-rw-r--r--lasso/id-ff/session.c15
-rw-r--r--lasso/id-ff/session.h2
4 files changed, 26 insertions, 10 deletions
diff --git a/lasso/id-ff/identity.c b/lasso/id-ff/identity.c
index 07e4609c..0e0db036 100644
--- a/lasso/id-ff/identity.c
+++ b/lasso/id-ff/identity.c
@@ -86,11 +86,12 @@ lasso_identity_add_federation(LassoIdentity *identity,
/* add the remote provider id if not already saved */
found = FALSE;
- for(i = 0; i<identity->providerIDs->len; i++){
- if(xmlStrEqual(remote_providerID, g_ptr_array_index(identity->providerIDs, i)))
+ for(i = 0; i<identity->providerIDs->len; i++) {
+ if(xmlStrEqual(remote_providerID, g_ptr_array_index(identity->providerIDs, i))) {
found = TRUE;
+ }
}
- if(found == FALSE){
+ if (found == FALSE) {
g_ptr_array_add(identity->providerIDs, g_strdup(remote_providerID));
}
@@ -103,6 +104,8 @@ lasso_identity_add_federation(LassoIdentity *identity,
}
g_hash_table_insert(identity->federations, g_strdup(remote_providerID), federation);
+ identity->is_durty = TRUE;
+
return(0);
}
@@ -128,6 +131,7 @@ lasso_identity_copy(LassoIdentity *identity)
(GDestroyNotify)lasso_node_destroy);
g_hash_table_foreach(copy->federations, (GHFunc)lasso_identity_copy_federation,
(gpointer)copy->federations);
+ copy->is_durty = FALSE;
return(copy);
}
@@ -175,8 +179,8 @@ LassoFederation*
lasso_identity_get_federation(LassoIdentity *identity,
gchar *remote_providerID)
{
- g_return_val_if_fail(identity!=NULL, NULL);
- g_return_val_if_fail(remote_providerID!=NULL, NULL);
+ g_return_val_if_fail(identity != NULL, NULL);
+ g_return_val_if_fail(remote_providerID != NULL, NULL);
LassoFederation *federation;
@@ -234,6 +238,8 @@ lasso_identity_remove_federation(LassoIdentity *identity,
}
}
+ identity->is_durty = TRUE;
+
return(0);
}
@@ -292,6 +298,7 @@ lasso_identity_instance_init(LassoIdentity *identity)
identity->federations = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify)g_free,
(GDestroyNotify)lasso_federation_destroy);
+ identity->is_durty = TRUE;
}
static void
diff --git a/lasso/id-ff/identity.h b/lasso/id-ff/identity.h
index 2f85cca5..b7ac96de 100644
--- a/lasso/id-ff/identity.h
+++ b/lasso/id-ff/identity.h
@@ -51,6 +51,8 @@ struct _LassoIdentity {
GPtrArray *providerIDs; /* list of the remote provider ids for federations hash table */
GHashTable *federations; /* hash for federations with remote ProviderID as key */
+ gboolean is_durty;
+
/*< private >*/
LassoIdentityPrivate *private;
};
diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c
index 6e4db4de..31b87dd8 100644
--- a/lasso/id-ff/session.c
+++ b/lasso/id-ff/session.c
@@ -111,6 +111,8 @@ lasso_session_add_assertion(LassoSession *session,
g_hash_table_insert(session->assertions, g_strdup(remote_providerID),
lasso_node_copy(assertion));
+ session->is_durty = TRUE;
+
return(0);
}
@@ -136,6 +138,7 @@ lasso_session_copy(LassoSession *session)
(GDestroyNotify)lasso_node_destroy);
g_hash_table_foreach(copy->assertions, (GHFunc)lasso_session_copy_assertion,
(gpointer)copy->assertions);
+ copy->is_durty = FALSE;
return(copy);
}
@@ -252,9 +255,8 @@ lasso_session_remove_assertion(LassoSession *session,
LassoNode *assertion;
int i;
- g_return_val_if_fail(session!=NULL, -1);
-
- g_return_val_if_fail(remote_providerID!=NULL, -2);
+ g_return_val_if_fail(session != NULL, -1);
+ g_return_val_if_fail(remote_providerID != NULL, -2);
/* remove the assertion */
assertion = lasso_session_get_assertion(session, remote_providerID);
@@ -264,13 +266,15 @@ lasso_session_remove_assertion(LassoSession *session,
}
/* remove the remote provider id */
- for(i = 0; i<session->providerIDs->len; i++){
- if(xmlStrEqual(remote_providerID, g_ptr_array_index(session->providerIDs, i))){
+ for(i = 0; i<session->providerIDs->len; i++) {
+ if(xmlStrEqual(remote_providerID, g_ptr_array_index(session->providerIDs, i))) {
g_ptr_array_remove_index(session->providerIDs, i);
break;
}
}
+ session->is_durty = TRUE;
+
return(0);
}
@@ -329,6 +333,7 @@ lasso_session_instance_init(LassoSession *session)
session->assertions = g_hash_table_new_full(g_str_hash, g_str_equal,
(GDestroyNotify)g_free,
(GDestroyNotify)lasso_node_destroy);
+ session->is_durty = TRUE;
}
static void
diff --git a/lasso/id-ff/session.h b/lasso/id-ff/session.h
index c89ed19f..8e7a09f8 100644
--- a/lasso/id-ff/session.h
+++ b/lasso/id-ff/session.h
@@ -51,6 +51,8 @@ struct _LassoSession {
GPtrArray *providerIDs; /* list of the remote provider IDs for assertions hash table */
GHashTable *assertions; /* hash for assertions with remote providerID as key */
+ gboolean is_durty;
+
/*< private >*/
LassoSessionPrivate *private;
};