function ShowMenuFiche($p_dossier) { $cn = new Database($p_dossier); $mod = "&ac=" . $_REQUEST['ac']; $str_dossier = dossier::get() . $mod; echo '<div class="lmenu">'; echo '<TABLE>'; echo '<TR><TD colspan="1" class="mtitle" style="width:auto" > <A class="mtitle" HREF="?p_action=fiche&action=add_modele&fiche=modele&' . $str_dossier . '">' . _('Création') . '</A></TD> <TD><A class="mtitle" HREF="?p_action=fiche&' . $str_dossier . '">' . _('Recherche') . '</A></TD> </TR>'; $Res = $cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label"); $Max = Database::num_row($Res); for ($i = 0; $i < $Max; $i++) { $l_line = Database::fetch_array($Res, $i); printf('<TR><TD class="cell"> <A class="mtitle" HREF="?p_action=fiche&action=modifier&fiche=%d&%s">%s</A></TD> <TD class="mshort"> <A class="mtitle" HREF="?p_action=fiche&action=vue&fiche=%d&%s">Liste</A> </TD> </TR>', $l_line['fd_id'], $str_dossier, $l_line['fd_label'], $l_line['fd_id'], $str_dossier); } echo "</TABLE>"; echo '</div>'; }
if ($sa == 'remove') { if (!isset($_REQUEST['p_confirm'])) { echo _('Désolé, vous n\'avez pas coché la case'); echo HtmlInput::button_anchor(_('Retour'), '?action=modele_mgt'); return; } $cn = new Database(); $msg = "dossier"; $name = $cn->get_value("select mod_name from modeledef where mod_id=\$1", array($_REQUEST['m'])); if (strlen(trim($name)) == 0) { echo "<h2 class=\"error\"> {$msg} inexistant</h2>"; return; } $sql = "drop database " . domaine . "mod" . sql_string($_REQUEST['m']); ob_start(); if ($cn->exec_sql($sql) == false) { ob_end_clean(); echo "<h2 class=\"error\">"; printf(_("Base de donnée %s mod %s est accèdée, déconnectez-vous d'abord"), domaine, $_REQUEST['m']) . "</h2>"; exit; } ob_flush(); $sql = "delete from modeledef where mod_id=\$1"; $cn->exec_sql($sql, array($_REQUEST['m'])); print '<h2 class="error">'; printf(_("Le modèle %s est effacé") . "</H2>", $name); echo HtmlInput::button_anchor(_('Retour'), '?action=modele_mgt'); } echo '</div>'; ?>
if (trim($_POST['password']) != '') { $UserChange->pass = md5($_POST['password']); $UserChange->save(); } else { $UserChange->pass = $UserChange->password; $UserChange->save(); } } } } else { if ($sbaction == "delete") { // // Delete the user // $cn = new Database(); $Res = $cn->exec_sql("delete from jnt_use_dos where use_id=\$1", array($uid)); $Res = $cn->exec_sql("delete from ac_users where use_id=\$1", array($uid)); echo "<center><H2 class=\"info\"> Utilisateur " . h($_POST['fname']) . " " . h($_POST['lname']) . " est effacé</H2></CENTER>"; require_once NOALYSS_INCLUDE . '/class_iselect.php'; require_once NOALYSS_INCLUDE . '/user.inc.php'; return; } } $UserChange->load(); $it_pass = new IText('password'); $it_pass->value = ""; ?> <FORM id="user_detail_frm" METHOD="POST"> <?php echo HtmlInput::hidden('UID', $uid);
require_once '../include/constant.php'; require_once NOALYSS_INCLUDE . '/class_database.php'; require_once NOALYSS_INCLUDE . '/ac_common.php'; require_once NOALYSS_INCLUDE . '/class_dossier.php'; $gDossier = dossier::id(); $cn = new Database($gDossier); require_once NOALYSS_INCLUDE . '/class_user.php'; global $g_user; $g_user = new User($cn); $g_user->Check(); set_language(); if ($g_user->check_module("CFGDOC") == 0) { exit; } // retrieve the document $r = $cn->exec_sql("select md_id,md_lob,md_filename,md_mimetype\n from document_modele where md_id=\$1", array($_REQUEST['md_id'])); if (Database::num_row($r) == 0) { echo_error("Invalid Document"); exit; } $row = Database::fetch_array($r, 0); $cn->start(); $tmp = tempnam($_ENV['TMP'], 'document_'); $cn->lo_export($row['md_lob'], $tmp); ini_set('zlib.output_compression', 'Off'); header("Pragma: public"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: must-revalidate"); header('Content-type: ' . $row['md_mimetype']); header('Content-Disposition: attachment;filename="' . $row['md_filename'] . '"', FALSE);
/** *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(); } }
// Action = save //---------------------------------------------------------------------- if (isset($_POST['ok'])) { try { $cn->start(); $sec_User = new User($cn, $_POST['user_id']); // save profile $sec_User->save_profile($_POST['profile']); /* Save first the ledger */ $a = $cn->get_array('select jrn_def_id from jrn_def'); foreach ($a as $key) { $id = $key['jrn_def_id']; $priv = sprintf("jrn_act%d", $id); $count = $cn->get_value('select count(*) from user_sec_jrn where uj_login=$1 ' . ' and uj_jrn_id=$2', array($sec_User->login, $id)); if ($count == 0) { $cn->exec_sql('insert into user_sec_jrn (uj_login,uj_jrn_id,uj_priv)' . ' values ($1,$2,$3)', array($sec_User->login, $id, $_POST[$priv])); } else { $cn->exec_sql('update user_sec_jrn set uj_priv=$1 where uj_login=$2 and uj_jrn_id=$3', array($_POST[$priv], $sec_User->login, $id)); } } /* now save all the actions */ $a = $cn->get_array('select ac_id from action'); foreach ($a as $key) { $id = $key['ac_id']; $priv = sprintf("action%d", $id); if (!isset($_POST[$priv])) { $cn->exec_sql("delete from user_sec_act where ua_act_id=\$1", array($id)); continue; } $count = $cn->get_value('select count(*) from user_sec_act where ua_login=$1 ' . ' and ua_act_id=$2', array($sec_User->login, $id)); if ($_POST[$priv] == 1 && $count == 0) {
* along with NOALYSS; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Copyright Author Dany De Bontridder danydb@aevalys.eu /*!\file * \brief let you see the list of the connexion */ if (!defined('ALLOWED')) { die('Forbidden'); } ?> <DIV class="content" style="width:80%;margin-left:10%"> <span class="notice">Liste limitée aux 100 dernières connexions</span> <?php $cn = new Database(); $cn->exec_sql("select ac_user,ac_ip,to_char(ac_date,'DD.MM.YYYY HH24:MI') as fmt_date,ac_state,ac_module from audit_connect order by ac_date desc limit 100 "); ?> <TABLE CLASS="result" style="border-collapse:separate;border-spacing:2"> <tr> <th><?php echo _("Utilisateur"); ?> </th> <th><?php echo _("Date"); ?> </th> <th><?php echo _("Adresse"); ?> </th>
/** * \brief Minimal page header for each page, used for small popup window * * \param p_theme default theme * \param $p_script * \param $p_script2 another js script * * \return none */ function html_min_page_start($p_theme = "", $p_script = "", $p_script2 = "") { $cn = new Database(); if ($p_theme != "") { $Res = $cn->exec_sql("select the_filestyle from theme\n where the_name='" . $p_theme . "'"); if (Database::num_row($Res) == 0) { $style = "style-classic.css"; } else { $s = Database::fetch_array($Res, 0); $style = $s['the_filestyle']; } } else { $style = "style-classic.css"; } // end if echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">'; echo "<HTML>"; if ($p_script2 != "") { $p_script2 = '<script src="' . $p_script2 . '" type="text/javascript"></script>'; } echo "<HEAD>\n <TITLE>NOALYSS</TITLE>\n <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF8\">\n <LINK REL=\"stylesheet\" type=\"text/css\" href=\"{$style}\" media=\"screen\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style-print.css\" media=\"print\">" . $p_script2 . "\n <script src=\"js/scripts.js\" type=\"text/javascript\"></script>\n <script src=\"js/acc_ledger.js\" type=\"text/javascript\"></script>\n <script src=\"js/smoke.js\" type=\"text/javascript\"></script>"; echo '</HEAD> '; echo "<BODY {$p_script}>"; /* If we are on the user_login page */ if (basename($_SERVER['PHP_SELF']) == 'user_login.php') { return; } }
header('Content-type: text/xml; charset=UTF-8'); echo <<<EOF <?xml version="1.0" encoding="UTF-8"?> <data> <dtid>{$html}</dtid> <message>{$message}</message> </data> EOF; return; break; case 'mod_cat_doc': require_once NOALYSS_INCLUDE . '/template/document_mod_change.php'; break; case 'dsp_tva': $cn = new Database($gDossier); $Res = $cn->exec_sql("select * from tva_rate order by tva_rate desc"); $Max = Database::num_row($Res); $r = ""; $r = HtmlInput::anchor_close('tva_select'); $r .= h2(_('Choisissez la TVA '), 'class="title"'); $r .= '<div >'; $r .= _('Filter') . " " . HtmlInput::filter_table("tva_select_table", '0,1,2,3', 1); $r .= '<TABLE style="width:100%" id="tva_select_table">'; $r .= th(_('code')); $r .= th(_('Taux')); $r .= th(_('Symbole')); $r .= th(_('Explication')); for ($i = 0; $i < $Max; $i++) { $row = Database::fetch_array($Res, $i); if (!isset($compute)) { if (!isset($code)) {
$lname = $id . " Restauration :" . sql_string($_FILES['file']['name']); } else { $lname = $id . " " . $_REQUEST['database']; } $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 " <LINK REL=\"stylesheet\" type=\"text/css\" href=\"{$theme}\" media=\"screen\">"; echo "</head><body class=\"op_detail_frame\">"; echo "<h2>" . _("Document") . "</h2>"; echo '<div class="op_detail_frame">'; echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data" id="form_file">'; $sp = new ISpan('file' . $div); $sp->style = "display:none;width:155;height:15;background-color:red;color:white;font-size:10"; $sp->value = _("Chargement"); echo $sp->input(); echo HtmlInput::hidden('act', 'loadfile'); echo dossier::hidden(); echo HtmlInput::hidden('jr_id', $jr_id); echo HtmlInput::hidden('div', $div); echo '<INPUT TYPE="FILE" name="pj" onchange="getElementById(\'file' . $div . '\').style.display=\'inline\';submit(this);">'; echo '</FORM>'; $ret = $cn->exec_sql("select jr_pj from jrn where jr_id=\$1", array($jr_id)); if (Database::num_row($ret) != 0) { $r = Database::fetch_array($ret, 0); $old_oid = $r['jr_pj']; if (strlen($old_oid) != 0) { // check if this pj is used somewhere else $c = $cn->count_sql("select * from jrn where jr_pj=" . $old_oid); if ($c == 1) { $cn->lo_unlink($old_oid); } } $cn->exec_sql("update jrn set jr_pj=null, jr_pj_name=null, " . "jr_pj_type=null where jr_id=\$1", array($jr_id)); } } echo '</div>'; exit;
Cordialement, Noalyss team EOF; $mail->set_message($message); $mail->compose(); $mail->send(); echo '<p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;"> L\'email a été envoyé avec un lien et le nouveau mot de passe, vérifiez vos spams</p>'; } } elseif ($action == "req") { $request_id = HtmlInput::default_value_request("req", ""); if (strlen(trim($request_id)) == SIZE_REQUEST) { require_once NOALYSS_INCLUDE . '/class_database.php'; $cn = new Database(0); $value = $cn->get_value("select password from recover_pass where request=\$1 and created_on > now() - interval '12 hours' and recover_on is null", array($request_id)); if ($cn->get_affected() > 0) { $cn->exec_sql("update ac_users set use_pass=md5(rp.password) from recover_pass as rp where rp.use_id=ac_users.use_id and request=\$1", array($request_id)); $cn->exec_sql("update recover_pass set recover_by=\$1 , recover_on=now() where request=\$2", array($_SERVER['REMOTE_ADDR'], $request_id)); ?> <p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;"> Opération réussie , vous pouvez vous connecter avec votre nouveau mot de passe </p> <?php } } else { die("Requête inconnue"); } }
<?php //This file is part of NOALYSS and is under GPL //see licence.txt if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); } require_once NOALYSS_INCLUDE . '/class_database.php'; require_once NOALYSS_INCLUDE . '/class_user.php'; $cn = new Database($_GET['gDossier']); if (isset($_REQUEST['pa_id'])) { $res = $cn->exec_sql("select po_name,po_description from poste_analytique where pa_id=\$1 ~* and (po_description ~* \$2 or po_name ~* \$3 order by po_id limit 12", array($_REQUEST['pa_id'], $_POST['anccard'], $_POST['anccard'])); } else { $res = $cn->exec_sql("select po_name,po_description from poste_analytique where po_description ~* \$1 or po_name ~* \$2 order by po_id limit 12 ", array($_POST['anccard'], $_POST['anccard'])); } $nb = Database::num_row($res); echo "<ul>"; for ($i = 0; $i < $nb; $i++) { $row = Database::fetch_array($res, $i); echo "<li>"; echo $row['po_name']; echo '<span class="informal"> ' . $row['po_description'] . '</span></li>'; } echo "</ul>";
require_once NOALYSS_INCLUDE . '/user_menu.php'; echo '<div id="acc_update" class="inner_box" style="display:none;position:absolute;text-align:left;z-index:1"></div>'; /* Store the p_start parameter */ $g_start = HtmlInput::default_value_get('p_start', 1); ?> <a id="top"></a> <div class="content"> <?php menu_acc_plan($g_start); ?> </div> <DIV CLASS="myfieldset" style="width:auto"> <?php $Ret = $cn->exec_sql("select pcm_val,pcm_lib,pcm_val_parent,pcm_type,array_to_string(array_agg(j_qcode) , ',') as acode\n\tfrom tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) where substr(pcm_val::text,1,1)='" . $g_start . "'" . " group by pcm_val,pcm_lib,pcm_val_parent, pcm_type order by pcm_val::text"); $MaxRow = Database::num_row($Ret); ?> <span style="display:inline;margin: 15px 15px 15px 15px"> <input type="button" id="pcmn_update_add_bt" class="smallbutton" value="<?php echo _('Ajout poste comptable'); ?> "> </span> <?php echo _('Filtre') . " " . HtmlInput::filter_table("account_tbl_id", "0,1,2,3,4", 1); ?> <?php echo HtmlInput::hidden('p_action', 'pcmn'); //echo HtmlInput::hidden('sa','detail'); echo dossier::hidden();
/*!\file * \brief Verify the saldo of ledger: independant file */ if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); } require_once NOALYSS_INCLUDE . '/class_user.php'; require_once NOALYSS_INCLUDE . '/class_acc_bilan.php'; global $g_captcha, $g_failed, $g_succeed; $cn = new Database(dossier::id()); $exercice = $g_user->get_exercice(); echo '<div class="content">'; $sql_year = " and j_tech_per in (select p_id from parm_periode where p_exercice='" . $g_user->get_exercice() . "')"; echo '<div class="myfieldset"><h1 class="legend">' . _('Vérification des journaux') . '</h1>'; $sql = "select jrn_def_id,jrn_def_name from jrn_def"; $res = $cn->exec_sql($sql); $jrn = Database::fetch_all($res); echo '<table class="result">'; echo tr(th(_('Journal')) . th(_('Débit'), ' style="display:right"') . th(_("Crédit"), ' style="display:right"') . th(_("Différence"), ' style="display:right"') . th('')); $ix = 0; foreach ($jrn as $l) { $id = $l['jrn_def_id']; $name = $l['jrn_def_name']; $deb = $cn->get_value("select sum (j_montant) from jrnx where j_debit='t' and j_jrn_def={$id} {$sql_year} "); $cred = $cn->get_value("select sum (j_montant) from jrnx where j_debit='f' and j_jrn_def={$id} {$sql_year} "); if ($cred == $deb) { $result = $g_succeed; } else { $result = $g_failed; } $class = $ix % 2 == 0 ? 'odd' : "even";
$g_user = new User($cn); $inside_dossier = false; if (isset($_REQUEST['gDossier']) && $_REQUEST['gDossier'] != 0) { $g_user->load_global_pref(); $msg = ""; $cn = new Database($_REQUEST['gDossier']); $g_user->cn = $cn; $inside_dossier = true; $local_pref = $g_user->get_preference(); } ////////////////////////////////////////////////////////////////////////// // Theme ////////////////////////////////////////////////////////////////////////// $repo = new Database(); // charge tous les styles $res = $repo->exec_sql("select the_name from theme\n order by the_name"); $style = new ISelect('style_user'); $style->value = $repo->make_array("select the_name,the_name\n\tfrom theme\n\torder by the_name"); $style->selected = $_SESSION['g_theme']; ?> <div class="content" > <FORM METHOD="POST"> <fieldset style="margin: 1%"><legend><?php echo _('Options Générales'); ?> </legend> <table> <tr> <td>
$per->jrn_def_id = $jrn_def_id; $per->set_periode($a_per_to_close[$i]); $per->close(); } } $choose = "yes"; } if ($action == "delete_per") { $p_per = $_GET["p_per"]; // Check if the periode is not used if ($cn->count_sql("select * from jrnx where j_tech_per={$p_per}") != 0) { alert(' Désolé mais cette période est utilisée'); } else { $count = $cn->get_value("select count(*) from parm_periode;"); if ($count > 1) { $Res = $cn->exec_sql("delete from parm_periode where p_id={$p_per}"); } else { alert(' Désolé mais vous devez avoir au moins une période'); } } $choose = "yes"; } if ($action == 'reopen') { $jrn_def_id = isset($_GET['jrn_def_id']) ? $_GET['jrn_def_id'] : 0; $per = new Periode($cn); $jrn_def_id = isset($_GET['jrn_def_id']) ? $_GET['jrn_def_id'] : 0; $per->set_jrn($jrn_def_id); $per->set_periode($_GET['p_per']); $per->reopen(); $choose = "yes"; }
if ($action == "upd_doc") { if ($g_user->check_action(VIEWDOC) == 1) { $doc = new Document($cn, $_REQUEST['d_id']); $doc->get(); if ($g_user->can_write_action($doc->ag_id)) { // retrieve the document $doc->update_description(strip_tags($_REQUEST['value'])); } } } /* remove the operation from action_gestion_operation */ if ($action == 'rmop') { $json = '{"ago_id":"-1"}'; $dt_id = $cn->get_value("select ag_id from action_gestion_operation where ago_id=\$1", array($_REQUEST['id'])); if ($g_user->check_action(RMDOC) == 1 && $g_user->can_write_action($dt_id) == true) { $cn->exec_sql("delete from action_gestion_operation where ago_id=\$1", array($_REQUEST['id'])); $json = sprintf('{"ago_id":"%s"}', $_REQUEST['id']); } header("Content-type: text/html; charset: utf8", true); print $json; } /* remove the comment from action_gestion_operation */ if ($action == 'rmcomment') { $json = '{"agc_id":"-1"}'; $dt_id = $cn->get_value("select ag_id from action_gestion_comment where agc_id=\$1", array($_REQUEST['id'])); if ($g_user->check_action(RMDOC) == 1 && $g_user->can_write_action($dt_id) == true) { $cn->exec_sql("delete from action_gestion_comment where agc_id=\$1", array($_REQUEST['id'])); $json = sprintf('{"agc_id":"%s"}', $_REQUEST['id']); } header("Content-type: text/html; charset: utf8", true); print $json;
* * NOALYSS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NOALYSS; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../include/constant.php'; require_once NOALYSS_INCLUDE . '/class_database.php'; require_once NOALYSS_INCLUDE . '/class_user.php'; $cn = new Database($_GET['gDossier']); global $g_user; $g_user = new User($cn); $g_user->Check(); $g_user->check_dossier($_GET['gDossier']); $res = $cn->exec_sql("select distinct code,description from get_profile_menu(\$1) where code ~* \$2 or description ~* \$3 order by code limit 5 ", array($g_user->get_profile(), $_POST['acs'], $_POST['acs'])); $nb = Database::num_row($res); echo "<ul>"; for ($i = 0; $i < $nb; $i++) { $row = Database::fetch_array($res, $i); echo "<li>"; echo $row['code']; echo '<span class="informal"> ' . $row['description'] . '</span></li>'; } echo "</ul>"; if ($nb == 0) { echo _('Aucune correspondance'); }
$msg = "dossier"; $name = $cn->get_value("select dos_name from ac_dossier where dos_id=\$1", array($dossier_id)); if (strlen(trim($name)) == 0) { echo "<h2 class=\"error\"> {$msg} " . _('inexistant') . "</h2>"; return; } /** * Check if db exists */ $str_name = domaine . 'dossier' . $dossier_id; $database_exist = $cn->exist_database($str_name); // if db exists for postgres then drop it if ($database_exist == 1) { $sql = "drop database " . domaine . "dossier" . sql_string($_REQUEST['d']); ob_start(); if ($cn->exec_sql($sql) == false) { ob_end_clean(); echo "<h2 class=\"error\"> "; echo _('Base de donnée ') . domaine . "dossier" . $_REQUEST['d'] . _("est accèdée, déconnectez-vous d'abord") . "</h2>"; exit; } ob_flush(); } // clean tables about this dossier $sql = "delete from jnt_use_dos where dos_id=\$1"; $cn->exec_sql($sql, array($dossier_id)); $sql = "delete from ac_dossier where dos_id=\$1"; $cn->exec_sql($sql, array($dossier_id)); print '<h2 class="error">'; printf(_("Le dossier %s est effacé") . '</h2>', h($name)); echo HtmlInput::button_anchor(_('Retour'), '?action=dossier_mgt');
/** * Save the password from PREFERENCE MODULE * @param type $p_email */ function save_email($p_email) { $repo = new Database(); $repo->exec_sql("update ac_users set use_email=\$1 where use_login=\$2", array($p_email, $_SESSION['g_user'])); }
/** *remove all the schema from the plugins * @param Database $p_cn */ static function clean(Database $p_cn) { $a_ext = array("tva_belge", "amortissement", "impdol", "coprop", "importbank"); for ($i = 0; $i < count($a_ext); $i++) { if ($p_cn->exist_schema($a_ext[$i])) { $p_cn->exec_sql("drop schema " . $a_ext[$i] . " cascade"); } } }
echo_error("Missing parameters"); } require_once NOALYSS_INCLUDE . '/class_database.php'; set_language(); $jr_grpt_id = $_GET['jr_grpt_id']; $cn = new Database($gDossier); require_once NOALYSS_INCLUDE . '/class_user.php'; global $g_user; $g_user = new User($cn); $g_user->Check(); $g_user->check_dossier($gDossier); if (isNumber($jr_grpt_id) != 1) { die(_('Données invalides')); } // retrieve the jrn $r = $cn->exec_sql("select jr_def_id from jrn where jr_grpt_id={$jr_grpt_id}"); if (Database::num_row($r) == 0) { echo_error("Invalid operation id jr_grpt_id={$jr_grpt_id}"); exit; } $a = Database::fetch_array($r, 0); $jrn = $a['jr_def_id']; if ($g_user->check_jrn($jrn) == 'X') { /* Cannot Access */ NoAccess(); exit - 1; } $cn->start(); $ret = $cn->exec_sql("select jr_pj,jr_pj_name,jr_pj_type from jrn where jr_grpt_id={$jr_grpt_id}"); if (Database::num_row($ret) == 0) { return;
$pdf->Cell(0, 7, 'Bloqué', 0, 0, 'R'); $pdf->Ln(); } if ($SecUser->admin == 1) { $pdf->SetTextColor(0, 0, 0); $pdf->setFillColor(239, 251, 255); $pdf->Cell(40, 7, 'Administrateur', 1, 1, 'R'); $pdf->Ln(); } $pdf->SetTextColor(0, 0, 0); //----------------------------------------------------- // Journal $pdf->Cell(0, 7, 'Accès journaux', 1, 0, 'C'); $pdf->Ln(); $pdf->SetFont('DejaVu', '', 6); $Res = $cn->exec_sql("select jrn_def_id,jrn_def_name from jrn_def "); $SecUser->db = $cn; for ($e = 0; $e < Database::num_row($Res); $e++) { $row = Database::fetch_array($Res, $e); $pdf->Cell(40, 6, $row['jrn_def_name']); $priv = $SecUser->check_jrn($row['jrn_def_id']); switch ($priv) { case 'X': $pdf->SetTextColor(255, 0, 34); $pdf->Cell(30, 6, "Pas d'accès"); break; case 'R': $pdf->SetTextColor(54, 233, 0); $pdf->Cell(30, 6, "Lecture"); break; case 'O':
for ($i = 4; $i <= $MaxVersion; $i++) { if ($db->get_value(' select val from repo_version') <= $i) { $db->execute_script('sql/patch/ac-upgrade' . $i . '.sql'); } } ?> <p style="text-align: center"> <A style="" class="button" HREF="../index.php">Connectez-vous à NOALYSS</A> </p> <?php exit; } /* * If multi folders */ $Resdossier = $cn->exec_sql("select dos_id, dos_name from ac_dossier"); $MaxDossier = $cn->size($Resdossier); //---------------------------------------------------------------------- // Upgrade the folders //---------------------------------------------------------------------- for ($e = 0; $e < $MaxDossier; $e++) { $db_row = Database::fetch_array($Resdossier, $e); echo "<h3>Patching " . $db_row['dos_name'] . '</h3>'; $name = $cn->format_name($db_row['dos_id'], 'dos'); if ($cn->exist_database($name) > 0) { $db = new Database($db_row['dos_id'], 'dos'); $db->apply_patch($db_row['dos_name']); Dossier::synchro_admin($db_row['dos_id']); } else { echo_warning(_("Dossier inexistant") . " {$name}"); }