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
This diff is collapsed.
...@@ -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>
......
Markdown is supported
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