Changeset 1306

Show
Ignore:
Timestamp:
11/05/07 14:44:57 (1 year ago)
Author:
benoitg
Message:
  • Commit most of Robin Jones install script improvements.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wifidog-auth/CHANGELOG

    r1304 r1306  
    11# $Id$ 
     22007-11-05 Benoit Grégoire  <bock@step.polymtl.ca> 
     3        * Commit most of Robin Jones install script improvements. 
     4                 
    252007-10-22 Benoit Grégoire  <bock@step.polymtl.ca> 
    36        * Major security fix:  Fix the authenticator for a security breach where a user could get Internet access using an empty username.  LocalUser and LDAP were definitely vulnerable, RADIUS may have been. 
  • trunk/wifidog-auth/wifidog/classes/Dependency.php

    r1294 r1306  
    3737 * @package    WiFiDogAuthServer 
    3838 * @author     Philippe April 
    39  * @author     Max Horváth <max.horvath@freenet.de> 
    40  * @author     Benoit Grégoire <bock@step.polymtl.ca> 
     39 * @author     Max Horváth <max.horvath@freenet.de> 
     40 * @author     Benoit Grégoire <bock@step.polymtl.ca> 
    4141 * @copyright  2005-2007 Philippe April 
    42  * @copyright  2005-2007 Max Horváth, Horvath Web Consulting 
    43  * @copyright  2006-2007 Benoit Grégoire, Technologies Coeus inc. 
     42 * @copyright  2005-2007 Max Horváth, Horvath Web Consulting 
     43 * @copyright  2006-2007 Benoit Grégoire, Technologies Coeus inc. 
    4444 * @version    Subversion $Id$ 
    4545 * @link       http://www.wifidog.org/ 
     
    6464  * @package    WiFiDogAuthServer 
    6565  * @author     Philippe April 
    66   * @author     Max Horváth <max.horvath@freenet.de> 
    67   * @author     Benoit Grégoire <bock@step.polymtl.ca> 
     66  * @author     Max Horváth <max.horvath@freenet.de> 
     67  * @author     Benoit Grégoire <bock@step.polymtl.ca> 
    6868  * @copyright  2005-2007 Philippe April 
    69   * @copyright  2005-2007 Max Horváth, Horvath Web Consulting 
    70   * @copyright  2006-2007 Benoit Grégoire, Technologies Coeus inc. 
     69  * @copyright  2005-2007 Max Horváth, Horvath Web Consulting 
     70  * @copyright  2006-2007 Benoit Grégoire, Technologies Coeus inc. 
    7171  */ 
    7272  class Dependency 
     
    123123       'installDestination' => "/" 
    124124       ), 
     125       
    125126       /* PHP extensions (optional) */ 
     127       "simplepie" => array ( 
     128       "type" => "localLib", 
     129       "detectFiles" => "lib/simplepie/simplepie.inc", 
     130       'description' => "SimplePie is a dependency that provides an RSS parser in PHP. It is required for RssPressReview.  It is is recommended to install it, if you do not, RSS feed options will be disabled.", 
     131       'website' => "http://simplepie.org/", 
     132       'installSourceUrl' => "http://svn.simplepie.org/simplepie/branches/1.0/", 
     133       'installMethod' => "svn", 
     134       'installDestination' => "simplepie" 
     135       ), 
     136       'jpgraph' => array ( 
     137       "type" => "localLib", 
     138       "detectFiles" => "lib/jpgraph-1.22/src/jpgraph.php", 
     139       'description' => "JpGraph is a Object-Oriented Graph creating library for PHP. 
     140JpGraph is not currently used by Wifidog (it will be use for statistic graphs in a later version). You can skip this installation if your not a developper.", 
     141       'website' => "http://www.aditus.nu/jpgraph/", 
     142       'installSourceUrl' => "http://hem.bredband.net/jpgraph/jpgraph-1.22.tar.gz", 
     143       'installMethod' => "tarball", 
     144       'installDestination' => "/" 
     145        ), 
     146       'feedpressreview' => array ( 
     147       "type" => "localLib", 
     148       "detectFiles" => "lib/feedpressreview/FeedPressReview.inc", 
     149       'description' => "Feed Press Review allows your athentication server to produce RSS Feeds.  It is recommended that it is installed.  If it is not installed, the RSS feed options will be disabled.", 
     150       'website' => "http://projects.coeus.ca/feedpressreview/", 
     151       'installSourceUrl' => "http://projects.coeus.ca/svn/feedpressreview/trunk/", 
     152       'installMethod' => "svn", 
     153       'installDestination' => "feedpressreview" 
     154        ), 
    126155       'gettext' => array ( 
    127156       "type" => "phpExtension", 
     
    282311 
    283312          /** Use PHP internal functions to execute a command 
    284             @return: Return value of the command*/ 
     313           Â @return: Return value of the command*/ 
    285314          function execVerbose($command, & $output, & $return_var, &$errMsg = null) { 
    286315              $errMsg .= "Executing: $command <br/>"; 
     
    469498                             break; 
    470499                         case "localLib": 
    471                                                   if($this->getInstallSourceUrl()) { 
    472                                                                                    $name = $this->getId().'_install'; 
    473                                                                                    $value = sprintf(_("Install %s"), $this->getId()); 
    474                                                               $html .= sprintf("<input type='submit' name='%s' value='%s'/>", $name, $value); 
     500                             if($this->getInstallSourceUrl()) { 
     501                                 $name = $this->getId().'_install'; 
     502                                 $value = sprintf(_("Install %s"), $this->getId()); 
     503                                 $html .= sprintf("<input type='submit' name='%s' value='%s'/>", $name, $value); 
    475504                                                       
    476505                             } 
    477506                             else { 
    478                                  $html .= sprintf(_("Sorry, i couldn't find the source for %s in installSourceUrl"), $this->getId()); 
     507                                 $html .= sprintf(_("Sorry, i couldn't find the source for %s in installSourceUrl"), 
     508                                 $this->getId()); 
    479509                             } 
    480510 
     
    657687                           } 
    658688                           else { 
    659                                $installDestinationPath = WIFIDOG_ABS_FILE_PATH . "lib/";$installDestinationPathOrig. 
     689                               $installDestinationPath = WIFIDOG_ABS_FILE_PATH . "lib/" .$installDestinationPathOrig; 
    660690                               $installMethod = $this->getInstallMethod(); 
    661691                               switch($installMethod) { 
     692                                   case "svn": 
     693                                       self::execVerbose("svn co ".escapeshellarg($installSourceUrl)." ".escapeshellarg      ($installDestinationPath), $output, $return, $errorMsg); 
     694 
     695 
     696                                       break; 
     697 
    662698                                   case "tarball": 
    663699                                       $downloadPath = WIFIDOG_ABS_FILE_PATH . "tmp/"; 
  • trunk/wifidog-auth/wifidog/install.php

    r1296 r1306  
    11<?php 
    2  
    32 
    43/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ 
     
    3938 * 
    4039 * @package    WiFiDogAuthServer 
    41  * @author     Pascal Leclerc <isf@plec.ca> 
    42  * @copyright  2005-2006 Pascal Leclerc 
     40 * @author     Pascal Leclerc <isf@plec.ca>, Robin Jones and Benoit Grégoire 
     41 * @copyright  2005-2006 Pascal Leclerc, 2006-2007 Technologies Coeus inc., 2007 Robin Jones 
    4342 * @version    Subversion $Id$ 
    4443 * @link       http://www.wifidog.org/ 
     
    7170} 
    7271 
    73 # Read password file 
     72#Read password file 
    7473$fd = fopen($password_file, "rb"); 
    7574$password = trim(fread($fd, filesize($password_file))); 
     
    8887$auth = true; 
    8988 
    90 if (!$auth) { # Ask user for the passorw
     89if (!$auth) { # Ask user for the passwor
    9190    header('WWW-Authenticate: Basic realm="Private"'); 
    9291    header('HTTP/1.0 401 Unauthorized'); 
    93     echo "Authorization Required !"; 
     92    echo "Restricted Access - Authorisation Required!"; 
    9493    exit; 
    9594} 
    9695# End of Security validation 
    9796 
     97 
     98/************************************************************************************ 
     99 * Begin Dynamic HTML Page Header 
     100 ************************************************************************************/ 
    98101print<<<EndHTML 
    99102<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
    100103<HTML> 
    101104<HEAD> 
    102   <TITLE>$page - Wifidog Auth-server configuration</TITLE> 
     105  <TITLE>$page - Wifidog Auth-server installation and configuration</TITLE> 
    103106 
    104107  <SCRIPT type="text/javascript"> 
    105     // This function add new configuration value to the "config" hidden input 
    106     // On submit, config will be parsed and value saved to config.php file 
     108    // This function adds a new configuration value to the "config" hidden input 
     109    // On submit, the config will be parsed and the value saved to the config.php file 
    107110    function newConfig(dataAdd) { 
    108111      // TODO : Validate input data 
     
    116119    } 
    117120  </SCRIPT> 
    118  
     121   
     122<link rel="stylesheet" type="text/css" href="/media/base_theme/stylesheet.css" /> 
    119123</HEAD> 
    120 <BODY text="black" bgcolor="#CFCFCF"
     124<BODY id='page' class='{$page}'
    121125 
    122126<style type="text/css"> 
    123127<!-- 
    124 .button 
     128 
     129.submit 
    125130{ 
    126   font-size: 12pt; 
    127   font-weight: bold; 
    128   color: black; 
    129   background: #D4D0C8; 
     131  font-size: 14pt; 
    130132  text-decoration: none; 
    131   border-top: 1px solid white; 
    132   border-right: 2px solid gray; 
    133   border-bottom: 2px solid gray; 
    134   border-left: 1px solid white; 
    135133  padding: 3px 5px 3px 5px; 
     134  background-color: #ccccff; 
    136135} 
    137136 
    138 body 
    139 
    140   background-color: white; 
     137table { 
     138border-collapse: collapse; 
    141139} 
    142140 
    143 td 
    144 { 
    145   padding: 1px 4px 1px 4px; 
    146 } 
    147141--> 
    148142</style> 
     143 
    149144 
    150145<FORM NAME="myform" METHOD="post"> 
     
    152147<INPUT TYPE="HIDDEN" NAME="debug"> 
    153148<INPUT TYPE="HIDDEN" NAME="config"> 
    154  
     149<div id="page_body"> 
     150        <div id="left_area"> 
     151                <div id="left_area_top"> 
     152                        <h1>Installation status</h1> 
     153                         
     154EndHTML; 
     155$pageindex = array("Welcome"=>"Welcome", 
     156                   "Prerequisites"=>"Prerequisites", 
     157                   "Permissions"=>"Permissions", 
     158                   "Dependencies"=> "Dependencies",                 
     159                   "Database Access"=> "Database", 
     160                   "Database Connection"=>"testdatabase", 
     161                   "Database Initialisation"=>"dbinit", 
     162                   "Global Options"=>"options", 
     163                   "Language Locale"=>"languages", 
     164                   "User Creation"=>"admin", 
     165                   "Review"=>"Review", 
     166                   "Finish"=>"finish",); 
     167foreach($pageindex as $pagekey => $pagevalue){ 
     168    if ($pagevalue != $page){ 
     169        print "$pagekey <br>"; 
     170    } 
     171    else { 
     172        print "<strong>$pagekey</strong> <br>"; 
     173    } 
     174
     175print<<<EndHTML 
     176                </div> 
     177                <div id="left_area_bottom"> 
     178                        <p><a href="../CHANGELOG">Change Log</a><BR> 
     179                        <a href="http://dev.wifidog.org/report/10">Known issues</a></p> 
     180                </div> 
     181        </div> 
     182<div id="main_area"> 
     183         
     184        <div id="main_area_top"> 
     185                <table align="center"><tr><td><img src="/media/base_theme/images/wifidog_logo_banner.png" /></td></tr></table> 
     186        </div> 
     187        <div id="main_area_middle"> 
    155188EndHTML; 
    156189 
     
    161194#exit(); 
    162195 
    163 # Needed files/directories with write access 
     196#Begin Perquisite Array        (Needed files/directories with write access) 
    164197$dir_array = array ( 
    165198'tmp', 
     
    173206'config.php' 
    174207); 
    175  
    176 $smarty_full_url = 'http://smarty.php.net/do_download.php?download_file=Smarty-2.6.14.tar.gz'; 
    177  
    178 $neededPackages = array ( 
    179 'smarty' => array ( 
    180 'needed' => 1, 
    181 'available' => 0, 
    182 'message' => '', 
    183 'file' => 'lib/smarty/Smarty.class.php' 
     208#end perquisite array 
     209 
     210 
     211#Begin Global Options Array 
     212$optionsInfo = array ( 
     213/********************************************************************************************* 
     214TODO:  SSL is now configured in the DB, but should still be handled by the install script 
     215'SSL_AVAILABLE' => array ( 
     216'title' => 'SSL Support', 
     217'depend' => 'return 1;', 
     218'message' => '&nbsp;' 
    184219), 
    185 'simplepie' => array ( 
    186 'needed' => 0, 
    187 'available' => 0, 
    188 'message' => '', 
    189 'file' => 'lib/simplepie/simplepie.inc', 
    190 'svn_source' => 'http://svn.simplepie.org/simplepie/branches/1.0/' 
    191 ), 
    192 'feedpressreview' => array ( 
    193 'needed' => 0, 
    194 'available' => 0, 
    195 'message' => '', 
    196 'file' => 'lib/feedpressreview/FeedPressReview.inc', 
    197 'svn_source' => 'http://projects.coeus.ca/svn/feedpressreview/trunk/' 
    198 
    199 ); 
    200  
    201 $optionsInfo = array ( 
    202 /* TODO:  SSL is now configured in the DB, but should still be handled by the install script 
    203  'SSL_AVAILABLE' => array ( 
    204  'title' => 'SSL Support', 
    205  'depend' => 'return 1;', 
    206  'message' => '&nbsp;' 
    207  ), 
    208  */ 
     220************************************************************************/ 
    209221'CONF_USE_CRON_FOR_DB_CLEANUP' => array ( 
    210222'title' => 'Use cron for DB cleanup', 
     
    219231); 
    220232 
    221 foreach ($neededPackages as $key => $value) { # Detect installed libraries (smarty, ...) 
    222     if (file_exists(WIFIDOG_ABS_FILE_PATH . $neededPackages[$key]['file'])) 
    223     $neededPackages[$key]['available'] = 1; 
    224 
     233 
    225234 
    226235$CONFIG_FILE = 'config.php'; 
     
    268277################################### 
    269278# array (array1(name1, page1), array2(name2, page2), ..., arrayN(nameN, pageN)); 
    270 # Todo : Supporter HTTP_REFERER (j'me comprends) 
    271279function navigation($dataArray) { 
    272280    $SERVER = $_SERVER['HTTP_HOST']; 
    273281    $SCRIPT = $_SERVER['SCRIPT_NAME']; 
    274     print "\n<p>"; 
     282    print "<p><br></p>"; 
    275283    foreach ($dataArray as $num => $navArray) { 
    276284        $title = $navArray['title']; 
     
    278286        empty ($navArray['action']) ? $action = '' : $action = $navArray['action']; 
    279287        print<<<EndHTML 
    280 <A HREF="#" ONCLICK="document.myform.page.value = '$page'; document.myform.action.value = '$action'; document.myform.submit();" CLASS="button">$title</A> 
     288<A HREF="#" ONCLICK="document.myform.page.value = '$page'; document.myform.action.value = '$action'; document.myform.submit();" CLASS="submit">$title</A> 
    281289 
    282290EndHTML; 
    283291        if (array_key_exists($num +1, $dataArray)) 
    284         print "&nbsp;-&nbsp;"; 
     292        print "&nbsp; &nbsp;"; 
    285293    } 
    286     print "</p>\n"; 
     294 
    287295} 
    288296 
     
    292300    print<<<EndHTML 
    293301 
    294 <p><A HREF="#" ONCLICK="javascript: window.location.reload(true);" CLASS="button">Refresh</A></p> 
     302<p><A HREF="#" ONCLICK="javascript: window.location.reload(true);" CLASS="submit">Refresh</A></p> 
    295303EndHTML; 
    296304} 
     
    304312 EndHTML; 
    305313 } */ 
    306  
    307 ################################### 
    308 # In development 
    309 /*function installPackage($pkg_name, $full_url, $copy) { 
    310  print "<h1>$pkg_name installation</h1>\n"; 
    311  chdir(WIFIDOG_ABS_FILE_PATH."tmp"); 
    312  list($url, $filename) = split ("=", $full_url); 
    313  
    314  print "Download source code ($filename) : "; 
    315  if (!file_exists($filename)) 
    316  Dependency::execVerbose("wget \"$url\"", $output, $return); 
    317  if (!file_exists($filename)) // wget success if file exists 
    318  Dependency::execVerbose("wget \"$full_url\" 2>&1", $output_array, $return); 
    319  if (!file_exists($filename)) { 
    320  print "<B STYLE=\"color:red\">Error</b><p>Current working directory : <em>$basepath/tmp/smarty</em>"; 
    321  $output = implode("\n", $output_array); 
    322  print "<pre><em>wget \"$full_url\"</em>\n$output</pre>"; 
    323  exit(); 
    324  } else { 
    325  print "OK<BR>"; 
    326  } 
    327  
    328  print "Uncompressing : "; 
    329  $dirname = array_shift(split(".tar.gz", $filename)); 
    330  
    331  if (!file_exists($dirname)) 
    332  Dependency::execVerbose("tar -xzf $dirname.tar.gz", $output, $return); 
    333  print "OK<BR>"; 
    334  print "Copying : "; 
    335  if (!file_exists('../../lib/smarty/Smarty.class.php')); 
    336  Dependency::execVerbose("cp -r $dirname/libs/* ../../lib/smarty", $output, $return); 
    337  Dependency::execVerbose("cp -r $dirname/libs/* ../../lib/smarty", $output, $return); 
    338  $copy 
    339  print "OK<BR>"; 
    340  }*/ 
    341314 
    342315################################### 
     
    399372} 
    400373 
    401 ################################### 
    402 # MAIN 
     374 
     375 
     376/******************************************************************************** 
     377 * MAIN PROCEDURE                                                                                                                               * 
     378 * case statement to navigate through install script 
     379 *                                                                                                                                                              * 
     380 *********************************************************************************/ 
    403381switch ($page) { 
    404     case 'permission' : 
     382    case 'Permissions' : 
    405383        print "<h1>Permissions</h1>"; 
    406384 
     
    428406        print "<p><em>HTTP daemon UNIX username/group</em>: $process_username/$process_group</p>"; 
    429407        #    print "<p><em>HTTPD group</em>: $process_group<BR</p>"; 
    430         print "<p><table BORDER=\"1\"><tr><td><em>Directory</em></td></td><td><em>Owner</em></td><td><em>Writable</em></td></tr>\n"; 
     408        print "<p><table BORDER=\"1\"><tr><td><b>Directory</b></td></td><td><b>Owner</b></td><td><b>Writable</b></td></tr>\n"; 
    431409 
    432410        foreach ($dir_array as $dir) { 
     
    465443            navigation(array ( 
    466444            array ( 
     445                "title" => "Back", 
     446                "page" => "Prerequisites" 
     447                ), 
     448                array ( 
    467449                "title" => "Next", 
    468                 "page" => "version
     450                "page" => "Dependencies
    469451                ) 
    470452                )); 
     
    472454        else { 
    473455            refreshButton(); 
    474             print "<p>You need to allow UNIX user <em>$process_username</em> to write to these directories (mkdir, chown or chmod)</p>"; 
    475             if (!empty ($cmd_mkdir) || !empty ($cmd_mkdir)) 
    476             print "<p><b>For instance, you may want to use the following commands</b> :</p>\n"; 
    477             if (!empty ($cmd_mkdir)) 
    478             print "mkdir $cmd_mkdir <br />"; 
    479             if (!empty ($cmd_chown)) 
    480             print "chgrp -R $process_group $cmd_chown;<br/>chmod g+wx $cmd_chown;<br/>"; 
    481             print "<p>After permissions modification done, hit the REFRESH button to see the NEXT button and continue with the installation"; 
     456            navigation(array ( 
     457            array ( 
     458                "title" => "Back", 
     459                "page" => "Prerequisites" 
     460                ) 
     461                )); 
     462                print "<p>UNIX user <em>$process_username</em> must be able to write to these directories (mkdir, chown or chmod)</p>"; 
     463                if (!empty ($cmd_mkdir) || !empty ($cmd_mkdir)) 
     464                print "<p><b>For instance, you may want to use the following commands</b> :</p>\n"; 
     465                if (!empty ($cmd_mkdir)) 
     466                print "mkdir $cmd_mkdir <br />"; 
     467                if (!empty ($cmd_chown)) 
     468                print "chgrp -R $process_group $cmd_chown;<br/>chmod g+wx $cmd_chown;<br/>"; 
     469                print "<p>After permission modifications have been preformed, click the REFRESH button to check they have been completed successfully. The NEXT button will then appear to continue with the installation."; 
    482470        } 
    483471        break; 
    484         ################################### 
    485     case 'version' : 
    486         print "<h1>Checking Dependency</h1>"; 
     472        ########################################### 
     473    case 'Dependencies' : 
     474        print "<h1>Checking Dependencies</h1>"; 
    487475        $error = 0; 
    488476        $userData['error']=&$error; 
     
    494482            array ( 
    495483                "title" => "Back", 
    496                 "page" => "permission
     484                "page" => "Permissions
    497485                ), 
    498486                array ( 
    499487                "title" => "Next", 
    500                 "page" => "simplepie" 
     488                "page" => "Database" 
    501489                ) 
    502490                )); 
     
    504492 
    505493        break; 
    506         ################################### 
    507     case 'simplepie' : // Download, uncompress and install SimplePie 
    508         print "<h1>SimplePie installation</h1>\n"; 
    509  
    510         if ($neededPackages['simplepie']['available']) { 
    511             print "Already installed !<BR>"; 
    512             navigation(array ( 
    513             array ( 
    514                 "title" => "Back", 
    515                 "page" => "smarty" 
    516                 ), 
    517                 array ( 
    518                 "title" => "Next", 
    519                 "page" => "feedpressreview" 
    520                 ) 
    521                 )); 
    522         } 
    523         elseif ($action == 'install') { 
    524             require_once (dirname(__FILE__) . '/include/common.php'); 
    525             print "Download source code frpm svn($filename) : "; 
    526             Dependency::execVerbose("svn co ".escapeshellarg($neededPackages['simplepie']['svn_source'])." ".escapeshellarg(WIFIDOG_ABS_FILE_PATH."lib/simplepie"), $output, $return); 
    527             #Dependency::execVerbose("locale", $output, $return); 
    528  
    529             refreshButton(); 
    530             navigation(array ( 
    531             array ( 
    532                 "title" => "Back", 
    533                 "page" => "smarty" 
    534                 ), 
    535                 array ( 
    536                 "title" => "Next", 
    537                 "page" => "feedpressreview" 
    538                 ) 
    539                 )); 
    540         } 
    541         else { 
    542             print<<< EndHTML 
    543 <p><A HREF="http://simplepie.org/">SimplePie</A> is a dependency of provides an RSS parser in PHP. It is required for RssPressReview.  It's is recommended to install it, if you don't, RSS feeds options will be disabled. 
    544  
    545 <p>Do you want to install SimplePie ? 
    546 EndHTML; 
    547             navigation(array ( 
    548             array ( 
    549                 "title" => "Back", 
    550                 "page" => "smarty" 
    551                 ), 
    552                 array ( 
    553                 "title" => "Install", 
    554                 "page" => "simplepie", 
    555                 "action" => "install" 
    556                 ), 
    557                 array ( 
    558                 "title" => "Next", 
    559                 "page" => "feedpressreview" 
    560                 ) 
    561                 )); 
    562         } 
    563         break; 
    564         ################################### 
    565     case 'feedpressreview' : // Download, uncompress and install feedpressreview 
    566         print "<h1>Feed press review installation</h1>\n"; 
    567  
    568         if ($neededPackages['feedpressreview']['available']) { 
    569             print "Already installed !<BR>"; 
    570             navigation(array ( 
    571             array ( 
    572                 "title" => "Back", 
    573                 "page" => "simplepie" 
    574                 ), 
    575                 array ( 
    576                 "title" => "Next", 
    577                 "page" => "database" 
    578                 ) 
    579                 )); 
    580         } 
    581         elseif ($action == 'install') { 
    582             require_once (dirname(__FILE__) . '/include/common.php'); 
    583             print "Download source code frpm svn($filename) : "; 
    584             Dependency::execVerbose("svn co ".escapeshellarg($neededPackages['feedpressreview']['svn_source'])." ".escapeshellarg(WIFIDOG_ABS_FILE_PATH."lib/feedpressreview"), $output, $return); 
    585             #Dependency::execVerbose("locale", $output, $return); 
    586  
    587             refreshButton(); 
    588             navigation(array ( 
    589             array ( 
    590                 "title" => "Back", 
    591                 "page" => "smarty" 
    592                 ), 
    593                 array ( 
    594                 "title" => "Next", 
    595                 "page" => "database" 
    596                 ) 
    597                 )); 
    598         } 
    599         else { 
    600             print<<< EndHTML 
    601 <p><A HREF="http://projects.coeus.ca/feedpressreview/">Feed press review</A> is a dependency that provides a Feed aggregator in PHP.  It is recommended to install it.  If you don't, RSS feeds options will be disabled. 
    602  
    603 <p>Do you want to install FeedPressReview ? 
    604 EndHTML; 
    605             navigation(array ( 
    606             array ( 
    607                 "title" => "Back", 
    608                 "page" => "simplepie" 
    609                 ), 
    610                 array ( 
    611                 "title" => "Install", 
    612                 "page" => "feedpressreview", 
    613                 "action" => "install" 
    614                 ), 
    615                 array ( 
    616                 "title" => "Next", 
    617                 "page" => "database" 
    618                 ) 
    619                 )); 
    620         } 
    621         break; 
    622         ################################### 
    623     case 'jpgraph' : // Download, uncompress and install JpGraph library 
    624         print "<h1>JpGraph installation</h1>\n"; 
    625  
    626         if ($neededPackages['jpgraph']['available']) { 
    627             print "Already installed !<BR>"; 
    628             navigation(array ( 
    629             array ( 
    630                 "title" => "Back", 
    631                 "page" => "feedpressreview" 
    632                 ), 
    633                 array ( 
    634                 "title" => "Next", 
    635                 "page" => "database" 
    636                 ) 
    637                 )); 
    638         } 
    639         elseif ($action == 'install') { 
    640             chdir(WIFIDOG_ABS_FILE_PATH . "tmp"); 
    641             $filename = array_pop(preg_split("/\//", $jpgraph_full_url)); 
    642  
    643             print "Download source code ($filename) : "; 
    644             if (!file_exists($filename)) 
    645             Dependency::execVerbose("wget \"$jpgraph_full_url\" 2>&1", $output, $return); 
    646             if (!file_exists($filename)) { # Error occured, print output of wget 
    647                 print "<B STYLE=\"color:red\">Error</b><p>Current working directory : <em>$basepath/tmp</em>"; 
    648                 $output = implode("\n", $output); 
    649                 print "<pre><em>wget \"$jpgraph_full_url\"</em>\n$output</pre>"; 
    650                 exit (); 
    651             } 
    652             else { 
    653                 print "OK<BR>"; 
    654             } 
    655  
    656             print "Uncompressing : "; 
    657             $dirname = array_shift(split(".tar.gz", $filename)); 
    658             if (!file_exists($dirname)) 
    659             Dependency::execVerbose("tar -xzf $dirname.tar.gz", $output, $return); 
    660             print "OK<BR>"; 
    661  
    662             print "Copying : "; 
    663             if (!file_exists(WIFIDOG_ABS_FILE_PATH."lib/jpgraph/jpgraph.php")) 
    664             Dependency::execVerbose("cp $dirname/src/* ".WIFIDOG_ABS_FILE_PATH."lib/jpgraph", $output, $return); # TODO : Utiliser JPGRAPH_REL_PATH 
    665  
    666             print "OK<BR>"; 
    667  
    668             refreshButton(); 
    669             navigation(array ( 
    670             array ( 
    671                 "title" => "Back", 
    672                 "page" => "feedpressreview" 
    673                 ), 
    674                 array ( 
    675                 "title" => "Next", 
    676                 "page" => "database" 
    677                 ) 
    678                 )); 
    679         } 
    680         else { 
    681             print<<< EndHTML 
    682 <p><A HREF="http://www.aditus.nu/jpgraph/">JpGraph</A> is a Object-Oriented Graph creating library for PHP. 
    683 JpGraph is not currently use by Wifidog (will be use for statistique graph in a later version). You can skip this installation if your not a developper. 
    684  
    685 <p>Do you want to install JpGraph ? 
    686 EndHTML; 
    687             navigation(array ( 
    688             array ( 
    689                 "title" => "Back", 
    690                 "page" => "feedpressreview" 
    691                 ), 
    692                 array ( 
    693                 "title" => "Install", 
    694                 "page" => "jpgraph", 
    695                 "action" => "install" 
    696                 ), 
    697                 array ( 
    698                 "title" => "Next", 
    699                 "page" => "database" 
    700                 ) 
    701                 )); 
    702         } 
    703         break; 
    704         ################################### 
    705     case 'database' : 
     494 
     495        ########################################### 
     496    case 'Database' : 
    706497        ### TODO : Valider en javascript que les champs soumit ne sont pas vide 
    707498        #          Pouvoir choisir le port de la DB ??? 
    708499        print<<< EndHTML 
    709 <h1>Database access configuration</h1> 
     500<h1>Database Access Configuration</h1> 
    710501<BR> 
    711502<table border="1"> 
     
    716507</table> 
    717508 
    718 <p>By clicking Next, your configuration will be automaticaly saved 
     509<p>By clicking Next, your configuration will be automatically saved.</p> 
    719510 
    720511<script type="text/javascript"> 
     
    732523        array ( 
    733524            "title" => "Back", 
    734             "page" => "simplepie
    735             ) 
     525            "page" => "Dependencies
     526            ), 
    736527            )); #, array("title" => "Next", "page" => "testdatabase"))); 
    737528            print<<< EndHTML 
    738 <p><A HREF="#" ONCLICK="javascript: document.myform.page.value='testdatabase'; submitDatabaseValue(); document.myform.submit();" CLASS="button">Next</A></p
     529<A HREF="#" ONCLICK="javascript: document.myform.page.value='testdatabase'; submitDatabaseValue(); document.myform.submit();" CLASS="submit">Next</A
    739530 
    740531EndHTML; 
    741532 
    742533            break; 
    743             ################################### 
     534            ########################################### 
    744535    case 'testdatabase' : 
    745536        print "<h1>Database connection</h1>"; 
     
    755546        } 
    756547        else { 
    757             printf ("<p>Unable to connect!  The server has to be online, the database \"%s\" must exist, and the postgresql.conf and pg_hba.conf must allow the user \"%s\" to open a connection to it on host \"%s\" to continue.  See the error above for hints on what the problem may be.", $CONF_DATABASE_NAME, $CONF_DATABASE_USER, $CONF_DATABASE_HOST); 
     548            printf ("<p>Unable to connect to database!  Please make sure the server is online and the database \"%s\" exists. Also 'postgresql.conf' and 'pg_hba.conf' must allow the user \"%s\" to open a connection to it on host \"%s\" to continue.  See the error above for clues on what the problem may be.</p>", $CONF_DATABASE_NAME, $CONF_DATABASE_USER, $CONF_DATABASE_HOST); 
    758549            print "<p>Please go back and retry with correct values, or fix your server configuration.</p>"; 
    759550            refreshButton(); 
    760             navigation(array(array("title" => "Back", "page" => "database"))); 
     551            navigation(array(array("title" => "Back", "page" => "Database"))); 
    761552            die(); 
    762553        } 
    763554        print "</li>"; 
    764                print "<li>";  
     555        print "<li>"; 
    765556        $postgresql_info = pg_version(); 
    766557        printf ("PostgreSQL server version: %s", $postgresql_info['server']);        print "</li>"; 
    767          
     558 
    768559        #        if ($postgresql_info['server'] > $requiredPostgeSQLVersion) { Todo : Do something } 
    769560 
     
    774565        array ( 
    775566            "title" => "Back", 
    776             "page" => "database" 
     567            "page" => "Database" 
    777568            ), 
    778569            array ( 
     
    782573            )); 
    783574            break; 
    784             ################################### 
     575            ########################################### 
    785576    case 'dbinit' : 
    786         print "<h1>Database initialisation</h1>"; 
     577        print "<h1>Database Initialisation</h1>"; 
    787578        # SQL are executed with PHP, some lines need to be commented out. 
    788579        $file_db_version = 'UNKNOW'; 
     
    867658            else { 
    868659                print "Error : Unexpected result"; 
    869                             exit (); 
     660                exit (); 
    870661            } 
    871662 
     
    875666        array ( 
    876667            "title" => "Back", 
    877             "page" => "database" 
     668            "page" => "testdatabase" 
    878669            ), 
    879670            array ( 
     
    883674            )); 
    884675            break; 
    885  
    886             ################################### 
     676            ########################################### 
    887677    case 'options' : 
    888678        # TODO : Tester que la connection SSL est fonctionnelle 
    889679        #        Options avancees : Supporter les define de [SMARTY|PHLICKR|JPGRAPH]_REL_PATH 
    890680        print<<< EndHTML 
    891 <h1>Available options</h1> 
     681<h1>Available Options</h1> 
    892682  <table border="1"> 
    893683 
     
    898688            $value = $configArray[$name]; # Value of option in config.php 
    899689            $title = $optionsInfo[$name]['title']; # Field Title 
    900             $message = $optionsInfo[$name]['message']; # Message why option is disable 
     690            $message = $optionsInfo[$name]['message']; # Message why option is disabled 
    901691            if(empty($value)) 
    902692            $message .= ", ERROR: unable to find the '$name' directive in the config file"; 
    903693            $depend = @ eval ($optionsInfo[$name]['depend']); # Evaluate the dependencie 
    904694            $selectedTrue = ''; 
    905             $selectedFalse = ''; # Initialize value 
     695            $selectedFalse = ''; # Initialise value 
    906696            $value == 'true' ? $selectedTrue = 'SELECTED' : $selectedFalse = 'SELECTED'; # Use to select the previous saved option 
    907697            $depend == 1 ? $disabled = '' : $disabled = 'DISABLED'; # Disable <SELECT> if dependencie is not satisfied 
     
    951741            )); 
    952742 
    953             print<<< EndHTML 
    954 <p><A HREF="#" ONCLICK="javascript: document.myform.page.value='languages'; submitOptionsValue(); document.myform.submit();" CLASS="button">Next</A></p
     743            print<<<EndHTML 
     744<A HREF="#" ONCLICK="javascript: document.myform.page.value='languages'; submitOptionsValue(); document.myform.submit();" CLASS="submit">Next</A
    955745EndHTML; 
    956746 
    957747            break; 
    958  
    959             ################################### 
     748            ########################################### 
    960749    case 'languages' : 
    961         print "<h1>Languages configuration</h1>"; 
    962         print<<< EndHTML 
    963       <p>Not yet implemented ...</p> 
    964       <p>Will allow selecting language to use.</p> 
    965 <em>Error message example</em> : <BR> 
     750 
     751        require_once('classes/LocaleList.php'); 
     752 
     753        #check for current language code in config.php 
     754        $CURRENT_LOCALE = $configArray['DEFAULT_LANG']; 
     755 
     756        #pull a list of all available languages (codes and real friendly names) 
     757        $AVAIL_LOCALE_ARRAY = LocaleList::getAvailableLanguageArray(); 
     758 
     759 
     760        print "<h1>Languages Configuration</h1>"; 
     761 
     762 
     763 
     764        print<<<EndHTML 
     765   
     766      <p>Please select the Authentication Servers default language and locale</p> 
     767 
     768       <div class="language"> 
     769           <form class="language" name="lang_form" method="post" action="{$formAction}"> 
     770               <div>Default Server Locale: 
     771        <select name="default_locale" onchange="newConfig('DEFAULT_LANG=' + this.options[this.selectedIndex].value);"> 
     772EndHTML; 
     773        #for each language in the array get the language code and the friendly name 
     774        foreach ($AVAIL_LOCALE_ARRAY as $_langIds => $_langNames) { 
     775            #if the current local in config.php is the same as the current member of the array, select it as default 
     776            if ($CURRENT_LOCALE == $_langIds) { 
     777                $_selected = (' selected="selected"'); 
     778            } else {#else leave it alone 
     779                $_selected = ""; 
     780            } 
     781            #add the options to the combobox (hidden value= language code, user friendly name [0]multilingual [1]English 
     782            echo'<option value="' . $_langIds . '"' . $_selected . '>'.$_langNames[1].'</option>'; 
     783        } 
     784        print<<<EndHTML 
     785                </select> 
     786               </div> 
     787           </form> 
     788       </div> 
     789 
     790 
     791 
     792  
     793<br><br><br><br> 
     794<strong>Common Error message:</strong> <BR> 
     795<p>This is an example of message you may see in the top of your working auth-server IF the languagepacks on your server have not been installed. In most Unix/Linux system, you could use locale -a to list all available locales on the server and run "apt-get install locales-all" for full language support</p> 
     796 
    966797<DIV style="border:solid black;">Warning: language.php: Unable to setlocale() to fr, return value: , current locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C; [...]</DIV> 
    967 <p><em>I repeat</em> : This is an example of message you can see in the top of your working auth-server if language are not set correctly. To change these values please edit <em>config.php</em> in auth-server install directory. Look for "Available locales" and "Default language" header in config.php. 
    968 EndHTML; 
    969         //    Dependency::execVerbose("locale -a 2>&1", $output, $return)
     798  
     799 
     800EndHTML
    970801 
    971802        navigation(array ( 
     
    980811            )); 
    981812            break; 
    982             ################################### 
     813            ########################################### 
    983814    case 'admin' : 
    984         print "<h1>Administration account</h1>"; 
     815        print "<h1>Administration account<