\fi-360\li5040\jclisttab\tx5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201981955\'01o;}{\levelnumbers;}\f2\chbrdr\brdrnone\brdrcf1 \r
\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li5760\jclisttab\tx5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid201981957\'01\u-3929 ?;}{\levelnumbers;}\f14\chbrdr\r
\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li6480\jclisttab\tx6480 }{\listname ;}\listid1648389061}}{\*\listoverridetable{\listoverride\listid1648389061\listoverridecount0\ls1}}{\info{\title ADMINISTRACI\'d3N DE USUARIOS}\r
-{\author Dir. Gral. de Inform\'e1tica}{\operator Dir. Gral. de Inform\'e1tica}{\creatim\yr2003\mo3\dy6\hr19\min20}{\revtim\yr2003\mo7\dy11\hr12\min29}{\printim\yr2003\mo2\dy6\hr11\min4}{\version21}{\edmins37}{\nofpages8}{\nofwords1101}{\nofchars6280}\r
+{\author Dir. Gral. de Inform\'e1tica}{\operator Dir. Gral. de Inform\'e1tica}{\creatim\yr2003\mo3\dy6\hr19\min20}{\revtim\yr2003\mo7\dy15\hr15\min1}{\printim\yr2003\mo2\dy6\hr11\min4}{\version22}{\edmins36}{\nofpages8}{\nofwords1101}{\nofchars6280}\r
{\*\company Ministerio de Econom\'eda}{\nofcharsws0}{\vern8249}}\paperw11907\paperh16840\margl1134\margr1134\margt1134\margb1134 \r
\deftab708\widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1134\dgvorigin1134\dghshow1\dgvshow1\r
\jexpand\viewkind1\viewscale75\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule \fet0\sectd \psz9\linex0\headery680\footery680\colsx708\endnhere\sectlinegrid360\sectdefaultcl \r
\par }}{\footer \trowd \trgaph70\trleft-70\trbrdrt\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trftsWidth1\trautofit1\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \r
\cltxlrtb\clftsWidth3\clwWidth4889 \cellx4819\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth4890 \cellx9709\pard\plain \s16\qj \li0\ri0\widctlpar\intbl\r
\tqc\tx4419\tqr\tx8838\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \f28\fs20\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {\fs18 06-03-2003\cell }\pard \s16\qr \li0\ri0\widctlpar\intbl\r
-\tqc\tx4419\tqr\tx8838\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\fs18 P\'e1gina }{\field{\*\fldinst {\fs18 PAGE }}{\fldrslt {\fs18\lang1024\langfe1024\noproof 7}}}{\fs18 de }{\field{\*\fldinst {\fs18 NUMPAGES }}{\fldrslt {\r
+\tqc\tx4419\tqr\tx8838\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\fs18 P\'e1gina }{\field{\*\fldinst {\fs18 PAGE }}{\fldrslt {\fs18\lang1024\langfe1024\noproof 6}}}{\fs18 de }{\field{\*\fldinst {\fs18 NUMPAGES }}{\fldrslt {\r
\fs18\lang1024\langfe1024\noproof 8}}}{\fs18 \cell }\pard\plain \qj \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \f28\fs20\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {\trowd \trgaph70\trleft-70\trbrdrt\brdrs\brdrw10 \r
\trbrdrh\brdrs\brdrw10 \trftsWidth1\trautofit1\trpaddl70\trpaddr70\trpaddfl3\trpaddfr3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth4889 \cellx4819\clvertalt\clbrdrt\brdrs\brdrw10 \r
\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth4890 \cellx9709\row }\pard\plain \s16\qj \li0\ri0\widctlpar\tqc\tx4419\tqr\tx8838\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \r
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff02000000111a020000000000c00000000000004600000000000000000000000060ec\r
-7349c147c30103000000000200000000000001004f006c00650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000\r
+ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff02000000111a020000000000c0000000000000460000000000000000000000008020\r
+d01afb4ac30103000000000200000000000001004f006c00650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000\r
0000000000000000000000001400000000000000010043006f006d0070004f0062006a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120002010100000004000000ffffffff0000000000000000000000000000000000000000000000000000\r
0000000000000000000001000000690000000000000003004f0062006a0049006e0066006f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000201ffffffffffffffffffffffff000000000000000000000000000000000000000000000000\r
000000000000000000000000030000000400000000000000feffffff02000000fefffffffefffffffeffffff0600000007000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
\par }\pard\plain \qj \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f28\fs20\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {Cada uno de los perfiles administrados.\r
\par }{\ul id_perfil\r
\par }{desc_perfil\r
-\par tipo_perfil *\r
\par fecha\r
\par responsable\r
\par \r
\par }{Asociaci\'f3n entre los perfiles y el sistema al cual corresponden.\r
\par }{\ul R3\r
\par R4\r
+\par }{tipo_perfil *}{\ul \r
\par }\pard\plain \qj \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f28\fs20\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {fecha\r
\par responsable\r
\par }\pard\plain \s15\qj \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f28\fs20\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 {\r
\par {\listtext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \qj \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0 {Los datos del personal de la Ex \endash Coordinaci\'f3n \'c1\r
rea Desarrollo y Mantenimiento involucrado en el desarrollo de cada uno de los sistemas, forman parte de la entidad }{\i USUARIO,}{ relacionada al sistema correspondiente mediante la asignaci\'f3n de un perfil, identificando el rol que desempe\'f1\'f3\r
la persona (ejs.: programador, dise\'f1ador gr\'e1fico, analista de sistemas, etc.).\r
-\par }\pard \qj \li708\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin708\itap0 {El atributo }{\i tipo_perfil}{ de la entidad }{\i PERFIL}{\r
+\par }\pard \qj \li360\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\r
+\par {\listtext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \qj \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0 {El atributo }{\i tipo_perfil}{ de la entidad }{\i PERFIL/SISTEMA}{\r
diferencia perfiles internos y externos, es decir, si se trata de perfiles definidos para usuarios de los sistemas, o bien de roles desempe\'f1ados durante el desarrollo del proyecto (perfiles privados).\r
\par }\pard \qj \li360\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\r
\par {\listtext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \qj \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0 {El atributo }{\i contacto}{ de la entidad }{\i SISTEMA}{\r
\par CREATE TABLE perfil (\r
\par id_perfil bigint(20) NOT NULL auto_increment,\r
\par }{\f2\fs22\lang2058\langfe3082\langnp2058 desc_perfil varchar(50),\r
-\par tipo_perfil char(1), \r
-\par }{\f2\fs22\lang1033\langfe3082\langnp1033 fch_ult_modif timestamp,\r
+\par }{\f2\fs22\lang1033\langfe3082\langnp1033 fch_ult_modif timestamp,\r
\par }{\f2\fs22\lang2058\langfe3082\langnp2058 responsable varchar(20),\r
\par PRIMARY KEY (id_perfil)\r
\par ); \r
\par CREATE TABLE perfil_sist (\r
\par id_perfil bigint(20) NOT NULL,\r
\par id_sistema bigint(20) NOT NULL,\r
-\par fch_ult_modif timestamp,\r
+\par }{\f2\fs22\lang2058\langfe3082\langnp2058 tipo_perfil char(1), \r
+\par }{\f2\fs22\lang1033\langfe3082\langnp1033 fch_ult_modif timestamp,\r
\par }{\f2\fs22\lang2058\langfe3082\langnp2058 responsable varchar(20),\r
\par PRIMARY KEY (id_perfil, id_sistema)\r
\par ); \r
\par id_permiso bigint(20) NOT NULL,\r
\par id_perfil bigint(20) NOT NULL,\r
\par id_sistema bigint(20) NOT NULL,\r
-\par }{\f2\fs22\lang2058\langfe3082\langnp2058 observaciones varchar(255) NOT NULL,\r
-\par }{\f2\fs22\lang1033\langfe3082\langnp1033 fch_ult_modif timestamp,\r
+\par fch_ult_modif timestamp,\r
\par }{\f2\fs22\lang2058\langfe3082\langnp2058 responsable varchar(20),\r
-\par PRIMARY KEY (id_permiso, id_perfil, id_sistema, observaciones)\r
+\par PRIMARY KEY (id_permiso, id_perfil, id_sistema)\r
\par ); \r
\par \r
\par \r
\par CREATE TABLE perm_sist (\r
\par id_permiso bigint(20) NOT NULL,\r
\par id_sistema bigint(20) NOT NULL,\r
-\par }{\f2\fs22\lang2058\langfe3082\langnp2058 observaciones varchar(255) NOT NULL,\r
-\par }{\f2\fs22\lang1033\langfe3082\langnp1033 fch_ult_modif timestamp,\r
-\par }{\f2\fs22\lang2058\langfe3082\langnp2058 responsable varchar(20),\r
+\par }{\f2\fs22\lang2058\langfe3082\langnp2058 observaciones varchar(255),\r
+\par fch_ult_modif timestamp,\r
+\par responsable varchar(20),\r
\par PRIMARY KEY (id_permiso, id_sistema, observaciones)\r
\par ); \r
\par \r
<XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
</XMI.header>
<XMI.content>
- <docsettings viewid="336" documentation="" uniqueid="364" />
+ <docsettings viewid="336" documentation="" uniqueid="374" />
<umlobjects>
<UML:Class stereotype="" package="" xmi.id="207" abstract="0" documentation="Clase para el manejo de los usuarios." name="SAMURAI_Usuario" static="0" scope="200" >
<UML:Operation stereotype="" package="" xmi.id="216" type="void" abstract="0" documentation="Constructor.Recibe como parametro opcional el login del usuario. y busca en la base la informacion referida a el." name="SAMURAI_Usuario" static="0" scope="200" >
<UML:Parameter stereotype="" package="" xmi.id="2" value="" type="&SAMURAI_DB" abstract="0" documentation="Objeto conexion." name="db" static="0" scope="200" />
<UML:Parameter stereotype="" package="" xmi.id="3" value="null" type="string" abstract="0" documentation="Login del usuario" name="login" static="0" scope="200" />
</UML:Operation>
- <UML:Attribute stereotype="" package="" xmi.id="211" value="" type="string" abstract="0" documentation="Login del usuario en intranet.x2c: get set" name="login" static="0" scope="202" />
+ <UML:Operation stereotype="" package="" xmi.id="365" type="array(string)" abstract="0" documentation="Devuleve un array con los login's de los usuarios asociados al sistema" name="getLoginUsuarios" static="1" scope="202" >
+ <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&SAMURAI_DB" abstract="0" documentation="Base de Datos" name="db" static="0" scope="200" />
+ <UML:Parameter stereotype="" package="" xmi.id="2" value="null" type="int" abstract="0" documentation="Identificador del sistema" name="id_sistema" static="0" scope="200" />
+ </UML:Operation>
+ <UML:Operation stereotype="" package="" xmi.id="366" type="array()" abstract="0" documentation="Devuelve un array asociativo en donde la clave es el login y el valor es el nombre del usuario" name="getArrayUsuarios" static="1" scope="200" >
+ <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&SAMURAI_DB" abstract="0" documentation="Base de Datos" name="db" static="0" scope="200" />
+ <UML:Parameter stereotype="" package="" xmi.id="2" value="null" type="int" abstract="0" documentation="Identificador del sistema" name="id_sistema" static="0" scope="200" />
+ </UML:Operation>
+ <UML:Operation stereotype="" package="" xmi.id="367" type="array(Permiso)" abstract="0" documentation="Devuelve el array de usuarios" name="getUsuarios" static="1" scope="200" >
+ <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&SAMURAI_DB" abstract="0" documentation="Base de Datos" name="db" static="0" scope="200" />
+ <UML:Parameter stereotype="" package="" xmi.id="2" value="null" type="int" abstract="0" documentation="Identificador del sistema" name="id_sistema" static="0" scope="200" />
+ </UML:Operation>
+ <UML:Operation stereotype="" package="" xmi.id="368" type="void" abstract="0" documentation="Obtiene de la base de datos la informacion del usuario" name="obtenerDatosDb" static="0" scope="202" />
+ <UML:Operation stereotype="" package="" xmi.id="370" type="mixed" abstract="0" documentation="Modifica la base de datos segun accion" name="guardarDatos" static="0" scope="200" >
+ <UML:Parameter stereotype="" package="" xmi.id="1" value="grabar" type="string" abstract="0" documentation="Indica la accion a realizar" name="accion" static="0" scope="200" />
+ </UML:Operation>
+ <UML:Operation stereotype="" package="" xmi.id="371" type="mixed" abstract="0" documentation="Graba en base la relacion" name="grabarDb" static="0" scope="202" />
+ <UML:Operation stereotype="" package="" xmi.id="372" type="mixed" abstract="0" documentation="Borra de la base la relacion" name="borrarDb" static="0" scope="202" />
+ <UML:Operation stereotype="" package="" xmi.id="373" type="mixed" abstract="0" documentation="Actualiza los datos de la relacion" name="modificarDb" static="0" scope="202" />
+ <UML:Operation stereotype="" package="" xmi.id="374" type="mixed" abstract="0" documentation="Verifica si el login actual es valido" name="verificarLogin" static="0" scope="200" />
+ <UML:Attribute stereotype="" package="" xmi.id="211" value="" type="string" abstract="0" documentation="Login del usuario en intranet.
+x2c: get set" name="login" static="0" scope="202" />
<UML:Attribute stereotype="" package="" xmi.id="212" value="" type="int" abstract="0" documentation="Numero de documento del usuario
x2c: get set" name="nrodoc" static="0" scope="202" />
<UML:Attribute stereotype="" package="" xmi.id="213" value="" type="string" abstract="0" documentation="Nombre del usuario
x2c: get set" name="nombre" static="0" scope="202" />
- <UML:Attribute stereotype="" package="" xmi.id="214" value="" type="date" abstract="0" documentation="Fecha de ultimo logueo del usuario a la intranet.
-x2c: get set" name="fecha" static="0" scope="202" />
<UML:Attribute stereotype="" package="" xmi.id="273" value="" type="SAMURAI_DB" abstract="0" documentation="Objeto Samurai_DB" name="db" static="0" scope="202" />
+ <UML:Attribute stereotype="" package="" xmi.id="369" value="" type="array(int)" abstract="0" documentation="Array con los identificadores de los perfiles asociados a un usuario
+x2c:get set" name="perfiles" static="0" scope="202" />
</UML:Class>
<UML:Class stereotype="" package="" xmi.id="208" abstract="0" documentation="Clase para el manejo de los perfies." name="SAMURAI_Perfil" static="0" scope="200" >
<UML:Operation stereotype="" package="" xmi.id="229" type="void" abstract="0" documentation="Constructor. Si recibe un identificador como parametro, busca la informacion en la base. " name="SAMURAI_Perfil" static="0" scope="200" >
<diagrams>
<diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="206" documentation="" type="402" showops="1" showpackage="0" name="Clases y Relaciones" localid="30000" showstereotype="0" showscope="1" font="helvetica,8,-1,0,50,0,0,0,0,0" linecolor="#ff0000" >
<widgets>
- <UML:ConceptWidget usesdiagramfillcolour="0" width="128" showattsigs="601" usesdiagramusefillcolour="0" x="750" linecolour="#ff0000" y="290" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="98" usefillcolor="1" showattributes="1" xmi.id="207" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="128" showattsigs="601" usesdiagramusefillcolour="0" x="750" linecolour="#ff0000" y="290" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="224" usefillcolor="1" showattributes="1" xmi.id="207" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
<UML:ConceptWidget usesdiagramfillcolour="0" width="126" showattsigs="601" usesdiagramusefillcolour="0" x="640" linecolour="#ff0000" y="10" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="280" usefillcolor="1" showattributes="1" xmi.id="208" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
<UML:ConceptWidget usesdiagramfillcolour="0" width="165" showattsigs="601" usesdiagramusefillcolour="0" x="200" linecolour="#ff0000" y="10" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="630" usefillcolor="1" showattributes="1" xmi.id="209" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
<UML:ConceptWidget usesdiagramfillcolour="0" width="131" showattsigs="601" usesdiagramusefillcolour="0" x="480" linecolour="#ff0000" y="310" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="210" usefillcolor="1" showattributes="1" xmi.id="210" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
<UML:AssocWidget totalcounta="3" indexa="2" totalcountb="2" indexb="1" widgetbid="207" widgetaid="265" documentation="" type="501" >
<linepath>
<startpoint startx="537" starty="155" />
- <endpoint endx="750" endy="339" />
+ <endpoint endx="750" endy="402" />
</linepath>
</UML:AssocWidget>
</associations>
</diagram>
<diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="336" documentation="" type="402" showops="1" showpackage="0" name="Clases" localid="30000" showstereotype="0" showscope="1" font="helvetica,8,-1,0,50,0,0,0,0,0" linecolor="#ff0000" >
<widgets>
- <UML:ConceptWidget usesdiagramfillcolour="0" width="46" showattsigs="601" usesdiagramusefillcolour="0" x="420" linecolour="#ff0000" y="10" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#d5d5cf" height="28" usefillcolor="1" showattributes="1" xmi.id="264" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
- <UML:ConceptWidget usesdiagramfillcolour="0" width="469" showattsigs="601" usesdiagramusefillcolour="0" x="20" linecolour="#ff0000" y="350" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="280" usefillcolor="1" showattributes="1" xmi.id="208" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
- <UML:ConceptWidget usesdiagramfillcolour="0" width="396" showattsigs="601" usesdiagramusefillcolour="0" x="30" linecolour="#ff0000" y="130" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="210" usefillcolor="1" showattributes="1" xmi.id="210" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
- <UML:ConceptWidget usesdiagramfillcolour="0" width="95" showattsigs="601" usesdiagramusefillcolour="0" x="400" linecolour="#ff0000" y="70" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="35" usefillcolor="1" showattributes="1" xmi.id="265" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
- <UML:ConceptWidget usesdiagramfillcolour="0" width="558" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="640" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="630" usefillcolor="1" showattributes="1" xmi.id="209" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
- <UML:ConceptWidget usesdiagramfillcolour="0" width="357" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="10" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="98" usefillcolor="1" showattributes="1" xmi.id="207" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="46" showattsigs="601" usesdiagramusefillcolour="0" x="610" linecolour="#ff0000" y="20" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#d5d5cf" height="28" usefillcolor="1" showattributes="1" xmi.id="264" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="469" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="240" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="280" usefillcolor="1" showattributes="1" xmi.id="208" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="396" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="10" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="210" usefillcolor="1" showattributes="1" xmi.id="210" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="95" showattsigs="601" usesdiagramusefillcolour="0" x="590" linecolour="#ff0000" y="80" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="35" usefillcolor="1" showattributes="1" xmi.id="265" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="558" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="540" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="630" usefillcolor="1" showattributes="1" xmi.id="209" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
+ <UML:ConceptWidget usesdiagramfillcolour="0" width="409" showattsigs="601" usesdiagramusefillcolour="0" x="590" linecolour="#ff0000" y="130" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="224" usefillcolor="1" showattributes="1" xmi.id="207" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="helvetica,8,-1,0,50,0,0,0,0,0" />
</widgets>
<messages/>
<associations>
<UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="264" widgetaid="265" documentation="" type="500" >
<linepath>
- <startpoint startx="447" starty="70" />
- <endpoint endx="443" endy="38" />
+ <startpoint startx="637" starty="80" />
+ <endpoint endx="633" endy="48" />
</linepath>
</UML:AssocWidget>
</associations>
<listview>
<listitem open="1" type="800" id="-1" label="Views" >
<listitem open="1" type="801" id="-1" label="Logical View" >
- <listitem open="1" type="803" id="-1" label="Diagramas" >
+ <listitem open="0" type="803" id="-1" label="Diagramas" >
<listitem open="1" type="807" id="336" label="Clases" />
<listitem open="1" type="807" id="206" label="Clases y Relaciones" />
</listitem>
<listitem open="0" type="815" id="229" label="SAMURAI_Perfil" />
<listitem open="0" type="814" id="227" label="tipo" />
</listitem>
- <listitem open="0" type="813" id="210" label="SAMURAI_Permiso" >
+ <listitem open="1" type="813" id="210" label="SAMURAI_Permiso" >
<listitem open="0" type="815" id="364" label="asociadoASistema" />
<listitem open="0" type="815" id="318" label="borrarDb" />
<listitem open="0" type="814" id="270" label="db" />
<listitem open="0" type="815" id="291" label="setResponsable" />
</listitem>
<listitem open="0" type="813" id="207" label="SAMURAI_Usuario" >
+ <listitem open="0" type="815" id="372" label="borrarDb" />
<listitem open="0" type="814" id="273" label="db" />
- <listitem open="0" type="814" id="214" label="fecha" />
+ <listitem open="0" type="815" id="366" label="getArrayUsuarios" />
+ <listitem open="0" type="815" id="365" label="getLoginUsuarios" />
+ <listitem open="0" type="815" id="367" label="getUsuarios" />
+ <listitem open="0" type="815" id="371" label="grabarDb" />
+ <listitem open="0" type="815" id="370" label="guardarDatos" />
<listitem open="0" type="814" id="211" label="login" />
+ <listitem open="0" type="815" id="373" label="modificarDb" />
<listitem open="0" type="814" id="213" label="nombre" />
<listitem open="0" type="814" id="212" label="nrodoc" />
+ <listitem open="0" type="815" id="368" label="obtenerDatosDb" />
+ <listitem open="0" type="814" id="369" label="perfiles" />
<listitem open="0" type="815" id="216" label="SAMURAI_Usuario" />
+ <listitem open="0" type="815" id="374" label="verificarLogin" />
</listitem>
</listitem>
</listitem>
} // -X2C Class :SAMURAI_Permiso
-?>
+?>
\ No newline at end of file
} // -X2C Class :SAMURAI_Sistema
-?>
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2003 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available at through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Created: Tue May 27 11:20:04 2003
-// | Author: Martin Marrese - Myrna Degano <mmarre@mecon.gov.ar - mdegan@mecon.gov.ar>
-// +----------------------------------------------------------------------+
-//
-// $Id$
-// $Author$
-// $URL$
-// $Date$
-// $Rev$
-//
- return array (
- //OBTENER DATOS
- 'obtener_datos_sistema' => 'SELECT id_sistema, nombre_sistema, desc_sistema, fecha_inicio, fecha_fin, fecha_implementacion, contacto,responsable FROM samurai.sistema ',
- 'obtener_datos_sistema2' => ' WHERE id_sistema = ? ',
- 'obtener_permisos' => 'SELECT id_permiso, observaciones FROM samurai.perm_sist WHERE id_sistema = ?',
- 'obtener_permisos2' => ' ORDER BY id_permiso',
- 'obtener_permisos3' => ' AND id_permiso = ?',
- 'obtener_permisos4' => ' AND observaciones = ?',
- 'obtener_max_id_sistemas' => 'SELECT IFNULL(max(id_sistema), 1) as id_sistema FROM samurai.sistema',
- //BORRAR DATOS
- 'borrar_permisos' => 'DELETE FROM samurai.perm_sist WHERE id_sistema = ? ',
- 'borrar_permisos2' => ' AND observaciones = ?',
- 'borrar_permisos3' => ' AND id_permiso = ?',
- );
-?>
// $Rev$
//
-#require_once 'PEAR.php';
-
+require_once 'PEAR.php';
+require_once 'Perfil.php';
// +X2C Class 207 :SAMURAI_Usuario
*/
class SAMURAI_Usuario {
/**
- * Login del usuario en intranet.x2c: get set
+ * Login del usuario en intranet.
*
* @var string $login
* @access protected
var $_nombre;
/**
- * Fecha de ultimo logueo del usuario a la intranet.
+ * Objeto Samurai_DB
*
- * @var date $fecha
+ * @var SAMURAI_DB $db
* @access protected
*/
- var $_fecha;
+ var $_db;
/**
- * Objeto Samurai_DB
+ * Array con los identificadores de los perfiles asociados a un usuario
*
- * @var SAMURAI_DB $db
+ * @var array(int) $perfiles
* @access protected
*/
- var $_db;
+ var $_perfiles;
+
+ /**
+ * Gets Login.
+ *
+ * @return string
+ * @access public
+ */
+ function getLogin()
+ {
+ return $this->_login;
+ }
+ /**
+ * Sets Login.
+ *
+ * @param string $login Login.
+ *
+ * @return void
+ * @access public
+ */
+ function setLogin($login)
+ {
+ $this->_login = $login;
+ }
/**
* Gets Nrodoc.
}
/**
- * Gets Fecha.
+ * Gets Perfiles.
*
- * @return date
+ * @return array(int)
* @access public
*/
- function getFecha()
+ function getPerfiles()
{
- return $this->_fecha;
+ return $this->_perfiles;
}
/**
- * Sets Fecha.
+ * Sets Perfiles.
*
- * @param date $fecha Fecha.
+ * @param array(int) $perfiles Perfiles.
*
* @return void
* @access public
*/
- function setFecha($fecha)
+ function setPerfiles($perfiles)
{
- $this->_fecha = $fecha;
+ $this->_perfiles = $perfiles;
}
// ~X2C
*/
function SAMURAI_Usuario(&$db, $login = null) // ~X2C
{
+ $this->_db = $db;
+ $this->setLogin($login);
if (!is_null($login)) {
- //BUSCAR INFO EN LA DB,
- //SETEAR LAS VI
+ $this->_obtenerDatosDb();
+ }
+ }
+ // -X2C
+
+ // +X2C Operation 365
+ /**
+ * Devuleve un array con los login's de los usuarios asociados al sistema
+ *
+ * @param SAMURAI_DB &$db Base de Datos
+ * @param int $id_sistema Identificador del sistema
+ *
+ * @return array(string)
+ * @access protected
+ * @static
+ */
+ function _getLoginUsuarios(&$db, $id_sistema = null) // ~X2C
+ {
+ //OBTENGO LOS LOGIN DE LA BASE
+ $consulta='';
+ $rta = array();
+ $tmp = array();
+ $sql = parse_ini_file(dirname(__FILE__) . '/Usuario/consultas.ini', true);
+ if ($id_sistema) {
+ $consulta.= $sql['obtener_datos_usuario2'];
+ $tmp[] = $id_sistema;
}
else {
- //INICIALIZO LA VI
- $this->_login = null;
- $this->_nrodoc = null;
- $this->_nombre = null;
- $this->_fecha = null;
+ $consulta = $sql['obtener_datos_usuario'];
}
+ $consulta.= $sql['obtener_datos_usuario4'];
+ $dbh = $db->prepare($consulta);
+ $res = $db->execute($dbh, $tmp);
+ while ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
+ array_push($rta,$re['login']);
+ }
+ $res->free();
+ return $rta;
+ }
+ // -X2C
+ // +X2C Operation 366
+ /**
+ * Devuelve un array asociativo en donde la clave es el login y el valor es el nombre del usuario
+ *
+ * @param SAMURAI_DB &$db Base de Datos
+ * @param int $id_sistema Identificador del sistema
+ *
+ * @return array()
+ * @access public
+ * @static
+ */
+ function getArrayUsuarios(&$db, $id_sistema = null) // ~X2C
+ {
+ //FORECHEO LO QUE ME DEVUELVA GET USUARIOS
+ $rta = array ();
+ foreach (SAMURAI_Usuario::getUsuarios($db, $id_sistema) as $Usuario) {
+ $rta[$permiso->getLogin()] = $permiso->getNombre();
+ }
+ return $rta;
}
// -X2C
+ // +X2C Operation 367
+ /**
+ * Devuelve el array de usuarios
+ *
+ * @param SAMURAI_DB &$db Base de Datos
+ * @param int $id_sistema Identificador del sistema
+ *
+ * @return array(Permiso)
+ * @access public
+ * @static
+ */
+ function getUsuarios(&$db, $id_sistema = null) // ~X2C
+ {
+ $rta = array ();
+ foreach (SAMURAI_Usuario::_getLoginUsuarios($db, $id_sistema) as $login) {
+ $tmp = new SAMURAI_Usuario($db,$login);
+ array_push($rta, $tmp);
+ }
+ return $rta;
+ }
+ // -X2C
+ // +X2C Operation 368
+ /**
+ * Obtiene de la base de datos la informacion del usuario
+ *
+ * @return void
+ * @access protected
+ */
+ function _obtenerDatosDb() // ~X2C
+ {
+ $sql = parse_ini_file(dirname(__FILE__) . '/Usuario/consultas.ini', true);
+ $tmp = $sql['obtener_datos_usuario'].$sql['obtener_datos_usuario3'];
+ $dbh = $this->_db->prepare($tmp);
+ $res = $this->_db->execute($dbh,array($this->getLogin()));
+ if ($re = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
+ if (isset($re['nrodoc'])) {
+ $this->setNrodoc($re['nrodoc']);
+ }
+ else {
+ $this->setNrodoc();
+ }
+ if (isset($re['nombre'])) {
+ $this->setNombre($re['nombre']);
+ }
+ else {
+ $this->setNombre();
+ }
+ }
+ $tmp = $sql['obtener_perfiles_usuario'];
+ $dbh = $this->_db->prepare($tmp);
+ $res = $this->_db->execute($dbh,array($this->getLogin(), $_SESSION['samurai']['id_sistema']));
+ $rta = array();
+ while ($re = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
+ $tmp = new SAMURAI_Perfil($this->_db, $re['id_perfil']);
+ $rta[] = $tmp->getId();
+ }
+ $this->setPerfiles($rta);
+ }
+ // -X2C
+ // +X2C Operation 370
+ /**
+ * Modifica la base de datos segun accion
+ *
+ * @param string $accion Indica la accion a realizar
+ *
+ * @return mixed
+ * @access public
+ */
+ function guardarDatos($accion = grabar) // ~X2C
+ {
+ $accion = strtolower($accion);
+ switch ($accion) {
+ case 'grabar':
+ $res = $this->_grabarDb();
+ break;
+ case 'modificar':
+ $res = $this->_modificarDb();
+ break;
+ case 'eliminar':
+ $res = $this->_borrarDb();
+ break;
+ }
+ return $res;
+ }
+ // -X2C
+ // +X2C Operation 371
+ /**
+ * Graba en base la relacion
+ *
+ * @return mixed
+ * @access protected
+ */
+ function _grabarDb() // ~X2C
+ {
+ $datos = array ('login', 'id_perfil', 'id_sistema', 'responsable');
+ $re = $this->_db->autoPrepare('perfil_sist_usuario', $datos, DB_AUTOQUERY_INSERT);
+ foreach ($this->getPerfiles() as $perfil) {
+ $datos = array ($this->getLogin(),
+ $perfil,
+ $_SESSION['samurai']['id_sistema'],
+ $_SESSION['samurai']['login']);
+ $res = $this->_db->execute($re, $datos);
+ if (PEAR::isError($res)) {
+ return $res;
+ }
+ }
+ }
+ // -X2C
+ // +X2C Operation 372
+ /**
+ * Borra de la base la relacion
+ *
+ * @return mixed
+ * @access protected
+ */
+ function _borrarDb() // ~X2C
+ {
+ $sql = parse_ini_file(dirname(__FILE__) . '/Usuario/consultas.ini', true);
+ $tmp = $sql['borrar'];
+ $dbh = $this->_db->prepare($tmp);
+ $tmp = array ($this->getLogin(), $_SESSION['samurai']['id_sistema']);
+ return $this->_db->execute($dbh,$tmp);
+ }
+ // -X2C
+ // +X2C Operation 373
+ /**
+ * Actualiza los datos de la relacion
+ *
+ * @return mixed
+ * @access protected
+ */
+ function _modificarDb() // ~X2C
+ {
+ $this->_borrarDb();
+ $this->_grabarDb();
+ }
+ // -X2C
+ // +X2C Operation 374
+ /**
+ * Verifica si el login actual es valido
+ *
+ * @return mixed
+ * @access public
+ */
+ function verificarLogin() // ~X2C
+ {
+ $sql = parse_ini_file(dirname(__FILE__) . '/Usuario/consultas.ini', true);
+ $tmp = $sql['verificar_login'];
+ $dbh = $this->_db->prepare($tmp);
+ $res = $this->_db->execute($dbh,array($this->getLogin()));
+ $re = $res->fetchRow(DB_FETCHMODE_ASSOC);
+ if ($re['cuenta'] == 0) {
+ return new PEAR_Error('Usuario no reconocido.<br>Recuerde que éste debe haberse logueado previamente a Intranet');
+ }
+ else {
+ return 1;
+ }
+ }
+ // -X2C
} // -X2C Class :SAMURAI_Usuario
-
-?>
\ No newline at end of file
+?>
--- /dev/null
+; Configuración de la base de datos.
+; $Id$
+
+
+
+obtener_datos_usuario = " SELECT login, nrodoc, nombre FROM samurai.usuario "
+obtener_datos_usuario3 = " WHERE login = ? "
+obtener_datos_usuario4 = " ORDER BY login"
+obtener_datos_usuario2 = " SELECT DISTINCT u.login as login FROM samurai.usuario as u, samurai.perfil_sist_usuario as psu WHERE u.login = psu.login AND id_sistema = ? "
+obtener_perfiles_usuario = " SELECT id_perfil FROM samurai.perfil_sist_usuario WHERE login = ? AND id_sistema = ?"
+
+verificar_login = " SELECT count(*) as cuenta FROM samurai.usuario WHERE login = ?"
+borrar = " DELETE FROM samurai.perfil_sist_usuario WHERE login = ? AND id_sistema = ?"
'imagenComun' => 'usuarios.gif',
'imagenMouseOn' => '',
'imagenSelect' => '',
- 'link' => 'usuarios',
+ 'link' => 'usuarios/usuarios',
'tipoMenu' => 'oculto',
'hijos' => array (
- array ( 'nombre' => 'Filtrar Usuario',
- 'imagenComun' => '',
- 'imagenMouseOn' => '',
- 'imagenSelect' => '',
- 'link' => 'usuarios-filtrar',
- 'subhijos' => array ( 'sarasa1',
- ),
- ),
array ( 'nombre' => 'ABM Usuario',
'imagenComun' => '',
'imagenMouseOn' => '',
'imagenSelect' => '',
- 'link' => 'usuarios-abm',
+ 'link' => 'usuarios/usuarios-abm',
),
),
),
//
require_once 'HTML/Image.php';
- //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
- if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
- header('Location: sel-sistema');
- }
- /// }}}
$MARCO = new Marco ('../conf/confSecciones.php');
$MARCO->addBody(new HTML_Image('images/inicio.jpg'));
$MARCO->setEspacios(false);
require_once 'SAMURAI/Perfil.php';
require_once 'SAMURAI/Permiso.php';
require_once 'SAMURAI/Sistema.php';
+ require_once 'HTML/Image.php';
// }}}
//CREO LOS OBJETO NECESARIOS {{{
if (@$_GET['id_perfil']) {
$FORM->addRule ('permisos', 'Se debe seleccionar al menos un permiso', 'required');
// }}}
//CARGO LOS DATOS SI YA EXISTEN EN BASE {{{
-// TODO Terminar de armar la parte de modificacion y eliminacion
if (isset($_GET['accion']) && $_GET['accion'] != '') {
//MODIFICACION
$id_perfil =& $FORM->getElement ('id_perfil' );
}
// }}}
//DIBUJO LA PAGINA {{{
+ $imagen = new HTML_Image('/MECON/images/vinetas_flecha_doble.gif');
+ $row = array ($imagen->toHtml().' <b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
$TABLA3 = new Tabla ('cellspacing=0');
- $row = array ('<b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
- $TABLA3->addRow($row,'titulo align=left');
+ $TABLA3->addRow($row,'align=left');
$MARCO = new Marco ('../../conf/confSecciones.php');
$MARCO->addTitle('ABM Perfil');
$aHModifdes = '<img src="/MECON/images/general_modificar_des.gif" border="0" alt="No se puede modificar Permiso">';
$aHElimdes = '<img src="/MECON/images/general_eliminar_des.gif" border="0" alt="No se puede eliminar Permiso">';
// }}}
+//VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
+if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
+ header('Location: ./../sel-sistema');
+}
+// }}}
//CREO LOS OBJETOS NECESARIOS {{{
$TABLA2 = new Tabla ('cellspacing=0');
$TABLA = new Tabla ('cellpadding=2');
--- /dev/null
+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4 foldmethod=marker:
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Created: mié jul 16 13:37:33 ART 2003
+// | Author: Martin Marrese <mmarre@mecon.gov.ar>
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+//REQUIRE ONCE {{{
+ //MECON {{{
+ require_once 'MECON/HTML/QuickForm.php';
+ require_once 'MECON/HTML/Tabla.php';
+ require_once 'MECON/HTML/Error.php';
+ //}}}
+ //SAMURAI {{{
+ require_once 'SAMURAI/Perfil.php';
+ require_once 'SAMURAI/Usuario.php';
+ require_once 'SAMURAI/Sistema.php';
+ //}}}
+ require_once 'HTML/Image.php';
+// }}}
+//VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
+if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
+ header('Location: ./../sel-sistema');
+}
+// }}}
+//CREO LOS OBJETOS NECESARIOS {{{
+ if (@$_GET['login']) {
+ $login = $_GET['login'];
+ $validar = 0;
+ }
+ else {
+ $validar = 1;
+ $login = null;
+ }
+ $TABLA = new Tabla ('cellspacing=0');
+ $FORM = new MECON_HTML_QuickForm ('usuarios_abm','post','usuarios-abm');
+ $SISTEMA = new SAMURAI_Sistema($DB, $_SESSION['samurai']['id_sistema']);
+ $USUARIO = new SAMURAI_Usuario($DB, $login);
+// }}}
+//OBTENGO LOS DATOS DE LA BASE {{{
+ $tmps = SAMURAI_Perfil::getPerfiles($DB, null, $_SESSION['samurai']['id_sistema']);
+ foreach ($tmps as $tmp) {
+ $PERFILES[$tmp->getId()] = $tmp->getDescripcion();
+ }
+//}}}
+//AGREGO LOS DATOS A LAS TABLAS {{{
+ $imagen = new HTML_Image('/MECON/images/vinetas_flecha_doble.gif');
+ $row = array ($imagen->toHtml().' <b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
+ $TABLA->addRow($row,'align=left');
+//}}}
+//AGREGO LOS ELEMENTOS DEL FORM {{{
+ $FORM->addElement ('header', 'cabecera' , 'ABM Usuarios');
+ if ($login) { //Si esta el login solo permito modificar los perfiles asociados
+ $FORM->addElement ('static', 'login2', 'Login' , $login );
+ $FORM->addElement ('hidden', 'login' , $login );
+ $FORM->addElement ('static', 'nombre', 'Nombre', $USUARIO->getNombre());
+ }
+ else {
+ $FORM->addElement ('text' , 'login' , 'Login' , array( 'value' => $login , 'size' => '20'));
+ }
+ $FORM->addElement ('select', 'perfiles' , 'Perfiles', $PERFILES, array('size' => '5', 'multiple' => 'true'));
+ $FORM->addElement ('hidden', 'responsable', $_SESSION['samurai']['login']);
+ $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Grabar');
+ $group[] = HTML_QuickForm::createElement('submit', 'cancelar', 'Cancelar', array ('onClick' => 'javascript:history.go(-1);return true;'));
+ $FORM->addGroup($group,'botones');
+// }}}
+//AGREO LAS REGLAS DE VALIDACION {{{
+ if (@$validar) {
+ $FORM->addRule ('login', 'Se debe ingresar el login del usuario', 'required');
+ }
+ $FORM->addRule ('perfiles', 'Se debe seleccionar al menos un perfil', 'required');
+// }}}
+//SETEO LOS PERFILES SELECCIONADOS {{{
+ if (isset($_GET['accion']) && $_GET['accion'] != '') {
+ $perfiles =& $FORM->getElement ('perfiles');
+ $group =& $FORM->getElement ('botones' );
+ $group =& $group->getElements('aceptar' );
+ $aceptar =& $group[0];
+
+ $perfiles->setSelected($USUARIO->getPerfiles());
+
+ //Modifico el valor del boton
+ $aceptar->setValue('Modificar');
+
+ //ELIMINACION -> modifico el valor del boton
+ if ($_GET['accion'] == 'e') {
+ $aceptar->setValue('Eliminar');
+ $FORM->freeze();
+ }
+ }
+// }}}
+//VALIDO EL FORMULARIO {{{
+ if ($FORM->validate()) {
+ // VEO SI SE CANCELO {{{
+ $botones = $FORM->getSubmitValue('botones');
+ if (@$botones['cancelar']) {
+ header('Location: perfiles');
+ }
+ // }}}
+ else {
+ $login2 =& $FORM->getElement ('login' );
+ $nombre =& $FORM->getElement ('nombre' );
+ $perfiles =& $FORM->getElement ('perfiles');
+ $group =& $FORM->getElement ('botones' );
+ $group =& $group->getElements('aceptar' );
+ $aceptar =& $group[0];
+ $res = '';
+
+ if ($login) {
+ $login3 = $login2->_text;
+ }
+ else {
+ $login3 = $login2->getValue();
+ }
+ $USUARIO->setLogin($login3);
+ $res = $USUARIO->verificarLogin();
+ if (PEAR::isError($res)) {
+ $ERROR = new MECON_HTML_Error($res->getMessage());
+ }
+ else {
+ $USUARIO->setPerfiles($perfiles->getSelected());
+
+ $res = $USUARIO->guardarDatos($aceptar->getValue());
+
+ if (PEAR::isError($res)) {
+ $ERROR = new MECON_HTML_Error($res->getMessage());
+ if ($aceptar->getValue() == 'Eliminar') {
+ $FORM->freeze();
+ }
+ }
+ else {
+ $FORM->freeze();
+ header('Location: usuarios');
+ }
+ }
+ }
+ }
+// }}}
+//DIBUJO LA PAGINA {{{
+ $MARCO = new Marco ('../../conf/confSecciones.php');
+ $MARCO->addBody($TABLA);
+ if (isset($ERROR)) {
+ $MARCO->addBody($ERROR);
+ }
+ $MARCO->addBody($FORM);
+ $MARCO->display();
+// }}}
+//FIN
+?>
--- /dev/null
+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4 foldmethod=marker:
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Created: mié jul 16 12:51:57 ART 2003
+// | Author: Martin Marrese <mmarre@mecon.gov.ar>
+// +----------------------------------------------------------------------+
+//
+// $Id$
+//
+
+//REQUIRE ONCE {{{
+ require_once 'MECON/HTML/Tabla.php';
+ require_once 'SAMURAI/Usuario.php';
+ require_once 'SAMURAI/Sistema.php';
+ require_once 'HTML/Image.php';
+// }}}
+
+//LINKS A USUARIOS-ABM {{{
+ $aHref = '<a href="usuarios-abm?accion=##ACCION##&login=##NUEVO##">';
+ $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Usuario"></a>';
+ $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Usuario" ></a>';
+// }}}
+//VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
+if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
+ header('Location: ./../sel-sistema');
+}
+// }}}
+//CREO LOS OBJETOS NECESARIOS {{{
+ $TABLA2 = new Tabla ('cellspacing=0');
+ $TABLA = new Tabla ('cellpadding=2');
+ $TABLA3 = new Tabla ('cellspacing=0');
+ $SISTEMA = new SAMURAI_Sistema($DB, $_SESSION['samurai']['id_sistema']);
+// }}}
+//OBTENGO LA INFORMACION DE LA BASE {{{
+ $usuarios = SAMURAI_Usuario::getUsuarios($DB, $_SESSION['samurai']['id_sistema']);
+// }}}
+//AGREGO LOS DATOS A LAS TABLAS {{{
+ $imagen = new HTML_Image('/MECON/images/vinetas_flecha_doble.gif');
+ $row = array ($imagen->toHtml().' <b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
+ $TABLA3->addRow($row,'align=left');
+ $row = array ($aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Agregar Nuevo Usuario</a>');
+ $TABLA2->addRow($row,'align=right');
+ $row = array ('Login','Nombre','Modif.','Elim.');
+ $TABLA->addRow($row,'cabecera');
+ foreach ($usuarios as $usuario) {
+ $Modif = ereg_replace('##NUEVO##' , $usuario->getLogin(), $aHrefModif);
+ $Elim = ereg_replace('##NUEVO##' , $usuario->getLogin(), $aHrefElim );
+ $Modif = ereg_replace('##ACCION##', 'm' , $Modif );
+ $Elim = ereg_replace('##ACCION##', 'e' , $Elim );
+ $row = array ( $usuario->getLogin(),
+ $usuario->getNombre(),
+ $Modif,
+ $Elim,
+ );
+ $TABLA->addRow($row);
+ }
+// }}}
+//DIBUJO LA PAGINA {{{
+ $MARCO = new Marco ('../../conf/confSecciones.php');
+ $MARCO->addBody($TABLA3);
+ $MARCO->addBody($TABLA2->toHtml(1));
+ $MARCO->addBody($TABLA);
+ $MARCO->display();
+// }}}
+//FIN
+?>