00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 if ( ! isset($_SESSION['g_dossier']) ) {
00028 echo "INVALID G_DOSSIER UNKNOWN !!! ";
00029 exit();
00030 }
00031 include_once("ac_common.php");
00032 include_once("postgres.php");
00033 include_once("class.ezpdf.php");
00034 require_once("check_priv.php");
00035 echo_debug('sec_pdf.php',__LINE__,"imp pdf securité");
00036 $cn=DbConnect($_SESSION['g_dossier']);
00037
00038
00039
00040
00041 $rep=DbConnect();
00042 include_once ("class_user.php");
00043 $User=new cl_user($rep);
00044 $User->Check();
00045
00046 if ( $User->CheckAction($cn,SECU) == 0 ) {
00047
00048 NoAccess();
00049 exit -1;
00050 }
00051
00052
00053 if ( ! isset($_GET['user_id']) )
00054 return;
00055
00056 $SecUser=new cl_user($rep,$_GET['user_id']);
00057
00058
00059
00060
00061
00062 $pdf=& new Cezpdf("A4");
00063 $pdf->selectFont('./addon/fonts/Helvetica.afm');
00064 $str_user=sprintf("( %d ) %s %s [ %s ]",
00065 $SecUser->id,
00066 $SecUser->first_name,
00067 $SecUser->name,
00068 $SecUser->login);
00069
00070 $pdf->ezText($str_user,14,array('justification'=>'center'));
00071
00072 if ( $SecUser->active==0)
00073 $pdf->ezText('Bloqué',12,array('justification'=>'center'));
00074
00075 if ( $SecUser->admin==1)
00076 $pdf->ezText('Administrateur',12,array('justification'=>'center'));
00077
00078
00079 $Res=ExecSql($cn,"select jrn_def_id,jrn_def_name from jrn_def ");
00080 for ($e=0;$e < pg_NumRows($Res);$e++) {
00081 $row=pg_fetch_array($Res,$e);
00082 $a_jrn[$e]['jrn_name']=$row['jrn_def_name'];
00083 $priv=CheckJrn($_SESSION['g_dossier'],$SecUser->login,$row['jrn_def_id']);
00084 switch($priv) {
00085 case 0:
00086 $a_jrn[$e]['priv']="pas d'accès";
00087 break;
00088 case 1:
00089 $a_jrn[$e]['priv']="lecture";
00090 break;
00091 case 2:
00092 case 3:
00093 $a_jrn[$e]['priv']="Ecriture";
00094 break;
00095 }
00096
00097 }
00098 $pdf->ezTable($a_jrn,
00099 array ('jrn_name'=>' Journal',
00100 'priv'=>'Privilège')," ",
00101 array('shaded'=>0,'showHeadings'=>1,'width'=>500));
00102
00103
00104
00105 $Res=ExecSql($cn,
00106 "select ac_id, ac_description from action order by ac_description ");
00107
00108 $Max=pg_NumRows($Res);
00109
00110 for ( $i =0 ; $i < $Max; $i++ ) {
00111 $l_line=pg_fetch_array($Res,$i);
00112 $action['lib']=$l_line['ac_description'];
00113 $right=CheckAction($_SESSION['g_dossier'],$SecUser->login,$l_line['ac_id']);
00114 switch ($right) {
00115 case 0:
00116 $action['priv']="Pas d'accès";
00117 break;
00118 case 1:
00119 case 2:
00120 $action['priv']="Accès";
00121 break;
00122 }
00123 $a_action[$i]=$action;
00124 }
00125 $pdf->ezTable($a_action ,
00126 array ('lib'=>'Description',
00127 'priv'=>'Privilège')," ",
00128 array('shaded'=>0,'showHeadings'=>1,'width'=>500));
00129
00130
00131 $pdf->ezStream();
00132
00133 ?>