Commit 6cf5a4e8 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Add email address request when creating a sflphone.org account


Signed-off-by: default avatarCyrille Béraud <cyrille.béraud@savoirfairelinux.com>
parent 7d458ece
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <string.h> #include <string.h>
...@@ -46,10 +46,7 @@ static gint forward_page_func( gint current_page , gpointer data ); ...@@ -46,10 +46,7 @@ static gint forward_page_func( gint current_page , gpointer data );
static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section); static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section);
void prefill_sip(void) ; void prefill_sip(void) ;
void void set_account_type( GtkWidget* widget , gpointer data UNUSED ) {
set_account_type( GtkWidget* widget , gpointer data UNUSED )
{
if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget )) ){ if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget )) ){
account_type = _SIP; account_type = _SIP;
}else{ }else{
...@@ -58,9 +55,7 @@ set_account_type( GtkWidget* widget , gpointer data UNUSED ) ...@@ -58,9 +55,7 @@ set_account_type( GtkWidget* widget , gpointer data UNUSED )
} }
void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) { void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) {
use_sflphone_org = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))?1:0) ; use_sflphone_org = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))?1:0) ;
g_print("SET SFLPHONEORG : %d\n", use_sflphone_org);
} }
...@@ -69,8 +64,7 @@ void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) { ...@@ -69,8 +64,7 @@ void set_sflphone_org( GtkWidget* widget , gpointer data UNUSED ) {
* Callback when the close button of the dialog is clicked * Callback when the close button of the dialog is clicked
* Action : close the assistant widget and get back to sflphone main window * Action : close the assistant widget and get back to sflphone main window
*/ */
static void close_callback( void ) static void close_callback( void ) {
{
gtk_widget_destroy(wiz->assistant); gtk_widget_destroy(wiz->assistant);
g_free(wiz); wiz = NULL; g_free(wiz); wiz = NULL;
} }
...@@ -79,8 +73,7 @@ static void close_callback( void ) ...@@ -79,8 +73,7 @@ static void close_callback( void )
* Callback when the cancel button of the dialog is clicked * Callback when the cancel button of the dialog is clicked
* Action : close the assistant widget and get back to sflphone main window * Action : close the assistant widget and get back to sflphone main window
*/ */
static void cancel_callback( void ) static void cancel_callback( void ) {
{
gtk_widget_destroy(wiz->assistant); gtk_widget_destroy(wiz->assistant);
g_free(wiz); wiz = NULL; g_free(wiz); wiz = NULL;
} }
...@@ -89,16 +82,12 @@ static void cancel_callback( void ) ...@@ -89,16 +82,12 @@ static void cancel_callback( void )
* Callback when the button apply is clicked * Callback when the button apply is clicked
* Action : Set the account parameters with the entries values and called dbus_add_account * Action : Set the account parameters with the entries values and called dbus_add_account
*/ */
static void static void sip_apply_callback( void ) {
sip_apply_callback( void )
{
if(use_sflphone_org){ if(use_sflphone_org){
prefill_sip(); prefill_sip();
account_type = _SIP; account_type = _SIP;
} }
if( account_type == _SIP ) if( account_type == _SIP ) {
{
g_print("SIP APPLY CALLBACK\n");
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_alias)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_alias))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("TRUE")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("TRUE"));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup("888")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup("888"));
...@@ -106,12 +95,11 @@ sip_apply_callback( void ) ...@@ -106,12 +95,11 @@ sip_apply_callback( void )
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_server)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_server))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_password)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_password))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_username)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->sip_username))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), g_strdup((gchar *)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))? "TRUE":"FALSE")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), g_strdup((gchar *)(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))? "TRUE":"FALSE")));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->addr)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->addr))));
dbus_add_account( current ); dbus_add_account( current );
account_list_set_current_id( current->accountID ); account_list_set_current_id( current->accountID );
g_print( "ACCOUNT ID = %s\n" , current->accountID );
} }
} }
...@@ -119,12 +107,8 @@ sip_apply_callback( void ) ...@@ -119,12 +107,8 @@ sip_apply_callback( void )
* Callback when the button apply is clicked * Callback when the button apply is clicked
* Action : Set the account parameters with the entries values and called dbus_add_account * Action : Set the account parameters with the entries values and called dbus_add_account
*/ */
static void static void iax_apply_callback( void ) {
iax_apply_callback( void ) if( account_type == _IAX) {
{
if( account_type == _IAX)
{
g_print("IAX APPLY CALLBACK\n");
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_alias)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_alias))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("TRUE")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_ENABLED), g_strdup("TRUE"));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup("888")); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_MAILBOX), g_strdup("888"));
...@@ -132,29 +116,25 @@ iax_apply_callback( void ) ...@@ -132,29 +116,25 @@ iax_apply_callback( void )
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_username)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_username))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_server)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_server))));
g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_password)))); g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_password))));
dbus_add_account( current ); dbus_add_account( current );
account_list_set_current_id( current->accountID ); account_list_set_current_id( current->accountID );
g_print( "ACCOUNT ID = %s\n" , current->accountID );
} }
} }
void void enable_stun( GtkWidget* widget ) {
enable_stun( GtkWidget* widget )
{
gtk_widget_set_sensitive( GTK_WIDGET( wiz->addr ), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); gtk_widget_set_sensitive( GTK_WIDGET( wiz->addr ), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
} }
void void build_wizard( void ) {
build_wizard( void ) if (wiz)
{ return ;
if(!wiz){
wiz = ( struct _wizard* )g_malloc( sizeof( struct _wizard)); wiz = ( struct _wizard* )g_malloc( sizeof( struct _wizard));
current = g_new0(account_t, 1); current = g_new0(account_t, 1);
current->properties = g_hash_table_new(NULL, g_str_equal); current->properties = g_hash_table_new(NULL, g_str_equal);
//current ->accountID = "test";
wiz->assistant = gtk_assistant_new( ); wiz->assistant = gtk_assistant_new( );
gtk_window_set_title( GTK_WINDOW(wiz->assistant), _("SFLphone account configuration wizard") ); gtk_window_set_title( GTK_WINDOW(wiz->assistant), _("SFLphone account configuration wizard") );
gtk_window_set_position(GTK_WINDOW(wiz->assistant), GTK_WIN_POS_CENTER); gtk_window_set_position(GTK_WINDOW(wiz->assistant), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200 , 200); gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200 , 200);
...@@ -165,22 +145,20 @@ if(!wiz){ ...@@ -165,22 +145,20 @@ if(!wiz){
build_sip_account_configuration(); build_sip_account_configuration();
build_nat_settings(); build_nat_settings();
build_iax_account_configuration(); build_iax_account_configuration();
build_email_configuration();
build_summary(); build_summary();
// build_registration_error();
g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL); g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL);
g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL); g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL);
gtk_widget_show_all(wiz->assistant); gtk_widget_show_all(wiz->assistant);
gtk_assistant_set_forward_page_func( GTK_ASSISTANT( wiz->assistant ), (GtkAssistantPageFunc) forward_page_func , NULL , NULL ); gtk_assistant_set_forward_page_func( GTK_ASSISTANT( wiz->assistant ), (GtkAssistantPageFunc) forward_page_func , NULL , NULL );
gtk_assistant_update_buttons_state(GTK_ASSISTANT(wiz->assistant)); gtk_assistant_update_buttons_state(GTK_ASSISTANT(wiz->assistant));
}
} }
GtkWidget* GtkWidget* build_intro() {
build_intro()
{
GtkWidget *label; GtkWidget *label;
wiz->intro = create_vbox( GTK_ASSISTANT_PAGE_INTRO , _("SFLphone 0.9.3") , _("Welcome to SFLphone!")); wiz->intro = create_vbox( GTK_ASSISTANT_PAGE_INTRO , _("SFLphone 0.9.3") , _("Welcome to SFLphone!"));
...@@ -194,9 +172,7 @@ build_intro() ...@@ -194,9 +172,7 @@ build_intro()
return wiz->intro; return wiz->intro;
} }
GtkWidget* GtkWidget* build_select_account() {
build_select_account()
{
GtkWidget* sip; GtkWidget* sip;
GtkWidget* iax; GtkWidget* iax;
...@@ -214,8 +190,7 @@ build_select_account() ...@@ -214,8 +190,7 @@ build_select_account()
} }
GtkWidget* build_sfl_or_account() GtkWidget* build_sfl_or_account() {
{
GtkWidget* sfl; GtkWidget* sfl;
GtkWidget* cus; GtkWidget* cus;
...@@ -231,9 +206,7 @@ GtkWidget* build_sfl_or_account() ...@@ -231,9 +206,7 @@ GtkWidget* build_sfl_or_account()
} }
GtkWidget* GtkWidget* build_sip_account_configuration( void ) {
build_sip_account_configuration( void )
{
GtkWidget* table; GtkWidget* table;
GtkWidget* label; GtkWidget* label;
GtkWidget* image; GtkWidget* image;
...@@ -286,9 +259,29 @@ build_sip_account_configuration( void ) ...@@ -286,9 +259,29 @@ build_sip_account_configuration( void )
return wiz->sip_account; return wiz->sip_account;
} }
GtkWidget* GtkWidget* build_email_configuration( void ) {
build_iax_account_configuration( void ) GtkWidget* label;
{ GtkWidget* table;
wiz->email = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("Optional Email Address ") , _("This email address will be use to send your voicemail messages"));
table = gtk_table_new ( 4, 2 , FALSE/* homogeneous */);
gtk_table_set_row_spacings( GTK_TABLE(table), 10);
gtk_table_set_col_spacings( GTK_TABLE(table), 10);
gtk_box_pack_start( GTK_BOX(wiz->email) , table , TRUE, TRUE, 0);
// email field
label = gtk_label_new_with_mnemonic (_("_Email"));
gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5);
wiz->mailbox = gtk_entry_new();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->mailbox);
gtk_table_attach ( GTK_TABLE( table ), wiz->mailbox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
return wiz->email;
}
GtkWidget* build_iax_account_configuration( void ) {
GtkWidget* label; GtkWidget* label;
GtkWidget* table; GtkWidget* table;
GtkWidget* image; GtkWidget* image;
...@@ -344,9 +337,7 @@ build_iax_account_configuration( void ) ...@@ -344,9 +337,7 @@ build_iax_account_configuration( void )
return wiz->iax_account; return wiz->iax_account;
} }
GtkWidget* GtkWidget* build_nat_settings( void ) {
build_nat_settings( void )
{
GtkWidget* label; GtkWidget* label;
GtkWidget* table; GtkWidget* table;
...@@ -379,9 +370,7 @@ build_nat_settings( void ) ...@@ -379,9 +370,7 @@ build_nat_settings( void )
return wiz->nat; return wiz->nat;
} }
GtkWidget* GtkWidget* build_summary() {
build_summary()
{
GtkWidget *label; GtkWidget *label;
wiz->summary = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , _("Account Registration") , _("Congratulations!")); wiz->summary = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , _("Account Registration") , _("Congratulations!"));
...@@ -394,9 +383,7 @@ build_summary() ...@@ -394,9 +383,7 @@ build_summary()
return wiz->summary; return wiz->summary;
} }
GtkWidget* GtkWidget* build_registration_error() {
build_registration_error()
{
GtkWidget *label; GtkWidget *label;
wiz->reg_failed = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error"); wiz->reg_failed = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error");
...@@ -407,7 +394,6 @@ build_registration_error() ...@@ -407,7 +394,6 @@ build_registration_error()
gtk_box_pack_start(GTK_BOX(wiz->reg_failed), label, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(wiz->reg_failed), label, FALSE, TRUE, 0);
return wiz->reg_failed; return wiz->reg_failed;
} }
void set_sip_infos_sentivite(gboolean b) { void set_sip_infos_sentivite(gboolean b) {
...@@ -419,8 +405,10 @@ void set_sip_infos_sentivite(gboolean b) { ...@@ -419,8 +405,10 @@ void set_sip_infos_sentivite(gboolean b) {
void prefill_sip(void) { void prefill_sip(void) {
if (use_sflphone_org == 1) { if (use_sflphone_org == 1) {
char alias[400]; char alias[300];
rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER); char *email;
email = (char *)gtk_entry_get_text (GTK_ENTRY(wiz->mailbox) );
rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER,email);
if (ra.success) { if (ra.success) {
set_sip_infos_sentivite(FALSE); set_sip_infos_sentivite(FALSE);
strcpy(alias,ra.user); strcpy(alias,ra.user);
...@@ -434,20 +422,19 @@ void prefill_sip(void) { ...@@ -434,20 +422,19 @@ void prefill_sip(void) {
} }
} }
typedef enum typedef enum {
{
PAGE_INTRO, PAGE_INTRO,
PAGE_SFL, PAGE_SFL,
PAGE_TYPE, PAGE_TYPE,
PAGE_SIP, PAGE_SIP,
PAGE_STUN, PAGE_STUN,
PAGE_IAX, PAGE_IAX,
PAGE_EMAIL,
PAGE_SUMMARY PAGE_SUMMARY
} assistant_state; } assistant_state;
static gint forward_page_func( gint current_page , gpointer data) { static gint forward_page_func( gint current_page , gpointer data) {
gint next_page = 0; gint next_page = 0;
g_print("CURRENT PAGE %d\n", current_page);
switch( current_page ){ switch( current_page ){
case PAGE_INTRO: case PAGE_INTRO:
...@@ -455,7 +442,7 @@ static gint forward_page_func( gint current_page , gpointer data) { ...@@ -455,7 +442,7 @@ static gint forward_page_func( gint current_page , gpointer data) {
break; break;
case PAGE_SFL: case PAGE_SFL:
if (use_sflphone_org) { if (use_sflphone_org) {
next_page = PAGE_STUN; next_page = PAGE_EMAIL;
} else } else
next_page = PAGE_TYPE; next_page = PAGE_TYPE;
break; break;
...@@ -467,9 +454,9 @@ static gint forward_page_func( gint current_page , gpointer data) { ...@@ -467,9 +454,9 @@ static gint forward_page_func( gint current_page , gpointer data) {
next_page = PAGE_IAX; next_page = PAGE_IAX;
break; break;
case PAGE_SIP: case PAGE_SIP:
if (use_sflphone_org ) { next_page = PAGE_STUN;
} break;
case PAGE_EMAIL:
next_page = PAGE_STUN; next_page = PAGE_STUN;
break; break;
case PAGE_STUN: case PAGE_STUN:
...@@ -479,20 +466,16 @@ static gint forward_page_func( gint current_page , gpointer data) { ...@@ -479,20 +466,16 @@ static gint forward_page_func( gint current_page , gpointer data) {
next_page = PAGE_SUMMARY; next_page = PAGE_SUMMARY;
break; break;
case PAGE_SUMMARY: case PAGE_SUMMARY:
g_print("XXXXXXXXXXXXXXXXXXXXXX\n");
next_page = PAGE_SUMMARY; next_page = PAGE_SUMMARY;
break; break;
default: default:
next_page = -1; next_page = -1;
} }
g_print("NEXT PAGE : %d\n",next_page);
return next_page; return next_page;
} }
static GtkWidget* static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section) {
create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section)
{
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *label; GtkWidget *label;
gchar *str; gchar *str;
......
...@@ -41,6 +41,7 @@ struct _wizard ...@@ -41,6 +41,7 @@ struct _wizard
GtkWidget *account_type; GtkWidget *account_type;
GtkWidget *protocols; GtkWidget *protocols;
GtkWidget *sip; GtkWidget *sip;
GtkWidget *email;
GtkWidget *iax; GtkWidget *iax;
/** Page 2 - SIP account creation */ /** Page 2 - SIP account creation */
GtkWidget *sip_account; GtkWidget *sip_account;
...@@ -100,6 +101,7 @@ GtkWidget* build_nat_settings( void ); ...@@ -100,6 +101,7 @@ GtkWidget* build_nat_settings( void );
GtkWidget* build_iax_account_configuration( void ); GtkWidget* build_iax_account_configuration( void );
GtkWidget* build_summary( void ); GtkWidget* build_summary( void );
GtkWidget* build_registration_error( void ); GtkWidget* build_registration_error( void );
GtkWidget* build_email_configuration( void );
GtkWidget* build_sfl_or_account (void); GtkWidget* build_sfl_or_account (void);
/** /**
......
...@@ -99,12 +99,14 @@ int req(char *host, int port, char *req, char *ret) { ...@@ -99,12 +99,14 @@ int req(char *host, int port, char *req, char *ret) {
return 0; return 0;
} }
rest_account get_rest_account(char *host) { rest_account get_rest_account(char *host,char *email) {
char ret[4096]; char ret[4096];
rest_account ra; rest_account ra;
bzero(ret, sizeof(ret)); bzero(ret, sizeof(ret));
printf("HOST: %s\n", host); printf("HOST: %s\n", host);
if (req(host, 80, "GET /rest/accountcreator", ret) != -1) { strcpy(ret,"GET /rest/accountcreator?email=");
strcat(ret, email);
if (req(host, 80, ret, ret) != -1) {
strcpy(ra.user, strtok(ret, "\n")); strcpy(ra.user, strtok(ret, "\n"));
strcpy(ra.passwd, strtok(NULL, "\n"));\ strcpy(ra.passwd, strtok(NULL, "\n"));\
ra.success = 1; ra.success = 1;
...@@ -120,7 +122,7 @@ rest_account get_rest_account(char *host) { ...@@ -120,7 +122,7 @@ rest_account get_rest_account(char *host) {
#ifdef BUILD_EXAMPLE #ifdef BUILD_EXAMPLE
int main (void) { int main (void) {
rest_account acc = get_rest_account("sip.sflphone.org"); rest_account acc = get_rest_account("sip.sflphone.org","email@email.com");
if (acc.success) { if (acc.success) {
puts(acc.user); puts(acc.user);
puts(acc.passwd); puts(acc.passwd);
......
/* /*
* Copyright (C) 2009 Jean Schurger <jean@schurger.org> * Copyright (C) 2009 Savoir-faire Linux inc.
* and Savoir-Faire Linux inc. * Author Jean Schurger <jean.schurger@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
...@@ -24,4 +24,4 @@ typedef struct { ...@@ -24,4 +24,4 @@ typedef struct {
char passwd[200]; char passwd[200];
} rest_account; } rest_account;
rest_account get_rest_account(char *host); rest_account get_rest_account(char *host, char *email);
...@@ -11,7 +11,7 @@ include('include/header.php'); ...@@ -11,7 +11,7 @@ include('include/header.php');
<tbody> <tbody>
<tr> <tr>
<td > <td >
<h5>SAVOIR-FAIRE LINUX - À MONTRÉAL</h5> <h5>SAVOIR-FAIRE LINUX - IN MONTREAL</h5>
<p>7275 Saint Urbain Bureau 306</p> <p>7275 Saint Urbain Bureau 306</p>
<p>Montréal (Québec) H2R 2Y5</p> <p>Montréal (Québec) H2R 2Y5</p>
<p>Tél. (514) 276-5468</p> <p>Tél. (514) 276-5468</p>
...@@ -22,7 +22,7 @@ include('include/header.php'); ...@@ -22,7 +22,7 @@ include('include/header.php');
</td > </td >
<td > <td >
<h5>À QUÉBEC :</h5> <h5>IN QUEBEC :</h5>
<p>275, rue du Parvis </p> <p>275, rue du Parvis </p>
<p>Bureau 310 </p> <p>Bureau 310 </p>
<p>Québec (Québec) G1K 6G7 </p> <p>Québec (Québec) G1K 6G7 </p>
...@@ -34,7 +34,7 @@ include('include/header.php'); ...@@ -34,7 +34,7 @@ include('include/header.php');
</tr> </tr>
<tr> <tr>
<td > <td >
<h5>À OTTAWA / Gatineau :</h5> <h5>IN OTTAWA / Gatineau :</h5>
<p>151, rue Slater</p> <p>151, rue Slater</p>
<p>Bureau 504</p> <p>Bureau 504</p>
<p>Ottawa, ON, K1P 5H3</p> <p>Ottawa, ON, K1P 5H3</p>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment