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']);
00078     if ($base == '/') { $base = ''; }
00079     $base .= '/admin/setup.php';
00080     echo '<a hreF="'.$base.'">'.$a.'</a></h2>';
00081 
00082 }
00083 if ( $User->Admin()  == 1)
00084 {
00085         if (SITE_UPDATE !="") {
00086          $update=@file_get_contents(SITE_UPDATE);
00087          if ($update > $version_noalyss ) {
00088                  echo '<div class="inner_box" style="margin-left:0px;margin-top:3px;left:3px">';
00089                  echo '<p class="notice">';
00090                  echo "Mise à jour disponible de NOALYSS version actuelle : $update votre version $version_noalyss";
00091                  echo '</p>';
00092                  echo '</div>';
00093          }
00094         }
00095 }
00096 
00097 include_once("user_menu.php");
00098 $priv=($User->admin==1)?_("Administrateur"):_("Utilisateur");
00099 load_all_script();
00100 if ( isset ($_POST['set_preference'])) {
00101     //// Save value
00102     extract($_POST);
00103 
00104     if (strlen(trim($pass_1)) != 0 && strlen(trim($pass_2)) != 0)
00105     {
00106         $User->save_password($pass_1,$pass_2);
00107         
00108     }
00109     $User->save_global_preference('THEME', $style_user);
00110     $User->save_global_preference('LANG', $lang);
00111     $_SESSION['g_theme']=$style_user;
00112     $_SESSION['g_lang']=$lang;
00113 }
00114 echo '<div class="welcome"> ';
00115 /**
00116  *
00117  * If the user is NOT admin and can access only ONE folder,
00118  * so it will be directly redirected to this folder or to the plugins of this
00119  * folder if he's an "plugin user"
00120  */
00121 
00122 if ( $User->admin == 0 )
00123 {
00124     // how many folder ?
00125     $folder=$User->get_available_folder();
00126     if ( $folder != null  && count($folder) == 1 )
00127     {
00128 
00129         if ( $User->check_dossier($folder[0]['dos_id']) == 'P')
00130         {
00131             redirect('extension.php?gDossier='.$folder[0]['dos_id']);
00132             exit();
00133         }
00134         else
00135         {
00136             redirect('do.php?gDossier='.$folder[0]['dos_id']);
00137             exit();
00138         }
00139     }
00140 
00141 }
00142 
00143 $result="";
00144 $result.="<table border=\"0\">";
00145 $result.='<TR>';
00146 if ( $User->Admin()  == 1 )
00147 {
00148     $result.="<TD  class=\"tool\" ><A class=\"cell\" HREF=\"admin_repo.php\"> Administration  </A></TD>";
00149 }
00150 $result.='<TD class="tool">';
00151 $result.='<a onclick="set_preference(0)" title="Préférence" href="javascript:void(0)" class="cell">'._('Préférence').'</a>';
00152 $result.= '</TD>';
00153 $result.='<TD  class="tool" ><A class="cell" HREF="logout.php" >'._('Deconnexion').'</a></TD>';
00154 $result.="</TR>";
00155 $result.="</table>";
00156 
00157 echo '<h2 class="info">'._('Bienvenue')."  ".$User->first_name.'  '.$User->name.'   '._("dans NOALYSS")."</h2>";
00158 echo '<div id="module">'.$result.'</div>';
00159 echo '</div>';
00160 ?>
00161 <div class="foldercontent">
00162 <?php echo '<h2 >'._('Choisissez un dossier').'</h2>';?>
00163         <span style="display:block;margin:2.5%">
00164  <?php
00165                         echo _('Filtre').HtmlInput::infobulle(23);
00166 ?>
00167 <?php
00168         echo HtmlInput::filter_table("folder", '1,2',0);
00169 ?>
00170 </span>
00171 <?php
00172 
00173 // If admin show everything otherwise only the available dossier
00174 $res=$User->show_dossier("");
00175 echo $res;
00176 ?>
00177 <P>
00178 
00179 </P>
00180 <?php
00181 html_page_stop();
00182 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations