Example #1
0
 /**
  *connect to folder and give to admin. the profile Admin(builtin)
  * @param int $p_id dossier::id()
  */
 static function synchro_admin($p_id)
 {
     // connect to target
     $cn = new Database($p_id);
     if (!$cn->exist_table("profile_menu")) {
         echo_warning("Dossier invalide");
         return;
     }
     // connect to repo
     $repo = new Database();
     $a_admin = $repo->get_array("select use_login from ac_users where\n\t\t\tuse_admin=1 and use_active=1");
     try {
         /**
          * synchro global
          */
         $cn->start();
         for ($i = 0; $i < count($a_admin); $i++) {
             $exist = $cn->get_value("select p_id from profile_user\n\t\t\t\t\twhere user_name=\$1", array($a_admin[$i]['use_login']));
             if ($exist == "") {
                 $cn->exec_sql("insert into profile_user(user_name,p_id) values(\$1,1)", array($a_admin[$i]['use_login']));
             }
         }
         $cn->commit();
     } catch (Exception $e) {
         echo_warning($e->getMessage());
         $cn->rollback();
     }
 }
Example #2
0
      <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
      <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>{$nav}</div>
      <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>{$nav2}.</div>
      </div>
      <div style='width: 75px; float: left;'><a href='http://fr.www.mozilla.com/fr/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div>
      <div style='width: 73px; float: left;'><a href='http://www.apple.com/fr/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div>
      <div style='float: left;'><a href='http://www.google.com/chrome?hl=fr' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div>
      </div>
      </div>
      <![endif]-->
EOF;
    exit;
}
$ac = new Database();
/* check if repo valid */
if ($ac->exist_table('version') == false) {
    echo '<h2 class="error" style="font-size:12px">' . _("Base de donnée invalide") . '</h2>';
    $base = dirname($_SERVER['REQUEST_URI']);
    exit;
}
/* check repo version */
$version = $ac->get_value('select val from version');
if ($version < DBVERSIONREPO) {
    echo '<h2 class="error" style="font-size:12px">' . _("Votre base de données n'est pas à jour") . '   ';
    $a = _("cliquez ici pour appliquer le patch");
    $base = dirname($_SERVER['REQUEST_URI']);
    if ($base == '/') {
        $base = '';
    }
    $base .= '/admin/setup.php';
    echo '<a hreF="' . $base . '">' . $a . '</a></h2>';
Example #3
0
        if ( visible == 'none') { new_state='block';}
        else 
            console.log('erreur');
        document.getElementById('debug_div').style.display=new_state;
    }
</script>
<input type="button" class="tinybutton" style="position:absolute;display:fixed;top:40px;left:50px;margin-left:50px;z-index:1000" value="show request" onclick="show_debug_request()">

<?php 
}
global $g_user, $cn, $g_parameter;
$cn = new Database(Dossier::id());
/*
 * check that the database is not empty
 */
if (!$cn->exist_table('version')) {
    echo '<h2 class="notice">' . _('Désolé') . '</h2>';
    echo _('Ce dossier est vide');
    echo '<p>';
    echo '<a class="button" href="do.php">' . _("Retour à l'accueil") . '</a>';
    echo '</p>';
    return;
}
$g_user = new User($cn);
$g_parameter = new Own($cn);
load_all_script();
/*  Check Browser version if < IE6 then unsupported */
$browser = $_SERVER['HTTP_USER_AGENT'];
if (strpos($browser, 'MSIE 6') != false || strpos($browser, 'MSIE 5') != false) {
    echo <<<EOF
    <!--[if lt IE 7]>
Example #4
0
     $sql = "insert into modeledef (mod_id,mod_name,mod_desc) values (" . $id . ",'Restauration" . $lname . "','" . $ldesc . "') ";
     $cn->start();
     try {
         $cn->get_value($sql);
     } catch (Exception $e) {
         echo '<span class="error">' . _("Echec de la restauration ") . '</span>';
         $cn->rollback();
         exit;
     }
     $cn->commit();
     $name = domaine . "mod" . $id;
     $cn->exec_sql("create database " . $name . " encoding='utf8'");
     $args = "   -d {$name} " . $_FILES['file']['tmp_name'];
     $status = exec(PG_RESTORE . $args);
     $test = new Database($id, 'mod');
     if ($test->exist_table('version')) {
         echo '<h2 class="info"> ' . _('Restauration réussie du dossier ') . $lname . '</h2>';
         $test->close();
     } else {
         $test->close();
         echo '<h2 class="error"> ' . _('Problème lors de la restauration ') . $lname . '</h2>';
         $cn->exec_sql('delete from modeledef where mod_id=$1', array($id));
         $cn->exec_sql('drop database ' . $name);
         exit;
     }
     $new_cn = new Database($id, 'mod');
     $new_cn->apply_patch($name, 0);
     echo '<span class="error">' . _('Ne pas recharger la page, sinon votre base de données sera restaurée une fois de plus') . '</span>';
     echo $retour;
     echo '</div>';
 }
Example #5
0
    $cn->execute_script('sql/mod2/data.sql');
    $cn->execute_script('sql/mod1/constraint.sql');
    $cn->commit();
    if (!DEBUG) {
        ob_end_clean();
    }
}
// end if
// Add a french accountancy model
//--
$cn = new Database();
echo "<h1>Mise a jour du systeme</h1>";
echo "<h2 > Mise &agrave; jour dossier</h2>";
if (defined("MULTI") && MULTI == 0) {
    $db = new Database();
    if ($db->exist_table("version") == false) {
        echo '<p class="warning">' . $failed . 'La base de donnée ' . dbname . ' est vide, veuillez executer noalyss/contrib/mono-dossier/mono.sql
                    puis faites un seul de ces choix : 
                    <ul>
                    <li>soit noalyss/contrib/mono-dossier/mono-france.sql pour la comptabilité française</li>
                    <li>soit noalyss/contrib/mono-dossier/mono-belge.sql pour la comptabilité belge</li>
                    <li>soit y restaurer un backup ou un modèle</li>
                    </ul>
				</p>';
        exit;
    }
    echo "<h3>Patching " . dbname . '</h3>';
    $db->apply_patch(dbname);
    echo "<p class=\"info\">Tout est install&eacute; {$succeed}";
    echo "<h2>Mise &agrave; jour Repository</h2>";
    if (DEBUG == false) {