Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
9901cb00
Commit
9901cb00
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4852] Add authentication mechanism for EDS
parent
982416bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-client-gnome/configure.ac
+3
-1
3 additions, 1 deletion
sflphone-client-gnome/configure.ac
sflphone-client-gnome/src/contacts/addressbook/eds.c
+73
-1
73 additions, 1 deletion
sflphone-client-gnome/src/contacts/addressbook/eds.c
with
76 additions
and
2 deletions
sflphone-client-gnome/configure.ac
+
3
−
1
View file @
9901cb00
...
...
@@ -58,7 +58,9 @@ PKG_CHECK_MODULES(DEPS, \
gtk+-2.0 >= 2.2 \
glib-2.0 >= 2.2 \
webkit-1.0 \
libebook-1.2 >= 1.4 \
libebook-1.2 >= 1.4 \
libedataserver-1.2 \
libedataserverui-1.2 \
libgnomeui-2.0 \
gnome-doc-utils
)
...
...
This diff is collapsed.
Click to expand it.
sflphone-client-gnome/src/contacts/addressbook/eds.c
+
73
−
1
View file @
9901cb00
...
...
@@ -42,6 +42,7 @@
#include
<pango/pango.h>
#include
"eds.h"
#include
<addressbook-config.h>
#include
<libedataserverui/e-passwords.h>
/**
* Structure used to store search callback and data
...
...
@@ -54,6 +55,9 @@ typedef struct _Search_Handler_And_Data {
EBookQuery
*
equery
;
}
Search_Handler_And_Data
;
static
void
authenticate_source
(
EBook
*
);
/**
* The global addressbook list
*/
...
...
@@ -266,7 +270,7 @@ view_finish_callback (EBookView *book_view, Search_Handler_And_Data *had)
g_free
(
had
);
DEBUG
(
"Addressbook: View finish"
);
DEBUG
(
"Addressbook: View finish
, all book have been processed
"
);
if
(
book_view
!=
NULL
)
g_object_unref
(
book_view
);
...
...
@@ -351,10 +355,21 @@ eds_async_open_callback (EBook *book, EBookStatus status, gpointer closure)
{
DEBUG
(
"Addressbook: Open book callback"
);
ESource
*
source
;
const
gchar
*
uri
;
Search_Handler_And_Data
*
had
=
(
Search_Handler_And_Data
*
)
closure
;
if
(
status
==
E_BOOK_ERROR_OK
)
{
if
(
!
(
source
=
e_book_get_source
(
book
)))
DEBUG
(
"Addressbook: Error while getting source"
);
if
(
!
(
uri
=
e_book_get_uri
(
book
)))
DEBUG
(
"Addressbook: Error while getting URI"
);
authenticate_source
(
book
);
if
(
!
e_book_is_opened
(
book
))
{
// We must open the addressbook
e_book_open
(
book
,
FALSE
,
NULL
);
...
...
@@ -472,6 +487,60 @@ init ()
}
}
/**
* Authenticate this addressbook
*/
static
void
authenticate_source
(
EBook
*
book
)
{
const
gchar
*
auth_domain
;
const
gchar
*
password
=
NULL
;
const
gchar
*
component_name
;
const
gchar
*
user
;
const
gchar
*
auth
;
GError
*
err
=
NULL
;
const
gchar
*
uri
;
ESource
*
source
;
gboolean
ret
;
if
(
!
(
source
=
e_book_get_source
(
book
)))
DEBUG
(
"Addressbook: Error while getting source"
);
if
(
!
(
uri
=
e_book_get_uri
(
book
)))
DEBUG
(
"Addressbook: Error while getting URI"
);
auth_domain
=
e_source_get_property
(
source
,
"auth-domain"
);
auth
=
e_source_get_property
(
source
,
"auth"
);
if
(
auth
&&
!
strcmp
(
"ldap/simple-binddn"
,
auth
))
{
user
=
e_source_get_property
(
source
,
"binddn"
);
}
else
if
(
auth
&&
!
strcmp
(
"plain/password"
,
auth
))
{
user
=
e_source_get_property
(
source
,
"user"
);
if
(
!
user
)
{
user
=
e_source_get_property
(
source
,
"username"
);
}
}
else
{
user
=
e_source_get_property
(
source
,
"email_addr"
);
}
if
(
!
user
)
user
=
""
;
if
(
auth
)
{
component_name
=
auth_domain
?
auth_domain
:
"Addressbook"
;
password
=
e_passwords_get_password
(
component_name
,
uri
);
ret
=
e_book_authenticate_user
(
book
,
user
,
password
,
auth
,
&
err
);
if
(
ret
)
DEBUG
(
"Addressbook: authentication successfull"
);
else
DEBUG
(
"Addressbook: authentication error"
);
}
}
/**
* Fill book data
...
...
@@ -543,6 +612,9 @@ fill_books_data ()
else
book_data
->
uri
=
g_strjoin
(
"/"
,
absuri
,
e_source_peek_relative_uri
(
source
),
NULL
);
// authenticate_source (book_data, source);
books_data
=
g_slist_prepend
(
books_data
,
book_data
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment