noalyss Version-9
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
32@html_page_start($_SESSION[SESSION_KEY.'g_theme']);
33MaintenanceMode("block.html");
34
36require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
37
38$User=new Noalyss_user($rep);
39
40$User->Check();
41/* Check Browser version if < IE6 then unsupported */
42$browser=$_SERVER['HTTP_USER_AGENT'];
43if ( strpos($browser,'MSIE 6')!=false ||
44 strpos($browser,'MSIE 5')!=false )
45{
46 $nav=_('Vous utilisez un navigateur dépassé depuis près de 8 ans!');
47 $nav2=_("Pour une meilleure expérience web, prenez le temps de mettre votre navigateur à jour");
48 echo <<<EOF
49 <!--[if lt IE 7]>
50 <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>
51 <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>
52 <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
53 <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
54 <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
55 <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>$nav</div>
56 <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>$nav2.</div>
57 </div>
58 <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>
59 <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>
60 <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>
61 </div>
62 </div>
63 <![endif]-->
64EOF;
65 exit();
66}
67if ( DEBUGNOALYSS > 1 ) {
68 /**
69 * Debug Design
70 */
74} //<--- if DEBUG
77
78/* check if repo valid */
79if ( $ac->exist_table('version') == false)
80{
81 echo '<h2 class="error" style="font-size:12px">'._("Base de donnée invalide").'</h2>';
82 echo '<a hreF="'.NOALYSS_URL.'/user_login.php">'._("Retour").'</a></h2>';
83 exit();
84}
85
86/* check repo version */
87if (!defined("MULTI")||(defined("MULTI")&&MULTI==1))
88{
89 $version = $ac->get_value('select max(val) from version');
90} else {
91 $version = $ac->get_value('select max(val) from repo_version');
92
93}
95{
96 echo '<h2 class="error" style="font-size:12px">'._("Votre base de données n'est pas à jour").' ';
97 $a=_("cliquez ici pour appliquer le patch");
98 $base =NOALYSS_URL.'/admin-noalyss.php';
99 echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
100
101}
102if ( $User->isAdmin() == 1)
103{
104 if (SITE_UPDATE !="") {
105 $file=$_ENV['TMP']."/version_noalyss".domaine;
106 $update=\Noalyss\File_Cache::get_content(SITE_UPDATE,$file,172800);
107
108 if ($update > $version_noalyss ) {
109 echo '<div id="version_div" class="inner_box" style="width:25%;margin-left:10%;margin-top:3px;">';
110 echo '<p class="notice">';
111 printf ( "Mise à jour disponible de NOALYSS version actuelle : %s votre version %s ",$update,$version_noalyss);
112
113 // Link to admin_repo : upgrade application
114 $base =NOALYSS_URL."/admin-noalyss.php?action=upgrade&sb=application";
115
116 echo '<a hreF="' . $base . '">' . _("Cliquez ici pour mettre à jour") . '</a>';
117 echo '</p>';
118 echo '<p style="text-align:center"> <a class="button" onclick="document.body.removeChild(document.getElementById(\'version_div\'))">'.
119 _('Fermer').
120 "</a></p>";
121 echo '</div>';
122 }
123 }
124}
125
126include_once NOALYSS_INCLUDE."/lib/user_menu.php";
127
128$priv=($User->admin==1)?_("Administrateur"):_("Utilisateur");
130
131/**
132 *
133 * If the user is NOT admin and can access only ONE folder,
134 * OR for a One Folder Installation
135 * he will be directly redirected to his folder or to the plugins of this
136 * folder if he's an "plugin user"
137 */
138
139
141$result.="<table border=\"0\">";
142$result.='<TR>';
143if ( $User->isAdmin() == 1 )
144{
145 $result.="<TD class=\"tool\" ><A class=\"cell\" HREF=\"admin-noalyss.php\">"._("Administration")." </A></TD>";
146}
147$result.='<TD class="tool">';
148$result.='<a onclick="set_preference(0)" title="Préférence" href="javascript:void(0)" class="cell">'._('Préférence').'</a>';
149$result.= '</TD>';
150$result.='<TD class="tool" ><A class="cell" HREF="logout.php" >'._('Deconnexion').'</a></TD>';
151$result.="</TR>";
152$result.="</table>";
153
154echo '<div id="module" style="position:absolute;">'.$result.'</div>';
155echo '<div class="welcome"> ';
156if ( $User->admin == 0 || (defined("MULTI")&& MULTI == 0 ) )
157{
158 // how many folder ?
159 $folder=$User->get_available_folder();
160 if ( $folder != null && count($folder) == 1 )
161 {
162 echo _("Si la redirection ne fonctionne pas, vous devez changer la valeur de NOALYSS_URL ");
163 redirect(NOALYSS_URL.'/do.php?gDossier='.$folder[0]['dos_id']);
164 exit();
165 }
166
167}
168echo '</div>';
169?>
170<div class="foldercontent">
171 <span style="margin:2%" class="visible_gt800">
172 <?php
173 echo _('Cherche').Icon_Action::infobulle(23);
174?>
175<?php
176 echo HtmlInput::filter_table("folder", '0,1,2',1);
177?>
178</span>
179<?php
180
181// If admin show everything otherwise only the available dossier
182$res=$User->show_dossier("");
183echo $res;
184?>
185<P>
186
187</P>
188</div>
189<?php
191?>
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
Definition: ac_common.php:1663
span($p_string, $p_extra='')
Definition: ac_common.php:43
html_page_stop()
end tag
Definition: ac_common.php:468
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
Definition: ac_common.php:275
$base
Definition: action.inc.php:56
$opd_description style
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
for($e=0; $e< count($afiche); $e++) exit
load_all_script()
load all the javascript only one time
$version
Definition: install.php:490
domaine
Definition: install.php:370
redirect($p_string, $p_time=0)
$result
If the user is NOT admin and can access only ONE folder, OR for a One Folder Installation he will be ...
Definition: user_login.php:140
if(strpos( $browser, 'MSIE 6')!=false||strpos( $browser, 'MSIE 5')!=false) if(DEBUGNOALYSS > 1) $ac
Definition: user_login.php:75
$res
Definition: user_login.php:182
$User
Definition: user_login.php:38
$hi
Definition: user_login.php:76
$priv
Definition: user_login.php:128
$browser
Definition: user_login.php:42
$rep
Definition: user_login.php:35