A l'installation permet de choisir le nom de l'administrateur, dans
les versions précédentes c'était phpcompta
This commit is contained in:
parent
2a06df770e
commit
30f84ace56
8 changed files with 78 additions and 34 deletions
|
|
@ -216,6 +216,8 @@ $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", "");
|
||||
$cadmin=HtmlInput::default_value_request("cadmin", "phpcompta");
|
||||
$cadmin=strtolower($cadmin);
|
||||
//-------------------------------------------------------------------------
|
||||
// warn only if we can not write in include
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -244,6 +246,9 @@ if (isset($_POST['save_config'])) {
|
|||
// If conx successfull save the file or display it
|
||||
// -----
|
||||
if ( $cnx !== false ) {
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',$cadmin,'</p>';
|
||||
echo '<p>',_('Mot de passe'),' phpcompta','</p>';
|
||||
// Create the db
|
||||
if (is_writable(NOALYSS_INCLUDE)) {
|
||||
$url=config_file_create($_POST,1,$os);
|
||||
|
|
@ -265,6 +270,7 @@ if (isset($_POST['save_config'])) {
|
|||
print (_('Puis cliquez sur ce lien'))." ";
|
||||
echo '<a href="install.php?lang='.$_GET['lang'].'">'._('Installation')."</a>";
|
||||
echo '</p>';
|
||||
|
||||
echo '<textarea cols="80" rows="50" style="height:auto">';
|
||||
echo display_file_config($_POST,1,$os);
|
||||
echo '</textarea>';
|
||||
|
|
@ -551,6 +557,11 @@ if ($account == 0 ) {
|
|||
$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");
|
||||
/* update name administrator */
|
||||
$cadmin=NOALYSS_ADMINISTRATOR;
|
||||
$cn->exec_sql("update ac_users set use_login=$1 where use_id=1",
|
||||
array(strtolower($cadmin)));
|
||||
|
||||
$cn->commit($cn);
|
||||
|
||||
if ( ! DEBUG) ob_end_clean();
|
||||
|
|
@ -579,7 +590,9 @@ if ($account == 0 ) {
|
|||
$cn->commit();
|
||||
|
||||
if ( ! DEBUG) ob_end_clean();
|
||||
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',$cadmin,'</p>';
|
||||
echo '<p>',_('Mot de passe'),' phpcompta','</p>';
|
||||
}// end if
|
||||
// Add a french accountancy model
|
||||
//--
|
||||
|
|
@ -597,8 +610,15 @@ if (defined("MULTI") && MULTI == 0)
|
|||
{
|
||||
if ( ! DEBUG) { ob_start(); }
|
||||
$db->execute_script(NOALYSS_INCLUDE.'/sql/mono/mono.sql');
|
||||
|
||||
if ( ! DEBUG) ob_end_clean();
|
||||
}
|
||||
/* update name administrator */
|
||||
if ( isset ($_REQUEST['cadmin'])) {
|
||||
$db->exec_sql("update ac_users set use_login=$1 where use_id=1",
|
||||
array($cadmin));
|
||||
}
|
||||
|
||||
if ($db->exist_table("version") == false)
|
||||
{
|
||||
echo '<p class="warning">' . $failed ;
|
||||
|
|
@ -627,6 +647,9 @@ if (defined("MULTI") && MULTI == 0)
|
|||
$db->execute_script(NOALYSS_INCLUDE.'/sql/patch/ac-upgrade'.$i.'.sql');
|
||||
}
|
||||
}
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',$cadmin,'</p>';
|
||||
echo '<p>',_('Mot de passe'),' phpcompta','</p>';
|
||||
echo "<h2 class=\"warning\">";
|
||||
printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__);
|
||||
echo "</h2>";
|
||||
|
|
@ -644,7 +667,12 @@ if (defined("MULTI") && MULTI == 0)
|
|||
define ('ALLOWED',1);
|
||||
$_GET['sb']="upg_all";
|
||||
$rep=new Database();
|
||||
$rep->exec_sql("update ac_users set use_login=$1 where use_id=1",
|
||||
array(strtolower(NOALYSS_ADMINISTRATOR)));
|
||||
require NOALYSS_INCLUDE."/upgrade.inc.php";
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',NOALYSS_ADMINISTRATOR,'</p>';
|
||||
|
||||
echo "<h2 class=\"warning\">";
|
||||
printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__);
|
||||
echo "</h2>";
|
||||
|
|
|
|||
|
|
@ -3245,7 +3245,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
echo Acc_Reconciliation::$javascript;
|
||||
html_page_start();
|
||||
$cn = Dossier::connect();
|
||||
$_SESSION['g_user'] = 'phpcompta';
|
||||
$_SESSION['g_user'] = NOALYSS_ADMINISTRATOR ;
|
||||
$_SESSION['g_pass'] = 'phpcompta';
|
||||
|
||||
$id = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1;
|
||||
|
|
@ -3335,7 +3335,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
html_page_start();
|
||||
$cn = Dossier::connect();
|
||||
$ledger = new Acc_Ledger($cn, 0);
|
||||
$_SESSION['g_user'] = 'phpcompta';
|
||||
$_SESSION['g_user'] = NOALYSS_ADMINISTRATOR;
|
||||
$_SESSION['g_pass'] = 'phpcompta';
|
||||
echo $ledger->search_form('ALL');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -576,7 +576,7 @@ class Acc_Operation
|
|||
}
|
||||
static function test_me()
|
||||
{
|
||||
$_SESSION['g_user']='phpcompta';
|
||||
$_SESSION['g_user']=NOALYSS_ADMINISTRATOR;
|
||||
$_SESSION['g_pass']='dany';
|
||||
global $g_user;
|
||||
$cn=Dossier::connect();
|
||||
|
|
|
|||
|
|
@ -151,11 +151,11 @@ class Dossier
|
|||
join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
|
||||
group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
|
||||
where
|
||||
use_login!='phpcompta'
|
||||
use_login!=$1
|
||||
$sql
|
||||
";
|
||||
|
||||
$res=$this->cn->get_array($sql);
|
||||
$res=$this->cn->get_array($sql,array(NOALYSS_ADMINISTRATOR));
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ class User
|
|||
function Admin()
|
||||
{
|
||||
$this->admin = 0;
|
||||
if ($this->login != 'phpcompta')
|
||||
if ($this->login != NOALYSS_ADMINISTRATOR )
|
||||
{
|
||||
$pass5 = md5($this->pass);
|
||||
$sql = "select use_admin from ac_users where use_login=$1
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ if ( !defined("NOALYSS_TEMPLATE")) define ("NOALYSS_TEMPLATE",$g_template_dir);
|
|||
// with convert
|
||||
if ( !defined("FIX_BROKEN_PDF")) define ("FIX_BROKEN_PDF",'NO');
|
||||
|
||||
if ( !defined('NOALYSS_ADMINISTRATOR')) {
|
||||
define ('NOALYSS_ADMINISTRATOR','phpcompta');
|
||||
}
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/constant.security.php';
|
||||
|
||||
if ( strpos($inc_path,";") != 0 ) {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ function config_file_form($p_array=null)
|
|||
$multi="N";
|
||||
$cdbname="";
|
||||
$chost="localhost";
|
||||
$cadmin='admin';
|
||||
|
||||
}
|
||||
else extract ($p_array);
|
||||
|
|
@ -77,32 +78,34 @@ function config_file_form($p_array=null)
|
|||
$ictmp->size=25;
|
||||
|
||||
$iclocale=new ISelect('clocale');
|
||||
$iclocale->value=array(
|
||||
array("value"=>1,"label"=>"Activé"),
|
||||
array("value"=>0,"label"=>"Désactivé")
|
||||
);
|
||||
$iclocale->selected=1;
|
||||
$iclocale->value=array(
|
||||
array("value"=>1,"label"=>"Activé"),
|
||||
array("value"=>0,"label"=>"Désactivé")
|
||||
);
|
||||
$iclocale->selected=1;
|
||||
|
||||
$icpath=new IText("cpath",$cpath);
|
||||
$icpath->size=30;
|
||||
$icpath=new IText("cpath",$cpath);
|
||||
$icpath->size=30;
|
||||
|
||||
$icuser=new IText('cuser',$cuser);
|
||||
$icpasswd=new IText('cpasswd',$cpasswd);
|
||||
$icport=new IText("cport",$cport);
|
||||
$ichost=new IText("chost",$chost);
|
||||
|
||||
$icadmin=new IText('cadmin',$cadmin);
|
||||
/*
|
||||
* For version MONO
|
||||
*/
|
||||
$smulti=new ICheckBox('multi');
|
||||
$smulti->javascript=' onchange="show_dbname(this)" ';
|
||||
$smulti->value = 'Y';
|
||||
if ( $multi == 'Y') {
|
||||
$smulti->selected=true;
|
||||
|
||||
$icuser=new IText('cuser',$cuser);
|
||||
$icpasswd=new IText('cpasswd',$cpasswd);
|
||||
$icport=new IText("cport",$cport);
|
||||
$ichost=new IText("chost",$chost);
|
||||
/*
|
||||
* For version MONO
|
||||
*/
|
||||
$smulti=new ICheckBox('multi');
|
||||
$smulti->javascript=' onchange="show_dbname(this)" ';
|
||||
$smulti->value = 'Y';
|
||||
if ( $multi == 'Y') {
|
||||
$smulti->selected=true;
|
||||
|
||||
}
|
||||
$icdbname=new IText('cdbname');
|
||||
$icdbname->value=$cdbname;
|
||||
require NOALYSS_TEMPLATE.'/template_config_form.php';
|
||||
}
|
||||
$icdbname=new IText('cdbname');
|
||||
$icdbname->value=$cdbname;
|
||||
require NOALYSS_TEMPLATE.'/template_config_form.php';
|
||||
}
|
||||
/**
|
||||
* Display the content of the config.inc.php with variables
|
||||
|
|
@ -146,7 +149,9 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
|
|||
print ("\r\n");
|
||||
print ( 'define ("noalyss_psql_host","'.$chost.'");');
|
||||
print ("\r\n");
|
||||
|
||||
print ( 'define ("NOALYSS_ADMINISTRATOR","'.$cadmin.'");');
|
||||
print ("\r\n");
|
||||
|
||||
print ( 'define ("LOCALE",'.$clocale.');');
|
||||
print ("\r\n");
|
||||
|
||||
|
|
@ -187,12 +192,11 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
|
|||
print ( '// define ("NOALYSS_INCLUDE","");');
|
||||
print ("\r\n");
|
||||
print ( '// define ("NOALYSS_TEMPLATE","");');
|
||||
print ("\r\n");
|
||||
print ( "// Fix an issue with PDF when exporting receipt in PDF in ANCGL"."\r\n");
|
||||
print ( '// define ("FIX_BROKEN_PDF","NO");');
|
||||
print ("\r\n");
|
||||
print ("\r\n");
|
||||
print ("\r\n");
|
||||
print ("\r\n");
|
||||
print ( "// Uncomment if you don't want "."\r\n");
|
||||
print ( "// to be informed when a new release is "."\r\n");
|
||||
print ( "// published"."\r\n");
|
||||
|
|
|
|||
|
|
@ -51,6 +51,14 @@
|
|||
<TD><?php echo _('Mot de passe de l\'utilisateur Postgresql');?> </TD>
|
||||
<TD><?php echo $icpasswd->input();echo HtmlInput::infobulle(204)?></TD>
|
||||
</TR>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo _('Administrateur de noalyss')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $icadmin->input();?>
|
||||
</td>
|
||||
</tr>
|
||||
<TR>
|
||||
<TD><?php echo _('Adresse Serveur Postgresql');?> </TD>
|
||||
<TD><?php echo $ichost->input();echo HtmlInput::infobulle(208)?></TD>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue