diff --git a/html/install.php b/html/install.php deleted file mode 100644 index 1b5d08843..000000000 --- a/html/install.php +++ /dev/null @@ -1,649 +0,0 @@ - - - - Noalyss - Install - - - - - - - - - - -

- NOALYSS -

- - -
- Language : - -
- - - - -
- - -✖"; -$succeed=""; -$inc_path=get_include_path(); -global $os; -$inc_path=get_include_path(); -global $os; -if ( strpos($inc_path,";") != 0 ) { - $new_path=$inc_path.';../../include;addon'; - $os=0; /* $os is 0 for windoz */ -} else { - $new_path=$inc_path.':../../include:addon'; - $os=1; /* $os is 1 for unix */ -} - -/** - *@brief create correctly the htaccess file - */ -function create_htaccess() -{ - global $os; - - - /* If htaccess file doesn't exists we create them here - * if os == 1 then windows, 0 means Unix - */ - $file='..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'.htaccess'; - if (! file_exists($file)) - { - $hFile=@fopen($file,'w+'); - if ( ! $hFile ) exit(_('Impossible d\'écrire dans le répertoire include')); - fwrite($hFile,'order deny,allow'."\n"); - fwrite($hFile,'deny from all'."\n"); - fclose($hFile); - } - $file='..'.DIRECTORY_SEPARATOR.'.htaccess'; - if (! file_exists($file)) - { - - $hFile=@fopen($file,'w+'); - if ( ! $hFile ) exit(_('Impossible d\'écrire dans le répertoire html')); - $array=array("php_flag magic_quotes_gpc off", - "php_value max_execution_time 240", - "php_value memory_limit 20M", - "AddDefaultCharset utf-8", - "php_flag register_globals off", - "php_value error_reporting 10239", - "php_value post_max_size 20M", - "php_flag short_open_tag on", - "php_value upload_max_filesize 20M", - "php_value session.use_trans_sid 1", - "php_value session.use_cookies 1", - "php_flag session.use_only_cookies on"); - - if ( $os == 0 ) - fwrite($hFile,'php_value include_path .;../../include;../include;addon'."\n"); - else - fwrite($hFile,'php_value include_path .:../../include:../include:addon'."\n"); - foreach ($array as $value ) fwrite($hFile,$value."\n"); - fclose($hFile); - } - -} -// Retrieve informations from the very screen -// -$db_user=HtmlInput::default_value_request("cuser", ""); -$db_password=HtmlInput::default_value_request("cpasswd", ""); -$db_host=HtmlInput::default_value_request("chost", ""); -$db_port=HtmlInput::default_value_request("cport", ""); -$multi=HtmlInput::default_value_request("multi", "N"); -$locale=HtmlInput::default_value_request("clocale", "1"); -$ctmp=HtmlInput::default_value_request("ctmp", "/tmp"); -$cpath=HtmlInput::default_value_request("cpath", "/usr/bin"); -$db_name=HtmlInput::default_value_request("cdbname", ""); - -//------------------------------------------------------------------------- -// warn only if we can not write in include -//------------------------------------------------------------------------- -if ( is_writable ('..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'constant.php') == false ) { - echo '

'._("Ecriture non possible").'

'. - '

'. - _("On ne peut pas écrire dans le répertoire de NOALYSS, changez-en les droits ") - .'

'; - } - -//---------------------------------------------------------------------------- -// We try to connect with the supplied information -// If we succeed we continue the check -// otherwise we turn back to the first screen -// The config file is created here -//---------------------------------------------------------------------------- - -if (isset($_POST['save_config'])) { - require_once NOALYSS_INCLUDE.'/lib/config_file.php'; - // Try to connect , if it doesn't work that do not create the config file - if ($multi=="N") { - $cnx = Database::connect($db_user, $db_password,'template1', $db_host, $db_port); - }else { - $cnx = Database::connect($db_user, $db_password,$db_name, $db_host, $db_port); - } - // ----- - // If conx successfull save the file or display it - // ----- - if ( $cnx !== false ) { - // Create the db - if (is_writable(NOALYSS_INCLUDE)) { - $url=config_file_create($_POST,1,$os); - echo ' -
'. - _('Les informations sont sauvées vous pouvez continuer'). - ' -
'; - return; - } else { - echo '

'; - echo _('Fichier non sauvé'); - echo '

'; - echo '

