Last bugs

This commit is contained in:
Dany De Bontridder 2013-05-17 22:25:03 +00:00
parent 49a97dee91
commit 7c8a510d3f
7 changed files with 48 additions and 33 deletions

View file

@ -51,21 +51,22 @@ $failed="<span style=\"font-size:18px;color:red\">&#x2716;</span>";
$succeed="<span style=\"font-size:18px;color:green\">&#x2713;</span>";
$inc_path=get_include_path();
global $os;
/**
*@brief create correctly the htaccess file
*/
function create_htaccess()
{
$inc_path=get_include_path();
$inc_path=get_include_path();
global $os;
if ( strpos($inc_path,";") != 0 ) {
$new_path=$inc_path.';..\..\include;addon';
$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
@ -100,7 +101,7 @@ function create_htaccess()
"php_flag session.use_only_cookies on");
if ( $os == 0 )
fwrite($hFile,'php_value include_path .;..\..\include;..\include;addon'."\n");
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");
@ -340,7 +341,7 @@ if ( ! isset($_POST['go']) ) {
if ( ! isset($_POST['go']) )
exit();
// Check if account_repository exists
if ( defined("MULTI") && MULTI== 0)
if (!defined("MULTI") || (defined("MULTI") && MULTI == 1))
$account = $cn->count_sql("select * from pg_database where datname=lower('" . domaine . "account_repository')");
else
$account=1;
@ -392,7 +393,7 @@ $cn=new Database();
echo "<h1>Mise a jour du systeme</h1>";
echo "<h2 > Mise &agrave; jour dossier</h2>";
if (defined("MULTI") && MULTI == 0)
if (defined("MULTI") && MULTI == 0)
{
$db = new Database();
if ($db->exist_table("version") == false)

View file

@ -0,0 +1,11 @@
begin;
update attr_def set ad_text='Compte bancaire' where ad_id=3;
ALTER TABLE mod_payment DROP CONSTRAINT mod_payment_mp_fd_id_fkey ;
ALTER TABLE mod_payment ADD CONSTRAINT mod_payment_mp_fd_id_fkey FOREIGN KEY (mp_fd_id) REFERENCES fiche_def (fd_id) MATCH SIMPLE ON UPDATE cascade ON DELETE cascade;
ALTER TABLE mod_payment DROP CONSTRAINT mod_payment_mp_jrn_def_id_fkey ;
ALTER TABLE mod_payment ADD CONSTRAINT mod_payment_mp_jrn_def_id_fkey FOREIGN KEY (mp_jrn_def_id) REFERENCES jrn_def (jrn_def_id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;
update version set val=107;
commit;

View file

@ -104,7 +104,7 @@ echo '<div class="welcome"> ';
* folder if he's an "plugin user"
*/
if ( $User->admin == 0 || (defined("MULTI")&&MULTI==0))
if ( $User->admin == 0 )
{
// how many folder ?
$folder=$User->get_available_folder();

View file

@ -105,7 +105,7 @@ function config_file_form($p_array=null)
}
/*!\brief create the config file
*/
function config_file_create($p_array,$from_setup=1,$os=1)
function config_file_create($p_array,$from_setup=1,$p_os=1)
{
extract ($p_array);
$add=($from_setup==1)?'..'.DIRECTORY_SEPARATOR:'';
@ -118,7 +118,7 @@ function config_file_create($p_array,$from_setup=1,$os=1)
fputs($hFile,"\r\n");
fputs($hFile, 'define("PG_PATH","'.$cpath.'");');
fputs($hFile,"\r\n");
if ( $os == 1 )
if ( $p_os == 1 )
{
fputs($hFile, 'define("PG_RESTORE","'.$cpath.DIRECTORY_SEPARATOR.'pg_restore ");');
fputs($hFile,"\r\n");

View file

@ -41,17 +41,15 @@ if ( strpos($inc_path,";") != 0 ) {
$os=1; /* $os is 1 for unix */
}
set_include_path($new_path);
if ( defined("MULTI") && MULTI==0 ) {
ini_set ('session.use_cookies',1);
ini_set ('session.use_only_cookies','on');
ini_set ('session.use_trans_sid','on');
ini_set ('magic_quotes_gpc','off');
ini_set ('max_execution_time',240);
ini_set ('memory_limit','20M');
ini_set ('post_max_size','20M');
ini_set ('upload_max_filesize','20M');
ini_set ('session.use_cookies',1);
ini_set ('session.use_only_cookies','on');
ini_set ('magic_quotes_gpc','off');
ini_set ('max_execution_time',240);
ini_set ('memory_limit','20M');
ini_set ('default_charset',"UTF-8");
@ini_set ('session.use_trans_sid','on');
@session_start();
}
/*
* Ini session
*/
@ -64,9 +62,9 @@ $g_failed="<span style=\"font-size:18px;color:red\">&#x2716;</span>";
$g_succeed="<span style=\"font-size:18px;color:green\">&#x2713;</span>";
/*set to none for production */
/* uncomment for production */
define ('SVNINFO',5900);
//define ('SVNINFO',5900);
$version_phpcompta=SVNINFO;
define ("DEBUG",true);
define ("DEBUG",false);
/* define ('SVNINFO',5015);
* $version_phpcompta=SVNINFO;
* define ("DEBUG",true);
@ -77,7 +75,7 @@ define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');
define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/plugin_last_version.txt');
define ("DBVERSION",106);
define ("DBVERSION",107);
define ("DBVERSIONREPO",14);
define ('NOTFOUND','--not found--');

View file

@ -106,14 +106,24 @@ function MenuAdmin()
break;
}
}
$item=array (array("admin_repo.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0),
if (!defined("MULTI")||(defined("MULTI")&&MULTI==1))
{
$item=array (array("admin_repo.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0),
array("admin_repo.php?action=dossier_mgt",_("Dossiers"),_('Gestion des dossiers'),1),
array("admin_repo.php?action=modele_mgt",_("Modèles"),_('Gestion des modèles'),2),
array("admin_repo.php?action=restore",_("Restaure"),_("Restaure une base de données"),3),
array("admin_repo.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
array("login.php",_("Accueil"))
);
}
else
{
$item=array (array("admin_repo.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0),
array("admin_repo.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
array("login.php",_("Accueil"))
);
}
$menu=ShowItem($item,'H',"mtitle","mtitle",$def,' style="width:80%;margin-left:10%" ');
return $menu;
}

View file

@ -1,5 +0,0 @@
update attr_def set ad_text='Compte bancaire' where ad_id=3;
ALTER TABLE mod_payment DROP CONSTRAINT mod_payment_mp_fd_id_fkey ;
ALTER TABLE mod_payment ADD CONSTRAINT mod_payment_mp_fd_id_fkey FOREIGN KEY (mp_fd_id) REFERENCES fiche_def (fd_id) MATCH SIMPLE ON UPDATE cascade ON DELETE cascade;
ALTER TABLE mod_payment DROP CONSTRAINT mod_payment_mp_jrn_def_id_fkey ;
ALTER TABLE mod_payment ADD CONSTRAINT mod_payment_mp_jrn_def_id_fkey FOREIGN KEY (mp_jrn_def_id) REFERENCES jrn_def (jrn_def_id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;