mercredi 30 décembre 2009

Google Analytics ne convient pas ? choisissez-en un autre !

Certains clients ont besoin d'analyser leurs portails web, le traffic, les pages visitées ; et parfois le besoin se pose sur un intranet / extranet professionnel, et donc à accès restreint ou confidentiel.
Alors attention à ce que vous faites, Google Analytics, qui est souvent la première idée qui vient à l'esprit (c'est même souvent le client qui le demande) n'est peut-être pas fait pour cela : la licence Google Analytics (ah, les licences Google...) implique :
  • l'ouverture de toutes les portes de vos contenus pour analyse par Google (ce qui devient délicat pour les données confidentielles du client),
  • d'autoriser Google à collecter, traiter et stocker ces contenus (même si ces données ne seront pas redistribuées à des tiers, Google peut en faire un usage interne).
Voir les paragraphes 4.2, 8.1, 8.2 et 8.3 de la licence
http://www.google.com/intl/fr_ALL/analytics/tos_content.html

Lorsque l'intranet / extranet comporte des données confidentielles (ce qui est le plus souvent le cas), annoncer de telles implications au client fait toujours changer d'avis ce dernier.

Pour autant, il existe des alternatives sérieuses à Analytics :
  • Piwik, logiciel libre et gratuit à l'usage. Il s'installe en local, a l'avantage d'être composé en plugins ; facilement personnalisable.
  • FireStats, gratuit pour usage non commercial, payant sinon. Il s'installe aussi en local. Semble à un stable plus avancé dans son développement que Piwik.
  • Woopra, payant selon les paquetages choisi, a une interface de stats très riche, mais fonctionne en outil à distance (comme Analytics).
Tous vos retours sur ce post sont les bienvenus.

vendredi 24 octobre 2008

Alternate way to Kerberos NTLM auth in pure PHP [EN]

Regarding to a recent post I put here about Kerberos and Apache, there is a way to replace Kerberos when the Active Directory cannot be properly configured to accept Kerberos connections. You can simulate the NTLM auth process with the browser by 6 steps in PHP :

function get_login() {

   /*
   step:  | type:
   -------|----------------|------------------------------------
   1      | C --> S        | GET ...
   -------|----------------|------------------------------------
   2      | C <-- S        | 401 Unauthorized
          |                | WWW-Authenticate: NTLM
   -------|----------------|------------------------------------
   3      | C --> S        | GET ...
          |                | Authorization: NTLM
          |                | <base64-encoded type-1-message>
   -------|----------------|------------------------------------
   4      | C <-- S        | 401 Unauthorized
          |                | WWW-Authenticate: NTLM
          |                | <base64-encoded type-2-message>
   -------|----------------|------------------------------------
   5      | C --> S        | GET ...
          |                | Authorization: NTLM <base64-encoded type-3-message>
   -------|----------------|------------------------------------
   6      | C <-- S        | 200 Ok
   -------|----------------|------------------------------------
   */

   $headers = apache_request_headers();
   if($headers['Authorization'] == NULL) { // step 1
       header( "HTTP/1.1 401 Unauthorized" ); // step 2
       header( "WWW-Authenticate: NTLM" );
       exit;
   };
   if(isset($headers['Authorization'])
         && substr($headers['Authorization'],0,5) == 'NTLM ') {
            // step 3 to 6
       $chaine=$headers['Authorization'];
       $chaine=substr($chaine, 5); // type1 message
       $chained64=base64_decode($chaine);
       if(ord($chained64{8}) == 1) { // step 3
           // check NTLM flag "0xb2",
          // offset 13 in type-1-message :
           if (ord($chained64[13]) != 178) {
                echo "Please use NTLM compatible browser";
                   return null;
           }
           $retAuth = "NTLMSSP";
           $retAuth .= chr(0).chr(2).chr(0).chr(0);
          $retAuth .= chr(0).chr(0).chr(0).chr(0);
           $retAuth .= chr(0).chr(40).chr(0).chr(0);
          $retAuth .= chr(0).chr(1).chr(130).chr(0);
           $retAuth .= chr(0).chr(0).chr(2).chr(2);
          $retAuth .= chr(2).chr(0).chr(0).chr(0);
           $retAuth .= chr(0).chr(0).chr(0).chr(0);
          $retAuth .= chr(0).chr(0).chr(0).chr(0).chr(0);

           $retAuth64 =base64_encode($retAuth);
           $retAuth64 = trim($retAuth64);
           header( "HTTP/1.1 401 Unauthorized" ); // step 4
           header( "WWW-Authenticate: NTLM $retAuth64" );
           exit;
       }
       else if(ord($chained64{8}) == 3) { // step 5
           $lenght_domain = (ord($chained64[31])*256 + ord($chained64[30]));
           $offset_domain = (ord($chained64[33])*256 + ord($chained64[32]));
           $domain = substr($chained64, $offset_domain, $lenght_domain);
           $lenght_login = (ord($chained64[39])*256 + ord($chained64[38]));
           $offset_login = (ord($chained64[41])*256 + ord($chained64[40]));
           $login = substr($chained64, $offset_login, $lenght_login);
           $lenght_host = (ord($chained64[47])*256 + ord($chained64[46]));
           $offset_host = (ord($chained64[49])*256 + ord($chained64[48]));
           $host = substr($chained64, $offset_host, $lenght_host);
       }

   }
   $login = preg_replace("/(.)(.)/","$1",$login);
   $domain = preg_replace("/(.)(.)/","$1",$domain);
   $login = strtolower($login);
   $domain = strtoupper($domain);
   return array($login,$domain); // step 6 : accept
}

jeudi 25 septembre 2008

First feedback on Android framework [EN]

After few months developing a little try under Android API, I wanted to make feedback on benefits of the Google OS. I want to achieve the first version of my project and then make aconstructive criticism about Android regarding to other graphical or mobile APIs, like the iPhone.
Since the beginning of the year, I established a personal project to develop a small Android application, quite independent, using GUI at maximum of its capacities, a database (SQLite) and a few onboard Google Maps onboard. I'll give small screenshots in a way that says enough along on the usefulness of the program, because I do not know yet exactly what I will do with my application.

lundi 19 mai 2008

First Android Developper Challenge over [EN]

About two weeks ago, the first ADC is over, and winners are published.
This post will comment few winner applications, positive and negative points on them.
Firstly, I saw in a recent RSS feed that ADC judges are mainly from the Handset Alliance. I think this is quite unfair for some kind of application. Judges are from constructors like HTC, NVidia, Samsung, Telefonica, Motorola, T-mobile *, ASUS, etc... and for a lot of them, they are mobile contructors. By this way, many applications are designed to be winners because of the marketing concept that constructors like to use for selling a mobile. For example, many winners are social networks. I understand that this kind of application will be very used by majority of people (if they have enough money to stay connected to the Internet everytime they use their mobile...), but other applications, that could be really usefull but that are not a very good subject for marketing could be disadvantaged.
A second point that I want to highlight is that in a lot of these winner applications, the user interface is made for a very high resolution. Think that first mobiles using Android won't have such a resolution. In this case, the winner application won't work correctly on many of these phones...
Yet, I was impressed by some of these applications. For example a biometric application called BioWallet that scan eyes for iris based authentication (yes, you will need a very good camera on your mobile now...), or the ability to scan 1D and 2D barcodes.
The past month, I tried the Android SDK, and I enjoyed the easy way to make efficient user interfaces.
The next post I will put on this blog will be about first steps in Android SDK.

lundi 7 avril 2008

Android overview [EN]

Today, I wish to share my passion for Android, the user interface of my future mobile phone. Android is like an operating system on a mobile phone, but it is an open source, easy to program, and maintained by the giant Google.
Android is only at the stage of its development, it is thus still difficult to know what will be the final result, but it promises a lot, because built by the best Java developers from all over the world, and leads to creativity by a challenge of $10'000'000...
It runs on Java under an embeded and enhanced JVM, itself running over a linux kernel. Since few months, the SDK is available, with an emulator; many developers communities were formed; the challenge increased creativity and numbers of program tries. Soon, a first giant step will be made by google in the mobile phone world.
I can only advise you to go to throw a glance, as well on the Google workshops as on Youtube to see some basic demonstrations, as “how to create an application like a contact list in about 5 minutes and 15 code lines".

jeudi 1 janvier 1970

Transfert de blog

Bonjour et bienvenue,

Suite à un changement radical de solution d'hébergement, certains billets de mon ancien blog vont se retrouver ici. Le blog pourra reprendre vie d'ici 1 à 2 mois.