Restructure file , remove html/admin/sql , backup ...

This commit is contained in:
Dany De Bontridder 2015-10-19 00:38:04 +02:00
parent 896f3624c7
commit db9835387b
7 changed files with 58 additions and 59 deletions

View file

@ -466,7 +466,7 @@ if ( $flag == 0 ) {
if ( ! isset($_POST['go']) ) {
?>
<span style="text-align: center">
<FORM METHOD="post" action="setup.php?lang=<?php echo $_GET['lang']?>">
<FORM METHOD="post" action="admin-noalyss.php?lang=<?php echo $_GET['lang']?>">
<input type="submit" class="button" name="go" value="<?php echo _("Commencer la mise à jour ou l'installation");?>">
</form>
</span>
@ -618,7 +618,7 @@ for ($e=0;$e < $MaxDossier;$e++) {
//----------------------------------------------------------------------
// Upgrade the account_repository
//----------------------------------------------------------------------
echo "<h2>"._("Mise à Repository")."</h2>";
echo "<h2>"._("Mise à jour de la base de données Paramètrage")."</h2>";
$cn=new Database();
if ( DEBUG == false ) ob_start();
$MaxVersion=DBVERSIONREPO-1;

View file

@ -146,7 +146,7 @@ if (DBVERSION > dossier::get_version($cn))
$a = _("cliquez ici pour appliquer le patch");
$base = dirname($_SERVER['REQUEST_URI']);
if ($base == '/') { $base = ''; }
$base .= '/admin/setup.php';
$base .= '/admin-noalyss.php';
echo '<a hreF="' . $base . '">' . $a . '</a></h2>';
}

View file

@ -134,7 +134,7 @@
if ( ! file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'config.inc.php'))
{
header("Location: admin/setup.php",true, 307);
header("Location: setup.php",true, 307);
exit(0);
}

View file

@ -51,7 +51,7 @@ if ( isset ($_POST["p_user"] ) )
if ($version != DBVERSIONREPO)
{
echo alert(_('Version de base de données incorrectes, vous devez mettre à jour'));
echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=admin/setup.php\">";
echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=admin-noalyss.php\">";
exit();
}
include_once NOALYSS_INCLUDE."/class/class_user.php";
@ -88,7 +88,7 @@ else
if ( $version != DBVERSIONREPO)
{
echo alert(_('Version de base de données incorrectes, vous devez mettre à jour'));
echo "<META HTTP-EQUIV=\"REFRESH\" content=\"1;url=admin/setup.php\">";
echo "<META HTTP-EQUIV=\"REFRESH\" content=\"1;url=admin-noalyss.php\">";
exit();
}

View file

@ -77,7 +77,7 @@ if ( $version < DBVERSIONREPO )
$a=_("cliquez ici pour appliquer le patch");
$base = dirname($_SERVER['REQUEST_URI']);
if ($base == '/') { $base = ''; }
$base .= '/admin/setup.php';
$base .= 'admin-noalyss.php';
echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
}
@ -152,7 +152,7 @@ $result.="<table border=\"0\">";
$result.='<TR>';
if ( $User->Admin() == 1 )
{
$result.="<TD class=\"tool\" ><A class=\"cell\" HREF=\"setup.php\">"._("Administration")." </A></TD>";
$result.="<TD class=\"tool\" ><A class=\"cell\" HREF=\"admin-noalyss.php\">"._("Administration")." </A></TD>";
}
$result.='<TD class="tool">';
$result.='<a onclick="set_preference(0)" title="Préférence" href="javascript:void(0)" class="cell">'._('Préférence').'</a>';

View file