'; - printf ( _('Créez ce fichier %s avec les informations suivantes '), - NOALYSS_INCLUDE.'/config.inc.php'); - echo '

'; - echo '

'; - print (_('Puis cliquez sur ce lien'))." "; - echo ''._('Installation').""; - echo '

'; - echo ''; - return; - } - } else { - echo '

'; - echo _('Impossible de se connecter à Postgresql, vérifiez les informations de connection'); - echo '

'; - } - } - - -//------------------------------------------------------------------------ -// Check that the file config.inc.php exists , if not then propose to -// enter information and exit -// -//------------------------------------------------------------------------ -if ( ! file_exists(NOALYSS_INCLUDE.'/config.inc.php')) { - echo '

'._('Entrez les informations nécessaires à noalyss').'

'; - echo '
'; - require_once NOALYSS_INCLUDE.'/lib/config_file.php'; - - echo config_file_form(); - echo '
'; - echo '

', - HtmlInput::submit('save_config',_('Continuer'),"","button"), - '

'; - echo ""; - echo '
'; - exit(); -} - -//---------------------------------------------------------------------- -// End functions -// -//---------------------------------------------------------------------- - -// Verify some PHP parameters -// magic_quotes_gpc = Off -// magic_quotes_runtime = Off -// magic_quotes_sybase = Off -// include_path -require_once NOALYSS_INCLUDE.'/lib/config_file.php'; -require_once NOALYSS_INCLUDE.'/lib/class_database.php'; - -// we shouldn't use it -// if ( defined ("MULTI") && MULTI==1) { create_htaccess();} - -echo '

'._('Configuration').'

'; -?> -

Info

- -

PHP

