noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
user_login.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /*! \file
00020  * \brief Welcome page where the folder and module are choosen
00021  */
00022 
00023 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00024 require_once '../include/constant.php';
00025 include_once ("ac_common.php");
00026 require_once('class_database.php');
00027 require_once('class_itext.php');
00028 require_once 'function_javascript.php';
00029 @html_page_start($_SESSION['g_theme']);
00030 $rep=new Database();
00031 include_once ("class_user.php");
00032 $User=new User($rep);
00033 
00034 $User->Check();
00035 /*  Check Browser version if < IE6 then unsupported */
00036 $browser=$_SERVER['HTTP_USER_AGENT'];
00037 if ( strpos($browser,'MSIE 6')!=false ||
00038         strpos($browser,'MSIE 5')!=false )
00039 {
00040     $nav=_('Vous utilisez un navigateur dépassé depuis près de 8 ans!');
00041     $nav2=_("Pour une meilleure expérience web, prenez le temps de mettre votre navigateur à jour");
00042     echo <<<EOF
00043       <!--[if lt IE 7]>
00044       <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>
00045       <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>
00046       <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
00047       <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
00048       <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
00049       <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>$nav</div>
00050       <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>$nav2.</div>
00051       </div>
00052       <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>
00053       <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>
00054       <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>
00055       </div>
00056       </div>
00057       <![endif]-->
00058 EOF;
00059     exit();
00060 }
00061 $ac=new Database();
00062 
00063 /* check if repo valid */
00064 if ( $ac->exist_table('version') == false)
00065 {
00066     echo '<h2 class="error" style="font-size:12px">'._("Base de donnée invalide").'</h2>';
00067     $base=dirname($_SERVER['REQUEST_URI']);
00068     exit();
00069 }
00070 
00071 /* check repo version */
00072 $version = $ac->get_value('select val from version');
00073 if ( $version < DBVERSIONREPO )
00074 {
00075     echo '<h2 class="error" style="font-size:12px">'._("Votre base de données n'est pas à jour").'   ';
00076     $a=_("cliquez ici pour appliquer le patch");
00077     $base=dirname($_SERVER['REQUEST_URI']).'/admin/setup.php';
00078     echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
00079 
00080 }
00081 if ( $User->Admin()  == 1)
00082 {
00083         if (SITE_UPDATE !="") {
00084          $update=@file_get_contents(SITE_UPDATE);
00085          if ($update > $version_noalyss ) {
00086                  echo '<div class="inner_box" style="margin-left:0px;margin-top:3px;left:3px">';
00087                  echo '<p class="notice">';
00088                  echo "Mise à jour disponible de NOALYSS version actuelle : $update votre version $version_noalyss";
00089                  echo '</p>';
00090                  echo '</div>';
00091          }
00092         }
00093 }
00094 
00095 include_once("user_menu.php");
00096 $priv=($User->admin==1)?_("Administrateur"):_("Utilisateur");
00097 load_all_script();
00098 if ( isset ($_POST['set_preference'])) {
00099     //// Save value
00100     extract($_POST);
00101 
00102     if (strlen(trim($pass_1)) != 0 && strlen(trim($pass_2)) != 0)
00103     {
00104         $User->save_password($pass_1,$pass_2);
00105         
00106     }
00107     $User->save_global_preference('THEME', $style_user);
00108     $User->save_global_preference('LANG', $lang);
00109     $_SESSION['g_theme']=$style_user;
00110     $_SESSION['g_lang']=$lang;
00111 }
00112 echo '<div class="welcome"> ';
00113 /**
00114  *
00115  * If the user is NOT admin and can access only ONE folder,
00116  * so it will be directly redirected to this folder or to the plugins of this
00117  * folder if he's an "plugin user"
00118  */
00119 
00120 if ( $User->admin == 0 )
00121 {
00122     // how many folder ?
00123     $folder=$User->get_available_folder();
00124     if ( $folder != null  && count($folder) == 1 )
00125     {
00126 
00127         if ( $User->check_dossier($folder[0]['dos_id']) == 'P')
00128         {
00129             redirect('extension.php?gDossier='.$folder[0]['dos_id']);
00130             exit();
00131         }
00132         else
00133         {
00134             redirect('do.php?gDossier='.$folder[0]['dos_id']);
00135             exit();
00136         }
00137     }
00138 
00139 }
00140 
00141 $result="";
00142 $result.="<table border=\"0\">";
00143 $result.='<TR>';
00144 if ( $User->Admin()  == 1 )
00145 {
00146     $result.="<TD  class=\"tool\" ><A class=\"cell\" HREF=\"admin_repo.php\"> Administration  </A></TD>";
00147 }
00148 $result.='<TD class="tool">';
00149 $result.='<a onclick="set_preference(0)" title="Préférence" href="javascript:void(0)" class="cell">'._('Préférence').'</a>';
00150 $result.= '</TD>';
00151 $result.='<TD  class="tool" ><A class="cell" HREF="logout.php" >'._('Deconnexion').'</a></TD>';
00152 $result.="</TR>";
00153 $result.="</table>";
00154 
00155 echo '<h2 class="info">'._('Bienvenue')."  ".$User->first_name.'  '.$User->name.'   '._("dans NOALYSS")."</h2>";
00156 echo '<div id="module">'.$result.'</div>';
00157 echo '</div>';
00158 ?>
00159 <div class="foldercontent">
00160 <?php echo '<h2 >'._('Choississez un dossier').'</h2>';?>
00161         <span style="display:block;margin:2.5%">
00162  <?php
00163                         echo _('Filtre').HtmlInput::infobulle(23);
00164 ?>
00165 <?php
00166         echo HtmlInput::filter_table("folder", '1,2',0);
00167 ?>
00168 </span>
00169 <?php
00170 
00171 // If admin show everything otherwise only the available dossier
00172 $res=$User->show_dossier("");
00173 echo $res;
00174 ?>
00175 <P>
00176 
00177 </P>
00178 <?php
00179 html_page_stop();
00180 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations