]> git.llucax.com Git - mecon/samurai.git/blob - doc/apidoc/html/Samurai_8php-source.html
Se agrega SAMURAI_Perm para manejar los permisos desde las aplicaciones.
[mecon/samurai.git] / doc / apidoc / html / Samurai_8php-source.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>SAMURAI: Samurai.php Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generado por Doxygen 1.3.2 -->
7 <div class="qindex"><a class="qindex" href="main.html">Página&nbsp;principal</a> | <a class="qindex" href="classes.html">Lista&nbsp;alfabética</a> | <a class="qindex" href="annotated.html">Lista&nbsp;de&nbsp;componentes</a> | <a class="qindex" href="files.html">Lista&nbsp;de&nbsp;archivos</a> | <a class="qindex" href="functions.html">Miembros&nbsp;de&nbsp;las&nbsp;clases</a></div>
8 <h1>Samurai.php</h1><a href="Samurai_8php.html">Ir a la documentación de este archivo.</a><div class="fragment"><pre>00001 &lt;?php
9 00002 <span class="comment">// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:</span>
10 00003 <span class="comment">// +----------------------------------------------------------------------+</span>
11 00004 <span class="comment">// | PHP Version 4                                                        |</span>
12 00005 <span class="comment">// +----------------------------------------------------------------------+</span>
13 00006 <span class="comment">// | Copyright (c) 1997-2003 The PHP Group                                |</span>
14 00007 <span class="comment">// +----------------------------------------------------------------------+</span>
15 00008 <span class="comment">// | This source file is subject to version 2.02 of the PHP license,      |</span>
16 00009 <span class="comment">// | that is bundled with this package in the file LICENSE, and is        |</span>
17 00010 <span class="comment">// | available at through the world-wide-web at                           |</span>
18 00011 <span class="comment">// | http://www.php.net/license/2_02.txt.                                 |</span>
19 00012 <span class="comment">// | If you did not receive a copy of the PHP license and are unable to   |</span>
20 00013 <span class="comment">// | obtain it through the world-wide-web, please send a note to          |</span>
21 00014 <span class="comment">// | license@php.net so we can mail you a copy immediately.               |</span>
22 00015 <span class="comment">// +----------------------------------------------------------------------+</span>
23 00016 <span class="comment">// | Created: Tue May 27 17:05:58 2003</span>
24 00017 <span class="comment">// | Author:  Martin Marrese - Myrna Degano &lt;mmarre@mecon.gov.ar - mdegan@mecon.gov.ar&gt;</span>
25 00018 <span class="comment">// +----------------------------------------------------------------------+</span>
26 00019 <span class="comment">//</span>
27 00020 <span class="comment">// $Id: Samurai.php 26 2003-07-07 22:45:35Z mmarre $</span>
28 00021 <span class="comment">// $Author: mmarre $</span>
29 00022 <span class="comment">// $URL: http://portal.mecon.ar/svn/samurai/tronco/lib/SAMURAI/Samurai.php $</span>
30 00023 <span class="comment">// $Date: 2003-07-07 19:45:35 -0300 (Mon, 07 Jul 2003) $</span>
31 00024 <span class="comment">// $Rev: 26 $</span>
32 00025 <span class="comment">//</span>
33 00026 
34 00027 <span class="preprocessor">#require_once 'PEAR.php';</span>
35 00028 <span class="preprocessor"></span>require_once 'Sistema.php';
36 00029 require_once 'Usuario.php';
37 00030 require_once 'Permiso.php';
38 00031 require_once 'Perfil.php';
39 00032 
40 00033 
41 00034 
42 00035 <span class="comment">// +X2C Class 274 :Samurai</span>
43 <a name="l00041"></a><a class="code" href="classSamurai.html">00041</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classSamurai.html">Samurai</a> {
44 <a name="l00048"></a><a class="code" href="classSamurai.html#o0">00048</a>     var $<a class="code" href="classSamurai.html#o0">_id_sistema</a>;
45 00049 
46 <a name="l00056"></a><a class="code" href="classSamurai.html#o1">00056</a>     var $<a class="code" href="classSamurai.html#o1">_db</a>;
47 00057 
48 00058     <span class="comment">// ~X2C</span>
49 00059 
50 00060     <span class="comment">// +X2C Operation 280</span>
51 <a name="l00070"></a><a class="code" href="classSamurai.html#a0">00070</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a0">Samurai</a>(&amp;$db, $idSistema = null) <span class="comment">// ~X2C</span>
52 00071     {
53 00072         $this-&gt;<a class="code" href="classSamurai.html#o0">_id_sistema</a> = $idSistema;
54 00073         $this-&gt;<a class="code" href="classSamurai.html#o1">_db</a> = &amp;$db;
55 00074     }
56 00075     <span class="comment">// -X2C</span>
57 00076 
58 00077     <span class="comment">// +X2C Operation 283</span>
59 <a name="l00084"></a><a class="code" href="classSamurai.html#a1">00084</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a1">_getIdSistemas</a>() <span class="comment">// ~X2C</span>
60 00085     {
61 00086         $rta = array();
62 00087         $sql = include 'Samurai/consultas.php';
63 00088         $dbh = $this-&gt;<a class="code" href="classSamurai.html#o1">_db</a>-&gt;prepare($sql['obtener_id_sistemas']);
64 00089         $res = $this-&gt;<a class="code" href="classSamurai.html#o1">_db</a>-&gt;execute($dbh);
65 00090         <span class="keywordflow">while</span> ($re = $res-&gt;fetchrow(DB_FETCHMODE_ASSOC)) {
66 00091             array_push($rta,$re['id_sistema']);
67 00092         }        
68 00093         $res-&gt;free();
69 00094         <span class="keywordflow">return</span> $rta;
70 00095     }
71 00096     <span class="comment">// -X2C</span>
72 00097 
73 00098     <span class="comment">// +X2C Operation 285</span>
74 <a name="l00105"></a><a class="code" href="classSamurai.html#a2">00105</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a2">_armarArraySistemas</a>() <span class="comment">// ~X2C</span>
75 00106     {
76 00107         $rta = array ();
77 00108         foreach ($this-&gt;_getIdSistemas() as $id) {
78 00109             $tmp = <span class="keyword">new</span> Sistema($this-&gt;_db,$id);
79 00110             array_push($rta, $tmp);
80 00111         }
81 00112         <span class="keywordflow">return</span> $rta;
82 00113     }
83 00114     <span class="comment">// -X2C</span>
84 00115 
85 00116     <span class="comment">// +X2C Operation 286</span>
86 <a name="l00123"></a><a class="code" href="classSamurai.html#a3">00123</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a3">getSistemas</a>() <span class="comment">// ~X2C</span>
87 00124     {
88 00125         <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classSamurai.html#a2">_armarArraySistemas</a>();
89 00126     }
90 00127     <span class="comment">// -X2C</span>
91 00128 
92 00129 
93 00130 
94 00131 
95 00132 
96 00133 
97 00134     <span class="comment">// +X2C Operation 320</span>
98 <a name="l00141"></a><a class="code" href="classSamurai.html#a4">00141</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a4">getSelectSistemas</a>() <span class="comment">// ~X2C</span>
99 00142     {
100 00143         $rta = array ();
101 00144         foreach ($this-&gt;_armarArraySistemas() as $sistema) {
102 00145             $rta[$sistema-&gt;getId()] = $sistema-&gt;getNombre();
103 00146         }
104 00147         <span class="keywordflow">return</span> $rta;
105 00148     }
106 00149     <span class="comment">// -X2C</span>
107 00150 
108 00151     <span class="comment">// +X2C Operation 327</span>
109 <a name="l00156"></a><a class="code" href="classSamurai.html#a5">00156</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a5">getPerfiles</a>() <span class="comment">// ~X2C</span>
110 00157     {
111 00158         <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classSamurai.html#a6">_armarArrayPerfiles</a>();
112 00159     }
113 00160     <span class="comment">// -X2C</span>
114 00161 
115 00162     <span class="comment">// +X2C Operation 328</span>
116 <a name="l00167"></a><a class="code" href="classSamurai.html#a6">00167</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a6">_armarArrayPerfiles</a>() <span class="comment">// ~X2C</span>
117 00168     {
118 00169         $rta = array ();
119 00170         foreach ($this-&gt;_getIdPerfiles() as $id) {
120 00171             $tmp = <span class="keyword">new</span> Perfil($this-&gt;_db,$id);
121 00172             array_push($rta, $tmp);
122 00173         }
123 00174         <span class="keywordflow">return</span> $rta;
124 00175     }
125 00176     <span class="comment">// -X2C</span>
126 00177 
127 00178     <span class="comment">// +X2C Operation 329</span>
128 <a name="l00185"></a><a class="code" href="classSamurai.html#a7">00185</a> <span class="comment"></span>    function <a class="code" href="classSamurai.html#a7">_getIdPerfiles</a>() <span class="comment">// ~X2C</span>
129 00186     {
130 00187         $rta = array();
131 00188         $sql = include 'Samurai/consultas.php';
132 00189         $dbh = $this-&gt;<a class="code" href="classSamurai.html#o1">_db</a>-&gt;prepare($sql['obtener_id_perfiles']);
133 00190         $tmp[] = $_SESSION['samurai']['id_sistema'];
134 00191         $res = $this-&gt;<a class="code" href="classSamurai.html#o1">_db</a>-&gt;execute($dbh, $tmp);
135 00192         <span class="keywordflow">while</span> ($re = $res-&gt;fetchrow(DB_FETCHMODE_ASSOC)) {
136 00193             array_push($rta,$re['id_perfil']);
137 00194         }        
138 00195         $res-&gt;free();
139 00196         <span class="keywordflow">return</span> $rta;
140 00197     }
141 00198     <span class="comment">// -X2C</span>
142 00199 
143 00200 } <span class="comment">// -X2C Class :Samurai</span>
144 00201 
145 00202 ?&gt;
146 </pre></div><hr size="1"><address style="align: right;"><small>Generado el Tue Jul 8 11:36:21 2003 para SAMURAI por
147 <a href="http://www.doxygen.org/index.html">
148 <img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
149 </a>1.3.2 </small></address>
150 </body>
151 </html>