noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
user_login.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19/*! \file
20 * \brief Welcome page where the folder and module are choosen
21 */
22
23// Copyright Author Dany De Bontridder danydb@aevalys.eu
24require_once '../include/constant.php';
25include_once NOALYSS_INCLUDE.'/lib/ac_common.php';
26require_once NOALYSS_INCLUDE.'/class/database.class.php';
27require_once NOALYSS_INCLUDE.'/lib/itext.class.php';
28require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
29require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
30require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php';
31@html_page_start($_SESSION[SESSION_KEY.'g_theme']);
32MaintenanceMode("block.html");
33
35require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
36
37$User=new Noalyss_user($rep);
38
39$User->Check();
40/**
41 * check if 2FA is completed
42 */
43if ( ! $User->is_double_identified()) {
44 exit();
45}
46
47/* Check Browser version if < IE6 then unsupported */
48$browser=$_SERVER['HTTP_USER_AGENT'];
49if ( strpos($browser,'MSIE 6')!=false ||
50 strpos($browser,'MSIE 5')!=false )
51{
52 $nav=_('Vous utilisez un navigateur dépassé depuis près de 8 ans!');
53 $nav2=_("Pour une meilleure expérience web, prenez le temps de mettre votre navigateur à jour");
54 echo <<<EOF
55 <!--[if lt IE 7]>
56 <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>
57 <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div>
58 <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
59 <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
60 <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
61 <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>$nav</div>
62 <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>$nav2.</div>
63 </div>
64 <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>
65 <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>
66 <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>
67 </div>
68 </div>
69 <![endif]-->
70EOF;
71 exit();
72}
73if ( DEBUGNOALYSS > 1 ) {
74 /**
75 * Debug Design
76 */
80} //<--- if DEBUG
83
84/* check if repo valid */
85if ( $ac->exist_table('version') == false)
86{
87 echo '<h2 class="error" style="font-size:12px">'._("Base de donnée invalide").'</h2>';
88 echo '<a hreF="'.NOALYSS_URL.'/user_login.php">'._("Retour").'</a></h2>';
89 exit();
90}
91
92/* check repo version */
93if (!defined("MULTI")||(defined("MULTI")&&MULTI==1))
94{
95 $version = $ac->get_value('select max(val) from version');
96} else {
97 $version = $ac->get_value('select max(val) from repo_version');
98
99}
100if ( $version < DBVERSIONREPO )
101{
102 echo '<h2 class="error" style="font-size:12px">'._("Votre base de données n'est pas à jour").' ';
103 $a=_("cliquez ici pour appliquer le patch");
104 $base =NOALYSS_URL.'/admin-noalyss.php';
105 echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
106
107}
108if ( $User->isAdmin() == 1)
109{
110 if (SITE_UPDATE !="") {
111 $file=$_ENV['TMP']."/version_noalyss".domaine;
112 $update=\Noalyss\File_Cache::get_content(SITE_UPDATE,$file,172800);
113
114 if ($update > $version_noalyss ) {
115 echo '<div id="version_div" class="inner_box" style="width:25%;margin-left:10%;margin-top:3px;">';
116 echo '<p class="notice">';
117 printf ( "Mise à jour disponible de NOALYSS version actuelle : %s votre version %s ",$update,$version_noalyss);
118
119 // Link to admin_repo : upgrade application
120 $base =NOALYSS_URL."/admin-noalyss.php?action=upgrade&sb=application";
121
122 echo '<a hreF="' . $base . '">' . _("Cliquez ici pour mettre à jour") . '</a>';
123 echo '</p>';
124 echo '<p style="text-align:center"> <a class="button" onclick="document.body.removeChild(document.getElementById(\'version_div\'))">'.
125 _('Fermer').
126 "</a></p>";
127 echo '</div>';
128 }
129 }
130}
131
132include_once NOALYSS_INCLUDE."/lib/user_menu.php";
133
134$priv=($User->admin==1)?_("Administrateur"):_("Utilisateur");
136
137/**
138 *
139 * If the user is NOT admin and can access only ONE folder,
140 * OR for a One Folder Installation
141 * he will be directly redirected to his folder or to the plugins of this
142 * folder if he's an "plugin user"
143 */
144
145
147$result.="<table border=\"0\">";
148$result.='<TR>';
149if ( $User->isAdmin() == 1 )
150{
151 $result.="<TD class=\"tool\" ><A class=\"cell\" HREF=\"admin-noalyss.php\">"._("Administration")." </A></TD>";
152}
153$result.='<TD class="tool">';
154$result.='<a onclick="set_preference(0)" title="Préférence" href="javascript:void(0)" class="cell">'._('Préférence').'</a>';
155$result.= '</TD>';
156$result.='<TD class="tool" ><A class="cell" HREF="logout.php" >'._('Deconnexion').'</a></TD>';
157$result.="</TR>";
158$result.="</table>";
159
160echo '<div id="module" style="position:absolute;">'.$result.'</div>';
161echo '<div class="welcome"> ';
162if ( $User->admin == 0 || (defined("MULTI")&& MULTI == 0 ) )
163{
164 // how many folder ?
165 $folder=$User->get_available_folder();
166 if ( $folder != null && count($folder) == 1 )
167 {
168 echo _("Si la redirection ne fonctionne pas, vous devez changer la valeur de NOALYSS_URL ");
169 redirect(NOALYSS_URL.'/do.php?gDossier='.$folder[0]['dos_id']);
170 exit();
171 }
172
173}
174echo '</div>';
175?>
176<div class="foldercontent">
177 <span style="margin:2%" class="visible_gt800">
178 <?php
179 echo _('Cherche').Icon_Action::infobulle(23);
180?>
181<?php
182 echo HtmlInput::filter_table("folder", '0,1,2',1);
183?>
184</span>
185<?php
186
187// If admin show everything otherwise only the available dossier
188$res=$User->show_dossier("");
189echo $res;
190?>
191<P>
192
193</P>
194</div>
195<?php
197?>
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
span($p_string, $p_extra='')
Definition ac_common.php:43
html_page_stop()
end tag
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
$base
$opd_description style
if(isset( $_REQUEST[ 'show'])) if(isset($_REQUEST['del'])) $ac
_("actif, passif,charge,...")
contains the class for connecting to Noalyss
static filter_table($p_table_id, $p_col, $start_row)
filter the rows in a table and keep the colored row in alternance
manage the http input (get , post, request) and extract from an array
static display_global()
for development , show GLOBAL and SESSION
Definition dbg.php:148
static display_request()
for development , show request (POST, GET)
Definition dbg.php:119
static display_size()
display a bar depending of the size of the screen , it helps for CSS to see the media-size
Definition dbg.php:104
static get_content($url, $filename, $time_cache_second)
Check if the file exists, if yes then read otherwise take it from the url,.
const DBVERSIONREPO
Definition constant.php:37
global $version_noalyss
Definition constant.php:26
$browser
Definition do.php:110
$hi
Definition export.php:67
for($e=0; $e< count($afiche); $e++) exit
load_all_script()
load all the javascript only one time
$version
Definition install.php:494
domaine
Definition install.php:370
$folder
Definition test.php:76
redirect( $p_string, $p_time=0)
redirect with javascript
$priv