-"; -foreach (array('magic_quotes_gpc','magic_quotes_runtime') as $a) { -echo "
  • "; - if ( ini_get($a) == false ) print $a.': '.$succeed; - else { - print $a.': '.$failed; - print ("

    $a "._('a une mauvaise valeur')." !

    "); - $flag_php++; - } - -echo "
  • "; -} -$module=get_loaded_extensions(); - -echo "
  • "; -$str_error_message=_('Vous devez installer ou activer l\'extension').' %s '; -if ( in_array('mbstring',$module) == false ){ - echo 'module mbstring '.$failed; - echo '', - sprintf($str_error_message, "mbstring"), - ' '; - $flag_php++; -} else echo 'module mbstring '.$succeed; -echo "
  • "; - -echo "
  • "; -if ( in_array('pgsql',$module) == false ) -{ - echo 'module PGSQL '.$failed; - echo '', - sprintf($str_error_message, "psql"), - ' '; - $flag_php++; -} else echo 'module PGSQL '.$succeed; -echo "
  • "; - -echo "
  • "; -if ( in_array('bcmath',$module) == false ) -{ - echo 'module BCMATH ok '.$failed; - echo '', - sprintf($str_error_message, "bcmath"), - ' '; - $flag_php++; -} else echo 'module BCMATH '.$succeed; -echo "
  • "; - -echo "
  • "; -if (in_array('gettext',$module) == false ) -{ - echo 'module GETTEXT '.$failed; - echo '', - sprintf($str_error_message, "gettext"), - ' '; - $flag_php++; -} else echo 'module GETTEXT '.$succeed; -echo "
  • "; - -echo "
  • "; -if ( in_array('zip',$module) == false ) -{ - echo 'module ZIP '.$failed; - echo '', - sprintf($str_error_message, "zip"), - ' '; - $flag_php++; -} else echo 'module ZIP '.$succeed; -echo "
  • "; -echo "
  • "; -if ( in_array('gd',$module) == false ) -{ - echo 'module GD '.$failed; - echo '', - sprintf($str_error_message, "gd"), - ' '; - $flag_php++; -} else echo 'module GD '.$succeed; -echo "
  • "; - -if ( ini_get("max_execution_time") < 60 ) { - echo "
  • "; - echo _('Avertissement').' : '.$failed; - echo ' ', - _("max_execution_time devrait être de 60 minimum"), - ''; - echo "
  • "; -} - -if ( ini_get("register_globals") == true) { - echo "
  • "; - echo _('Avertissement').' : '.$failed; - print ' '._('register_globals doit être à off').''; - echo "
  • "; - $flag_php++; -} - -if ( ini_get("session.use_trans_sid") == false ) { - echo "
  • "; - echo _('Avertissement').' : '.$failed; - print ' avertissement session.use_trans_sid should be set to true '; - echo "
  • "; -} - -echo ""; - - echo ""; -if ( $flag_php==0 ) { - echo '

    '._('php.ini est bien configuré ').$succeed.'

    '; -} else { - echo '

    '._('php mal configuré ').$failed.'

    '; -} -/* check user */ -if ( (defined("MULTI") && MULTI==1)|| !defined("MULTI")) -{ - - $cn=new Database(-1,'template'); -} else -{ - $cn=new Database(); -} - -?> -

    -get_value($sql); - -echo _("Version base de données :"),$version; - -if ( $version[0] < 8 || - ($version[0]=='8' && $version[2]<4) - ) - { -?> -

    -

    - -

    -count_sql($sql); -if ( $Res==0) { ?> -

    -

    -

    - -exec_sql($sql); -$flag=0; -for ($e=0;$e<$cn->size();$e++) { - $a=$cn->fetch($e); - switch ($a['name']){ - case 'effective_cache_size': - if ( $a['setting'] < 1000 ){ - - printf ('

    '.$failed._('Attention le paramètre effective_cache_size est de %s'. - " au lieu de 1000")."

    ",$a['setting']); - $flag++; - } - break; - case 'shared_buffers': - if ( $a['setting'] < 640 ){ - print '

    '.$failed; - printf('Attention le paramètre shared_buffer est de %s - au lieu de 640',$a['setting']); - print "

    "; - $flag++; - } - break; - } - } -if ( $flag == 0 ) { - echo '

    '._('La base de données est bien configurée ').$succeed.'

    '; - } else { - echo '

    '.$failed; - printf (_('Il y a %s paramètre qui sont trop bas'),$flag); - echo '

    '; - } -if ( ! isset($_POST['go']) ) { -?> - -
    -"> -
    -
    -count_sql("select * from pg_database where datname=lower('" . domaine . "account_repository')"); -else - $account=1; - -// Create the account_repository -if ($account == 0 ) { - - echo "Creation of ".domaine."account_repository"; - if ( ! DEBUG) ob_start(); - $cn->exec_sql("create database ".domaine."account_repository encoding='utf8'"); - $cn=new Database(); - $cn->start(); - $cn->execute_script(NOALYSS_INCLUDE."/sql/account_repository/schema.sql"); - $cn->execute_script(NOALYSS_INCLUDE."/sql/account_repository/data.sql"); - $cn->execute_script(NOALYSS_INCLUDE."/sql/account_repository/constraint.sql"); - $cn->commit($cn); - - if ( ! DEBUG) ob_end_clean(); - - echo _("Creation of Modele 1"); - if ( ! DEBUG) ob_start(); - $cn->exec_sql("create database ".domaine."mod1 encoding='utf8'"); - - $cn=new Database(1,'mod'); - $cn->start(); - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql'); - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/data.sql'); - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql'); - $cn->commit(); - - if ( ! DEBUG) ob_end_clean(); - - echo _("Creation of Modele 2"); - $cn->exec_sql("create database ".domaine."mod2 encoding='utf8'"); - $cn=new Database(2,'mod'); - $cn->start(); - if ( ! DEBUG) { ob_start(); } - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql'); - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod2/data.sql'); - $cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql'); - $cn->commit(); - - if ( ! DEBUG) ob_end_clean(); - - }// end if -// Add a french accountancy model -//-- -$cn=new Database(); - -echo "

    "._('Mise à jour du systeme')."

    "; -echo "

    "._("Mise à jour dossier")."

    "; -if (defined("MULTI") && MULTI == 0) -{ - $db = new Database(); - if ($db->exist_table("version") == false) - { - echo '

    ' . $failed ; - printf (_('La base de donnée %s est vide, veuillez executer noalyss/contrib/mono-dossier/mono.sql - puis faites un seul de ces choix : '),dbname); - echo '

    -

    "; - exit(); - } - echo "

    Patching " . dbname . '

    '; - $db->apply_patch(dbname); - echo "

    "._("Tout est installé"). $succeed; - - echo "

    "._("Mise à jour Repository")."

    "; - if ( DEBUG == false ) ob_start(); - $MaxVersion=DBVERSIONREPO-1; - for ($i=4;$i<= $MaxVersion;$i++) - { - if ( $db->get_value (' select val from repo_version') <= $i ) { - $db->execute_script(NOALYSS_INCLUDE.'/sql/patch/ac-upgrade'.$i.'.sql'); - } - } - echo "

    "; - printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__); - echo "

    "; - ?> -

    - -

    - "; -printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__); -echo ""; - - echo "

    "._("Tout est installé")." ". $succeed; -?> -

    -

    - -

    \ No newline at end of file diff --git a/include/ajax/ajax_admin.php b/include/ajax/ajax_admin.php index ff4e9890c..4668de52e 100644 --- a/include/ajax/ajax_admin.php +++ b/include/ajax/ajax_admin.php @@ -24,8 +24,8 @@ if (!defined('ALLOWED')) /** * @file * @brief the file contents the code which answer to ajax call from - * admin_repo.php - * @see admin_repo.php ajax_misc.php admin.js + * admin-noalyss.php + * @see admin-noalyss.php ajax_misc.php admin.js */ if ($g_user->Admin()==0) { @@ -194,7 +194,7 @@ if (in_array($op, array('modele_drop', 'modele_modify', 'folder_modify', 'folder $dos->load(); echo HtmlInput::title_box(_('Modification'), 'folder_admin_div'); $wText=new IText(); - echo '
    '; + echo ''; echo HtmlInput::hidden('action', 'dossier_mgt'); echo HtmlInput::hidden('d', $dos->get_parameter("id")); echo _('Nom').' : '; @@ -217,7 +217,7 @@ if (in_array($op, array('modele_drop', 'modele_modify', 'folder_modify', 'folder ob_start(); echo HtmlInput::title_box(_('Efface'), 'folder_admin_div'); $dos->load(); - echo ''; + echo ''; echo HtmlInput::hidden('action', 'dossier_mgt'); echo HtmlInput::hidden('d', $dossier); echo HtmlInput::hidden('sa', 'remove'); @@ -242,7 +242,7 @@ if (in_array($op, array('modele_drop', 'modele_modify', 'folder_modify', 'folder $name=$cn->get_value('select mod_name from modeledef where mod_id=$1', array($dossier)); ob_start(); echo HtmlInput::title_box(_('Efface'), 'folder_admin_div'); - echo ''; + echo ''; echo HtmlInput::hidden('m', $dossier); echo HtmlInput::hidden('sa', 'remove'); echo HtmlInput::hidden('action', 'modele_mgt'); diff --git a/include/dossier.inc.php b/include/dossier.inc.php index ec3a31cad..f4e6a193d 100644 --- a/include/dossier.inc.php +++ b/include/dossier.inc.php @@ -81,7 +81,7 @@ if ( isset ($_POST["DATABASE"]) ) echo ''; echo _('le modele ').domaine.'mod'.$_POST["FMOD_ID"]._(" doit être migré en unicode."); echo _('Pour le passer en unicode, faites-en un backup puis restaurez le fichier reçu').''; - echo HtmlInput::button_anchor('Retour','admin_repo.php?action=dossier_mgt'); + echo HtmlInput::button_anchor('Retour','admin-noalyss.php?action=dossier_mgt'); return; } } @@ -324,7 +324,7 @@ if ( $sa == 'list' ) - +
    "; echo ' '._("Pour le passer en unicode, faites-en un backup puis restaurez le fichier reçu").''; - echo HtmlInput::button_anchor(_('Retour'), 'admin_repo.php?action=dossier_mgt'); + echo HtmlInput::button_anchor(_('Retour'), 'admin-noalyss.php?action=dossier_mgt'); return; } @@ -324,7 +324,7 @@ if ($sa == 'list') $available.=''; }//if count !=0 ?> - + diff --git a/include/restore.inc.php b/include/restore.inc.php index 3cc071ba5..17a8dd8be 100644 --- a/include/restore.inc.php +++ b/include/restore.inc.php @@ -202,7 +202,7 @@ if ( isset ($_REQUEST['sa'] )) else { echo '
    '; - echo ''; + echo ''; echo HtmlInput::hidden('action','restore'); echo HtmlInput::hidden('sa','r'); echo '
    '; diff --git a/include/user.inc.php b/include/user.inc.php index 9915e7fdd..678e2d2db 100644 --- a/include/user.inc.php +++ b/include/user.inc.php @@ -22,7 +22,7 @@ if ( !defined ('ALLOWED')) die('Forbidden'); /*!\file * * - * \brief user managemnt, included from admin_repo, + * \brief user managemnt, included from admin-noalyss, * action=user_mgt * */ @@ -72,7 +72,7 @@ if ( isset($_REQUEST['det']))