/[phpcompta]/phpcompta/html/sec_pdf.php
ViewVC logotype

Diff of /phpcompta/html/sec_pdf.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by stanpinte, Mon Mar 21 09:34:22 2005 UTC revision 1.2 by sparkyx, Fri Apr 29 09:44:22 2005 UTC
# Line 18  Line 18 
18   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */  */
20  // Copyright Stanislas Pinte stanpinte@sauvages.be  // Copyright Stanislas Pinte stanpinte@sauvages.be
21    
22  // $Revision$  // $Revision$
23    
24    
25  if ( ! isset($_SESSION['g_dossier']) ) {  if ( ! isset($_SESSION['g_dossier']) ) {
26    echo "INVALID G_DOSSIER UNKNOWN !!! ";    echo "INVALID G_DOSSIER UNKNOWN !!! ";
27    exit();    exit();
# Line 27  if ( ! isset($_SESSION['g_dossier']) ) { Line 29  if ( ! isset($_SESSION['g_dossier']) ) {
29  include_once("ac_common.php");  include_once("ac_common.php");
30  include_once("postgres.php");  include_once("postgres.php");
31  include_once("class.ezpdf.php");  include_once("class.ezpdf.php");
32    require_once("check_priv.php");
33  echo_debug(__FILE__,__LINE__,"imp pdf securité");  echo_debug(__FILE__,__LINE__,"imp pdf securité");
34  $cn=DbConnect($_SESSION['g_dossier']);  $cn=DbConnect($_SESSION['g_dossier']);
35    //////////////////////////////////////////////////////////////////////
36    // Security
37    
38    // Check User
39    $rep=DbConnect();
40    include_once ("class_user.php");
41    $User=new cl_user($rep);
42    $User->Check();
43    // Check Priv
44    if ( $User->CheckAction($cn,SECU) == 0 ) {
45      /* Cannot Access */
46      NoAccess();
47      exit -1;
48     }
49    //////////////////////////////////////////////////////////////////////
50    // Get User's info
51    if ( ! isset($_GET['user_id']) )
52      return;
53    
54    $SecUser=new cl_user($rep,$_GET['user_id']);
55    
56    
57    //////////////////////////////////////////////////////////////////////
58    // Print result
59    
60  $pdf=& new Cezpdf("A4");  $pdf=& new Cezpdf("A4");
61  $pdf->selectFont('./addon/fonts/Helvetica.afm');  $pdf->selectFont('./addon/fonts/Helvetica.afm');
62    $str_user=sprintf("( %d ) %s %s [ %s ]",
63                      $SecUser->id,
64                      $SecUser->first_name,
65                      $SecUser->name,
66                      $SecUser->login);
67    
68    $pdf->ezText($str_user,14,array('justification'=>'center'));
69    
70    if ( $SecUser->active==0)
71      $pdf->ezText('Bloqué',12,array('justification'=>'center'));
72    
73    if ( $SecUser->admin==1)
74      $pdf->ezText('Administrateur',12,array('justification'=>'center'));
75    //////////////////////////////////////////////////////////////////////
76    // Journal
77    $Res=ExecSql($cn,"select jrn_def_id,jrn_def_name  from jrn_def ");
78    for ($e=0;$e < pg_NumRows($Res);$e++) {
79      $row=pg_fetch_array($Res,$e);
80      $a_jrn[$e]['jrn_name']=$row['jrn_def_name'];
81      $priv=CheckJrn($_SESSION['g_dossier'],$SecUser->login,$row['jrn_def_id']);
82      switch($priv) {
83      case 0:
84        $a_jrn[$e]['priv']="pas d'accès";
85        break;
86      case 1:
87        $a_jrn[$e]['priv']="lecture";
88        break;
89      case 2:
90      case 3:
91        $a_jrn[$e]['priv']="Ecriture";
92        break;
93      }
94    
95     }
96    $pdf->ezTable($a_jrn,
97                    array ('jrn_name'=>' Journal',
98                           'priv'=>'Privilège')," ",
99                    array('shaded'=>0,'showHeadings'=>1,'width'=>500));
100    
101    ////////////////////////////////////////////////////////////////////////
102    // Action
103    $Res=ExecSql($cn,
104                 "select ac_id, ac_description from action   order by ac_description ");
105    
106    $Max=pg_NumRows($Res);
107    
108    for ( $i =0 ; $i < $Max; $i++ ) {
109       $l_line=pg_fetch_array($Res,$i);
110       $action['lib']=$l_line['ac_description'];
111       $right=CheckAction($_SESSION['g_dossier'],$SecUser->login,$l_line['ac_id']);
112       switch ($right) {
113       case 0:
114         $action['priv']="Pas d'accès";
115         break;
116       case 1:
117       case 2:
118         $action['priv']="Accès";
119         break;
120       }
121       $a_action[$i]=$action;
122     }
123    $pdf->ezTable($a_action ,
124                    array ('lib'=>'Description',
125                           'priv'=>'Privilège')," ",
126                    array('shaded'=>0,'showHeadings'=>1,'width'=>500));
127    
128    
 $pdf->ezText("hello",12,array('justification'=>'right'));  
129  $pdf->ezStream();  $pdf->ezStream();
130    
131  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26