';
return;
}
/*
* Set the user preference
*/
if ( isset ($_POST['set_preference'])) {
//// Save value
$style_user=$http->post("style_user","string","Classique");
$lang=$http->post("lang","string","fr_FR.utf8");
$p_size=$http->post("p_size","number",50);
$pass_1=$http->post("pass_1","string","");
$pass_2=$http->post("pass_2","string","");
$p_email=$http->post("p_email","string","");
$minirap=$http->post("minirap","number",0);
$period=$http->post("period","number");
$csv_fieldsep=$http->post("csv_fieldsep","number");
$csv_decimal=$http->post("csv_decimal","number");
$csv_encoding=$http->post("csv_encoding");
if (strlen(trim($pass_1)) != 0 && strlen(trim($pass_2)) != 0)
{
$g_user->save_password($pass_1,$pass_2);
}
$g_user->set_periode($period);
$g_user->save_global_preference('THEME', $style_user);
$g_user->save_global_preference('LANG', $lang);
$g_user->save_global_preference('PAGESIZE', $p_size);
$g_user->save_global_preference('csv_fieldsep', $csv_fieldsep);
$g_user->save_global_preference('csv_decimal', $csv_decimal);
$g_user->save_global_preference('csv_encoding', $csv_encoding);
$g_user->set_mini_report($minirap);
$_SESSION['g_theme']=$style_user;
$_SESSION['g_pagesize']=$p_size;
$_SESSION['g_lang']=$lang;
$g_user->save_email($p_email);
}
$style_user=$http->post("style_user","string",$_SESSION['g_theme']);
html_page_start($style_user);
if ( DEBUG ) {
?>
$_POST
$_GET
$_REQUEST
$_SESSION
$GLOBALS
Check();
$g_user->check_dossier(Dossier::id());
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 <<
Vous utilisez un navigateur dépassé depuis près de 8 ans!
Pour une meilleure expérience web, prenez le temps de mettre votre navigateur à jour.
EOF;
exit();
}
if ($cn->exist_table('version') == false)
{
echo '
' . _("Base de donnée invalide") . '
';
$base = dirname($_SERVER['REQUEST_URI']);
echo HtmlInput::button_anchor('Retour', $base . '/user_login.php');
exit();
}
if (DBVERSION < dossier::get_version($cn))
{
$a = _("cliquez ici pour mettre à jour ");
$base =NOALYSS_URL."/admin-noalyss.php?action=upgrade&sb=application";
echo '
' .
_("Attention: la version de base de donnée est supérieure à la version du programme, vous devriez mettre à jour") ,
'' . $a . '
',
'';
}
if (DBVERSION > dossier::get_version($cn))
{
echo '
' . _("Votre base de données n'est pas à jour") . ' ';
$a = _("cliquez ici pour appliquer le patch");
$base =NOALYSS_URL.'/admin-noalyss.php?action=upgrade&sb=database';
echo '' . $a . '
';
}
/*
* Set a correct periode for the user
*/
$periode = $g_user->get_periode();
$oPeriode = new Periode($cn, $periode);
if ($oPeriode->load() == -1)
{
$periode = $cn->get_value('select p_id from parm_periode order by p_start asc limit 1');
$g_user->set_periode($periode);
}
$module_selected = -1;
?>
0) $last--;
fwrite ($file_loginput,"get_profile();
$amenu_id=$cn->get_array('select
pm_id_v3,pm_id_v2,pm_id_v1
from v_menu_profile where code= upper($1) and p_id=$2',
array($AC,$user_profile));
try {
if ( count($amenu_id) != 1 ) {
// if AC is a simple code and this menu can be accessed
// we should find the first menu which used it and change the
// request AC to it
$pm_id=$cn->get_array('select pm_id from profile_menu '
. ' where lower(me_code)=lower($1) and p_id=$2',
array($AC,$user_profile));
if ( count($pm_id) > 0 ) {
show_menu($pm_id[0]['pm_id']);
} else {
throw new Exception(_('Erreur menu'),10);
}
}
$module_id=$cn->get_value('select case when pm_id_v3 = 0 then (case when pm_id_v2 = 0 then pm_id_v1 else pm_id_v2 end) else pm_id_v3 end
from v_menu_profile where p_id=$1 and upper(code)=upper($2)',
array($user_profile,$AC));
$g_user->audit();
// Show module and highligt selected one
show_module($module_id);
show_menu( $amenu_id[0]['pm_id_v3']);
show_menu( $amenu_id[0]['pm_id_v2']);
show_menu($amenu_id[0]['pm_id_v1']);
} catch (Exception $e) {
if ( $e->getCode() == 10 ) {
alert(_('Accès menu impossible'));
echo '';
echo _('Retour');
echo '';
}
else {
alert($e->getMessage());
record_log($e->getTraceAsString());
}
}
}
else
{
$default = find_default_module();
$user_profile=$g_user->get_profile();
try
{
if ( $user_profile == "" )
throw new Exception (_('Aucun profil utilisateur'));
$menu_id=$cn->get_value('select
case when pm_id_v3 = 0 then
(case when pm_id_v2 = 0 then pm_id_v1 else pm_id_v2 end)
else pm_id_v3 end
from v_menu_profile where code= upper($1) and p_id=$2',
array($default,$user_profile));
$_GET['ac']=$default;
$_POST['ac']=$default;
$_REQUEST['ac']=$default;
show_module($menu_id);
$all[0] = $default;
show_menu($menu_id);
}
catch (Exception $exc)
{
echo $exc->getMessage();
record_log($exc->getTraceAsString());
}
}