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
cba9b332
Commit
cba9b332
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#3611] Update account authentication name on username change
parent
cd92d21f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-client-gnome/src/config/accountconfigdialog.c
+12
-18
12 additions, 18 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
with
12 additions
and
18 deletions
sflphone-client-gnome/src/config/accountconfigdialog.c
+
12
−
18
View file @
cba9b332
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -106,6 +107,9 @@ GtkWidget * overrtp;
...
@@ -106,6 +107,9 @@ GtkWidget * overrtp;
GHashTable
*
directIpCallsProperties
=
NULL
;
GHashTable
*
directIpCallsProperties
=
NULL
;
gchar
*
current_username
;
// Credentials
// Credentials
enum
{
enum
{
COLUMN_CREDENTIAL_REALM
,
COLUMN_CREDENTIAL_REALM
,
...
@@ -193,12 +197,17 @@ static GPtrArray* getNewCredential (GHashTable * properties) {
...
@@ -193,12 +197,17 @@ static GPtrArray* getNewCredential (GHashTable * properties) {
-
1
);
-
1
);
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_REALM
),
realm
);
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_REALM
),
realm
);
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_AUTHENTICATION_USERNAME
),
username
);
// better use the current_username as it is the account username in the
// g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username);
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_AUTHENTICATION_USERNAME
),
current_username
);
// Do not change the password if nothing has been changed by the user
// Do not change the password if nothing has been changed by the user
if
(
g_strcasecmp
(
password
,
PW_HIDDEN
)
!=
0
)
if
(
g_strcasecmp
(
password
,
PW_HIDDEN
)
!=
0
)
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_PASSWORD
),
password
);
g_hash_table_insert
(
properties
,
g_strdup
(
ACCOUNT_PASSWORD
),
password
);
valid
=
gtk_tree_model_iter_next
(
GTK_TREE_MODEL
(
credentialStore
),
&
iter
);
valid
=
gtk_tree_model_iter_next
(
GTK_TREE_MODEL
(
credentialStore
),
&
iter
);
while
(
valid
)
{
while
(
valid
)
{
...
@@ -1252,9 +1261,6 @@ void show_account_window (account_t * a) {
...
@@ -1252,9 +1261,6 @@ void show_account_window (account_t * a) {
gchar
*
local_interface
;
gchar
*
local_interface
;
gchar
*
published_address
;
gchar
*
published_address
;
gchar
*
previous_username
,
*
current_username
;
gboolean
username_changed
=
FALSE
;
currentAccount
=
a
;
currentAccount
=
a
;
if
(
currentAccount
==
NULL
)
{
if
(
currentAccount
==
NULL
)
{
...
@@ -1351,15 +1357,9 @@ void show_account_window (account_t * a) {
...
@@ -1351,15 +1357,9 @@ void show_account_window (account_t * a) {
gchar
*
key
=
g_strdup
(
ACCOUNT_USERNAME
);
gchar
*
key
=
g_strdup
(
ACCOUNT_USERNAME
);
// Get username at loadtime to determine if it changed. If so, update authentication name accordingly
// if(g_hash_table_lookup_extended(currentAccount->properties, g_strdup(ACCOUNT_USERNAME), NULL, previous_username))
// If accept button is
// If accept button is
if
(
g_strcasecmp
(
currentAccount
->
accountID
,
IP2IP
)
!=
0
)
{
if
(
g_strcasecmp
(
currentAccount
->
accountID
,
IP2IP
)
!=
0
)
{
previous_username
=
(
gchar
*
)
g_hash_table_lookup
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_USERNAME
));
DEBUG
(
"------------------------------ USERNAME BEFORE %s"
,
previous_username
);
g_hash_table_replace
(
currentAccount
->
properties
,
g_hash_table_replace
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_ALIAS
),
g_strdup
(
ACCOUNT_ALIAS
),
g_strdup
((
gchar
*
)
gtk_entry_get_text
(
GTK_ENTRY
(
entryAlias
))));
g_strdup
((
gchar
*
)
gtk_entry_get_text
(
GTK_ENTRY
(
entryAlias
))));
...
@@ -1379,16 +1379,10 @@ void show_account_window (account_t * a) {
...
@@ -1379,16 +1379,10 @@ void show_account_window (account_t * a) {
g_strdup
(
ACCOUNT_MAILBOX
),
g_strdup
(
ACCOUNT_MAILBOX
),
g_strdup
((
gchar
*
)
gtk_entry_get_text
(
GTK_ENTRY
(
entryMailbox
))));
g_strdup
((
gchar
*
)
gtk_entry_get_text
(
GTK_ENTRY
(
entryMailbox
))));
// Variable used to update credentials
current_username
=
(
gchar
*
)
g_hash_table_lookup
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_USERNAME
));
current_username
=
(
gchar
*
)
g_hash_table_lookup
(
currentAccount
->
properties
,
g_strdup
(
ACCOUNT_USERNAME
));
DEBUG
(
"------------------------------ USERNAME AFTER %s"
,
current_username
);
}
if
(
strcmp
(
previous_username
,
current_username
)
!=
0
)
username_changed
=
TRUE
;
if
(
username_changed
)
DEBUG
(
"--------------------------------- CHANGED"
);
}
if
(
proto
&&
strcmp
(
proto
,
"SIP"
)
==
0
)
{
if
(
proto
&&
strcmp
(
proto
,
"SIP"
)
==
0
)
{
...
...
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