@ -28,74 +28,75 @@ require_once NOALYSS_INCLUDE."/lib/user_common.php";
include_once NOALYSS_INCLUDE."/lib/ac_common.php";
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
require_once NOALYSS_INCLUDE."/lib/user_menu.php";
$action = HtmlInput::default_value_request("action", "");
$rep=new Database();
$User=new User($rep);
$User->Check();
html_page_start($User->theme);
if ($User->admin != 1)
{
html_page_start($User->theme);
echo "<h2 class=\"warning\">";
echo _("Vous n'êtes pas administateur");
echo "</h2>";
html_page_stop();
return;
}
// For a backup , we must avoid to send anything before the
// dump file
if ( $action== 'backup') {
/* take backup */
require_once NOALYSS_INCLUDE."/backup.inc.php";
exit();
}
html_page_start();
load_all_script();
echo '<H2 class="info"> '._('Administration').'</H2>';
echo '<div class="topmenu">';
echo MenuAdmin()."</div>";
define('ALLOWED',true);
?>
<DIV >
<?php
if ( isset ($_REQUEST["action"]) )
echo js_include("admin.js");
if ( $action=="user_mgt" )
{
echo js_include("admin.js");
if ( $_REQUEST["action"]=="user_mgt" )
{
//----------------------------------------------------------------------
// User management
//----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/user.inc.php";
}
// action=user_mgt
if ( $_REQUEST["action"]=="dossier_mgt")
{
//-----------------------------------------------------------------------
// action = dossier_mgt
//-----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/dossier.inc.php";
}
if ( $_REQUEST["action"] == "modele_mgt" )
{
//-----------------------------------------------------------------------
// Template Management
//-----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/modele.inc.php";
} // action is set
if ( $_REQUEST['action'] == 'restore')
{
// Backup and restaure folders
require_once NOALYSS_INCLUDE."/restore.inc.php";
}
if ($_REQUEST['action'] == 'audit_log')
{
/* List the connexion successuf and failed */
require_once NOALYSS_INCLUDE."/audit_log.php";
}
if ( $_REQUEST['action'] == 'backup') {
/* take backup */
require_once NOALYSS_INCLUDE."/backup.inc.php";
}
}// action = modele_mgt
//----------------------------------------------------------------------
// User management
//----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/user.inc.php";
}
// action=user_mgt
if ( $action=="dossier_mgt")
{
//-----------------------------------------------------------------------
// action = dossier_mgt
//-----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/dossier.inc.php";
}
if ( $action== "modele_mgt" )
{
//-----------------------------------------------------------------------
// Template Management
//-----------------------------------------------------------------------
require_once NOALYSS_INCLUDE."/modele.inc.php";
} // action is set
if ( $action== 'restore')
{
// Backup and restaure folders
require_once NOALYSS_INCLUDE."/restore.inc.php";
}
if ($action== 'audit_log')
{
/* List the connexion successuf and failed */
require_once NOALYSS_INCLUDE."/audit_log.php";
}
if ( $action == "logout") {
require_once 'logout.php';
}
?>
</DIV>
<?php

View file

@ -399,11 +399,10 @@ class Database
* \brief loop to apply all the path to a folder or
* a template
* \param $p_name database name
* \param $from_setup == 1 if called from setup.php
*
*/
function apply_patch($p_name, $from_setup=1)
function apply_patch($p_name)
{
if ( ! $this->exist_table('version')) {
echo _('Base de donnée vide');
@ -412,7 +411,6 @@ class Database
$MaxVersion=DBVERSION-1;
$succeed="<span style=\"font-size:18px;color:green\">&#x2713;</span>";
echo '<ul style="list-type-style:square">';
$add=($from_setup==0)?'admin/':'';
for ($i=4; $i<=$MaxVersion; $i++)
{
$to=$i+1;
@ -431,7 +429,7 @@ class Database
echo "<li>Patching ".$p_name.
" from the version ".$this->get_version()." to $to ";
$this->execute_script($add.'sql/patch/upgrade'.$i.'.sql');
$this->execute_script (NOALYSS_INCLUDE.'/sql/patch/upgrade'.$i.'.sql');
echo $succeed;
if (!DEBUG)
@ -467,7 +465,7 @@ class Database
// specific to version 17
if ($i==17)
{
$this->execute_script($add.'sql/patch/upgrade17.sql');
$this->execute_script(NOALYSS_INCLUDE.'/sql/patch/upgrade17.sql');
$max=$this->get_value('select last_value from s_jnt_fic_att_value');
$this->alter_seq($p_cn, 's_jnt_fic_att_value', $max+1);
} // version
@ -497,7 +495,7 @@ class Database
/* check the country and apply the path */
$res=$this->exec_sql("select pr_value from parameter where pr_id='MY_COUNTRY'");
$country=pg_fetch_result($res, 0, 0);
$this->execute_script($add."sql/patch/upgrade36.".$country.".sql");
$this->execute_script(NOALYSS_INCLUDE."/sql/patch/upgrade36.".$country.".sql");
$this->exec_sql('update tmp_pcmn set pcm_type=find_pcm_type(pcm_val)');
}
if ($i==59)
@ -512,7 +510,7 @@ class Database
if ($i==61)
{
$country=$this->get_value("select pr_value from parameter where pr_id='MY_COUNTRY'");
$this->execute_script($add."sql/patch/upgrade61.".$country.".sql");
$this->execute_script(NOALYSS_INCLUDE."/sql/patch/upgrade61.".$country.".sql");
}
if (!DEBUG)