Example #1
0
 public static function get_usuarios_disponibles_aplicacion($filtro)
 {
     $datos = array();
     if (toba::instalacion()->vincula_arai_usuarios()) {
         $datos = rest_arai_usuarios::instancia()->get_usuarios($filtro, self::get_identificador_aplicacion());
     }
     return $datos;
 }
 /**
  * Este método existe debido a que la definición de la constante TTF_DIR debe
  * ser hecha antes de incluir la librería jpgraph. Por tanto todas las clases
  * que extiendan de esta deben redefinir este método con una llamada
  * parent::set_up_jpgraph() y luego incluir las líbrerías utilizadas en esa
  * clase específica
  */
 protected function set_up_jpgraph()
 {
     if (!defined("TTF_DIR")) {
         $path = toba::instalacion()->get_fonts_path();
         if ($path !== false) {
             define("TTF_DIR", $path);
         }
     }
     require_once toba_dir() . '/php/3ros/jpgraph/jpgraph.php';
 }
Example #3
0
 function __construct()
 {
     $this->xml = new toba_vista_xml();
     //$this->fop se debe obtener desde la variable en instalacion.ini
     $fop = toba::instalacion()->get_xslfo_fop();
     $this->fop = $fop ? $fop : (toba_manejador_archivos::es_windows() ? 'fop.bat' : 'fop');
     $this->fop = toba_manejador_archivos::path_a_plataforma($this->fop);
     $prxsl = toba::proyecto()->get_path() . '/exportaciones/pdf_proyecto.xsl';
     $toxsl = toba::nucleo()->toba_dir() . '/exportaciones/pdf.xsl';
     $this->xsl_proyecto = toba_manejador_archivos::existe_archivo_en_path($prxsl) ? $prxsl : $toxsl;
     $this->xsl_proyecto = toba_manejador_archivos::path_a_plataforma($this->xsl_proyecto);
     $this->xml_proyecto = toba_manejador_archivos::path_a_plataforma(tempnam(toba::nucleo()->toba_dir() . '/temp', 'xml'));
 }
Example #4
0
 static function set_usar_perfiles_propios($id_proyecto)
 {
     //-- Si estamos en produccion guardamos un flag indicando que cambio la instancia
     $id_instancia = toba::instancia()->get_id();
     $instancia = toba_modelo_catalogo::instanciacion()->get_instancia($id_instancia);
     $usa_perfiles_propios = $instancia->get_proyecto_usar_perfiles_propios($id_proyecto);
     if (toba::instalacion()->es_produccion()) {
         if (!$usa_perfiles_propios) {
             $instancia->set_proyecto_usar_perfiles_propios($id_proyecto, true);
         }
         //-- Re-Compilamos los metadatos de perfiles
         $instancia->get_proyecto($id_proyecto)->compilar_metadatos_generales_grupos_acceso(true);
     }
 }
Example #5
0
 /**
  * @return SIUToba\rest\rest
  */
 public function instanciar_libreria_rest()
 {
     $ini = $this->get_conf();
     $es_produccion = (bool) toba::instalacion()->es_produccion();
     $path_controladores = $this->get_path_controladores();
     $url_base = self::url_rest();
     $settings = array('path_controladores' => $path_controladores, 'url_api' => $url_base, 'prefijo_api_docs' => 'api-docs', 'debug' => !$es_produccion, 'encoding' => 'latin1');
     $datos_ini_proyecto = $this->get_ini_proyecto();
     if (!empty($datos_ini_proyecto) && isset($datos_ini_proyecto['version'])) {
         $settings['api_version'] = $datos_ini_proyecto['version'];
     }
     $settings = array_merge($settings, $ini->get('settings', null, array(), false));
     //        include_once 'lib/rest/rest.php';
     $app = new SIUToba\rest\rest($settings);
     return $app;
 }
Example #6
0
    /**
     *	Retorna el html que grafica el app_launcher con informacion del usuario y aplicaciones a las que tiene acceso
     *	@return string	html del app_launcher
     */
    public function get_html_app_launcher()
    {
        $js = toba_editor::modo_prueba() ? 'window.close()' : 'salir()';
        $url_js_app_launcher = toba::instalacion()->get_url() . '/js/js-app-launcher/';
        $html = '	<link rel="stylesheet" href="' . $url_js_app_launcher . 'css/font-awesome-4.4.0/css/font-awesome.min.css" type="text/css" />';
        $html .= '	<link rel="stylesheet" href="' . $url_js_app_launcher . 'css/app_launcher.css" type="text/css" />';
        $html .= toba_js::incluir($url_js_app_launcher . 'app_launcher.js');
        $html .= '	<div id="enc-usuario" class="enc-usuario">';
        $html .= '	</div>';
        $html .= '	<script>
					appLauncher.init({
						container: "#enc-usuario",
						data: ' . json_encode($this->get_app_launcher_data()) . ',
						js_salir: function() { javascript:' . $js . '},
					});
				</script>';
        return $html;
    }
Example #7
0
 /**
  * Retorna la URL base del runtime toba (donde esta el js, img y demas recursos globales a todos los proyectos)
  * @return string
  * @see toba_instalacion::get_url
  */
 static function url_toba()
 {
     $alias = toba::instalacion()->get_url();
     if (isset($alias)) {
         return $alias;
     }
     //-- Compatibilidad hacia atrás
     if (isset($_SERVER['TOBA_ALIAS'])) {
         $alias = $_SERVER['TOBA_ALIAS'];
     } else {
         if (defined('apex_pa_toba_alias')) {
             $alias = apex_pa_toba_alias;
         } else {
             $alias = "toba";
         }
     }
     return '/' . $alias;
 }
Example #8
0
 function get_contenido($estilo)
 {
     if (!isset($this->contenidos[$estilo])) {
         $candidato = toba::instalacion()->get_path() . "/www/css/{$estilo}.css";
         if (file_exists($candidato)) {
             $archivo = $candidato;
         } else {
             //Si el archivo no esta en toba, esta en algun proyecto
             $proyectos = toba_info_instancia::get_proyectos_con_estilo($estilo);
             foreach ($proyectos as $proyecto) {
                 $pro = $proyecto['proyecto'];
                 $candidato = toba::instancia()->get_path_proyecto($pro) . "/www/css/{$estilo}.css";
                 if (file_exists($candidato)) {
                     $archivo = $candidato;
                 }
             }
         }
         if (!isset($archivo)) {
             throw new toba_error("No se encuentra el archivo del estilo {$estilo}");
         }
         $this->contenidos[$estilo] = file_get_contents($archivo);
     }
     return $this->contenidos[$estilo];
 }
 /**
  * Envia un mensaje al servicio web y espera la respuesta
  * @param toba_servicio_web_mensaje $mensaje
  * @return toba_servicio_web_mensaje
  */
 function request(toba_servicio_web_mensaje $mensaje)
 {
     try {
         $message = $this->wsf->request($mensaje->wsf());
         if (!toba::instalacion()->es_produccion()) {
             toba::logger()->debug("Request: " . var_export($this->wsf->getLastRequest(), true));
             toba::logger()->debug("Response: " . var_export($this->wsf->getLastResponse(), true));
             toba::logger()->var_dump($this->wsf->getLastResponseHeaders());
         }
         //-- INICIO PARCHE: Intenta parsear un Fault por bug en libreria WSF con esquema de seguridad..
         if (is_a($message, 'WSMessage')) {
             $inicio = "<soapenv:Fault";
             if (substr($message->str, 0, strlen($inicio)) == $inicio) {
                 $xml = new SimpleXMLElement($message->str);
                 $ns = $xml->getDocNamespaces(true);
                 $childrens = $xml->children($ns['soapenv']);
                 $code = @(string) $childrens->Code->Value;
                 $reason = @(string) $childrens->Reason->Text;
                 $detail = @(string) $childrens->Detail->children($ns['soapenv']->children, true)->error;
                 throw new WSFault(str_replace("soapenv:", "", $code), $reason, null, $detail);
             }
         }
         //--- FIN PARCHE
         return new toba_servicio_web_mensaje($message);
     } catch (WSFault $fault) {
         if (!toba::instalacion()->es_produccion()) {
             toba::logger()->debug("Request: " . var_export($this->wsf->getLastRequest(), true));
             toba::logger()->debug("Response: " . var_export($this->wsf->getLastResponse(), true));
             toba::logger()->var_dump($this->wsf->getLastResponseHeaders());
         }
         $detalle = isset($fault->Detail) ? $fault->Detail : '';
         $code = isset($fault->Code) ? $fault->Code : '';
         self::get_modelo_proyecto($this->proyecto);
         throw new toba_error_servicio_web($fault->Reason, $detalle, $code);
     } catch (Exception $e) {
         if (!toba::instalacion()->es_produccion()) {
             toba::logger()->debug("Request: " . var_export($this->wsf->getLastRequest(), true));
             toba::logger()->debug("Response: " . var_export($this->wsf->getLastResponse(), true));
             toba::logger()->var_dump($this->wsf->getLastResponseHeaders());
         }
         throw new toba_error_comunicacion($e->getMessage(), $this->opciones, $this->wsf->getLastResponseHeaders());
     }
 }
Example #10
0
 /**
  * Genera el xml del componente
  * @param boolean $inicial Si el elemento es el primero llamado desde vista_xml
  * @param string $xmlns Namespace para el componente
  * @return string XML del componente
  */
 function vista_xml($inicial = false, $xmlns = null)
 {
     if ($xmlns) {
         $this->xml_set_ns($xmlns);
     }
     if (isset($this->_memoria['parametros'])) {
         $contenido = $this->_memoria['parametros']['contenido'];
         $formato = $this->_memoria['parametros']['formato'];
         $es_dirigido = $this->_memoria['parametros']['es_dirigido'];
         $archivo = self::generar_archivo($contenido, 'svg', $es_dirigido);
         $dir_temp = toba::instalacion()->get_path_temp();
         $xml = '<' . $this->xml_ns . 'img type ="svg"' . $this->xml_ns_url;
         if (isset($this->xml_caption)) {
             $xml .= ' caption="' . $this->xml_caption . '"';
         }
         $xml .= $this->xml_get_att_comunes();
         $xml .= ' src="' . toba_manejador_archivos::path_a_unix($dir_temp . "/" . $archivo) . '">';
         $xml .= $this->xml_get_elem_comunes();
         $svg = file_get_contents(toba_manejador_archivos::path_a_unix($dir_temp . "/" . $archivo));
         $svg = substr($svg, stripos($svg, '<svg'));
         $svg = substr($svg, 0, strripos($svg, '</svg>') + 6);
         $enc = mb_detect_encoding($svg);
         if (strtolower(substr($enc, 0, 8)) != 'iso-8859') {
             $svg = iconv($enc, 'iso-8859-1', $svg);
         }
         $xml .= $svg . '</' . $this->xml_ns . 'img>';
         return $xml;
     }
 }
Example #11
0
 /**
  *  Método para obtener la configuración del servidor SMTP
  */
 function get_datos_configuracion_smtp()
 {
     //Pide a la instalacion la configuración del SMTP
     return toba::instalacion()->get_datos_smtp($this->nombre_conf);
 }
Example #12
0
 private function recuperar_revision_recursos()
 {
     $svn = new toba_svn();
     if (!toba::memoria()->existe_dato_instancia('toba_revision_recursos_cliente')) {
         $path_recursos = $this->toba_dir() . '/www';
         if (toba::instalacion()->es_produccion() || !$svn->hay_cliente_svn() || !$svn->es_copia_trabajo($path_recursos)) {
             $version = toba::instalacion()->get_version()->__toString();
         } else {
             $version = $svn->get_revision($path_recursos);
         }
         toba::memoria()->set_dato_instancia('toba_revision_recursos_cliente', $version);
     }
     if (!toba::memoria()->existe_dato_instancia('proyecto_revision_recursos_cliente')) {
         $path_recursos = toba::proyecto()->get_path() . '/www';
         if (toba::instalacion()->es_produccion() || !$svn->hay_cliente_svn() || !$svn->es_copia_trabajo($path_recursos)) {
             $version = toba::proyecto()->get_version()->__toString();
         } else {
             $version = $svn->get_revision($path_recursos);
         }
         toba::memoria()->set_dato_instancia('proyecto_revision_recursos_cliente', $version);
     }
 }
Example #13
0
 /**
  * Incluye los consumos globales básicos para utilizar el framework
  */
 static function cargar_consumos_basicos()
 {
     if (!self::$basicos_cargados) {
         self::$consumos_basicos[] = 'basicos/jquery-1.9.1.min';
         if (toba::proyecto()->get_parametro('es_css3')) {
             self::$consumos_basicos[] = 'formalize/javascripts/jquery.formalize.min';
         }
         $imagenes = array('error' => toba_recurso::imagen_toba('error.gif', false), 'info' => toba_recurso::imagen_toba('info_chico.gif', false), 'warning' => toba_recurso::imagen_toba('warning.gif', false), 'maximizar' => toba_recurso::imagen_toba('nucleo/sentido_des_sel.gif', false), 'minimizar' => toba_recurso::imagen_toba('nucleo/sentido_asc_sel.gif', false), 'expandir' => toba_recurso::imagen_skin('expandir_vert.gif', false), 'contraer' => toba_recurso::imagen_skin('contraer_vert.gif', false), 'expandir_nodo' => toba_recurso::imagen_toba('nucleo/expandir.gif', false), 'contraer_nodo' => toba_recurso::imagen_toba('nucleo/contraer.gif', false), 'esperar' => toba_recurso::imagen_toba('wait.gif', false), 'cerrar' => toba_recurso::imagen_toba('nucleo/cerrar_ventana.gif', false));
         echo toba_js::abrir();
         echo "var toba_alias='" . toba_recurso::url_toba() . "';\n";
         echo "var toba_proyecto_alias='" . toba_recurso::url_proyecto() . "';\n";
         if (toba_editor::activado()) {
             echo 'var toba_proyecto_editado_alias = "' . toba_editor::get_url_previsualizacion() . "\";\n";
         }
         echo "var toba_prefijo_vinculo = \"" . toba::vinculador()->get_url() . "\";\n";
         echo "var toba_hilo_qs='" . apex_hilo_qs_item . "'\n";
         echo "var toba_hilo_separador='" . apex_qs_separador . "'\n";
         echo "var toba_hilo_separador_interno='" . apex_qs_sep_interno . "'\n";
         echo "var toba_hilo_qs_servicio='" . apex_hilo_qs_servicio . "'\n";
         echo "var toba_hilo_qs_menu='" . apex_hilo_qs_menu . "'\n";
         echo "var apex_hilo_qs_celda_memoria='" . apex_hilo_qs_celda_memoria . "'\n";
         echo "var toba_hilo_qs_objetos_destino='" . apex_hilo_qs_objetos_destino . "'\n";
         echo "var lista_imagenes=" . toba_js::arreglo($imagenes, true) . ";";
         echo "var apex_solicitud_tipo='" . toba::solicitud()->get_tipo() . "'\n";
         $espera = toba::proyecto()->get_parametro('tiempo_espera_ms');
         if (!isset($espera)) {
             $espera = 0;
             //No hay espera
         }
         echo "var toba_espera={$espera};\n";
         //-------------- Incluyo funcionalidad para la respuesta del popup  ---------------
         $ef_popup = toba::memoria()->get_parametro('ef_popup');
         if (is_null($ef_popup)) {
             $ef_popup = toba::memoria()->get_dato_sincronizado('ef_popup');
         }
         if (!is_null($ef_popup)) {
             toba::memoria()->set_dato_sincronizado('ef_popup', $ef_popup);
             echo "\n\t\t\t\tfunction seleccionar(clave, descripcion) {\n\t\t\t\t\twindow.opener.popup_callback('" . $ef_popup . "', clave, descripcion);\n\t\t\t\t\twindow.close();\n\t\t\t\t}\n\t\t\t\tfunction respuesta_ef_popup(parametros) {\n\t\t\t\t\tvar seleccion = parametros.split('||');\n\t\t\t\t\tseleccionar(seleccion[0], seleccion[1]);\n\t\t\t\t}\n\n\t\t\t\tfunction iniciar_respuesta_popup(objeto, parametros)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tvar posicion = objeto.id.ultima_ocurrencia('_');\n\t\t\t\t\tvar nombre = objeto.id.substr(0, posicion) + '_descripcion';\n\t\t\t\t\tvar descripcion = \$\$(nombre).value;\n\t\t\t\t\tseleccionar(parametros, descripcion);\n\t\t\t\t}";
         }
         //-----------------------------------------------------------------------------------------------------
         echo toba_js::cerrar();
         //Incluyo el javascript STANDART
         self::cargar_consumos_globales(self::$consumos_basicos);
         if (toba::instalacion()->arreglo_png_ie()) {
             ///---Arreglo PNGs IE
             $url = toba_recurso::js("utilidades/pngbehavior.htc");
             echo "<!--[if lt IE 7]>\n\t\t\t\t\t<style type='text/css'>\n\t\t\t\t\t\timg {\n\t\t\t\t\t\t\tbehavior: url('{$url}');\n\t\t\t\t\t\t}\n\t\t\t\t\t</style>\n\t\t\t\t\t<![endif]-->\n";
         }
         $url = toba_recurso::js('basicos/html5shiv.js');
         echo "\t<!--[if lt IE 9]>\n\t\t\t\t\t\t<script src='{$url}'></script>\n\t\t\t\t\t<![endif]-->\n";
         self::$basicos_cargados = true;
     }
 }
Example #14
0
<?php

$plantilla = toba::memoria()->get_parametro('plantilla');
if (isset($_POST['elem_nueva_plantilla'])) {
    $archivo_css = toba::instalacion()->get_path() . '/www/css/' . apex_proyecto_estilo . '.css';
    $texto_css = $_POST['elem_nueva_plantilla'];
    $texto_css = str_replace(';', ";\n\t", $texto_css);
    file_put_contents($archivo_css, $texto_css);
}
?>
<form name="editor_estilos" method="post" action="">	
<div style='padding-left: 5px;font-size: 10px;'>
	<fieldset style='padding: 5px'>
	<legend>Opciones</legend>
		<label for="elem_solo_item"><input id='elem_solo_item' type="checkbox" class="ef-checkbox" checked disabled> Aplicar a todo el proyecto </label><br>
		<label for="elem_sin_form"><input id='elem_sin_form' type="checkbox" class="ef-checkbox"  onClick="cambiar_formularios();"> Deshabilitar formularios</label><br>
		<label for="elem_sin_links"><input id='elem_sin_links' type="checkbox" class="ef-checkbox" disabled> Deshabilitar links</label>	<br>
	</fieldset>

	<fieldset style='padding: 5px; text-align:center;'>
		<legend>Editor</legend>
		<div id='elem_nombre_clase' style='text-align:center; font-weight: bold;'></div>
			<textarea id="elem_editor" cols="50" rows="15" class='ef-textarea' disabled>
			</textarea>
		<br>
	<input id='elem_aplicar' type='button' value='Vista Previa' onClick='aplicar()' class='ef-boton' disabled>
	&nbsp;	&nbsp;	&nbsp;
	<input id='elem_aceptar' type='button' value='Aceptar' onClick='aplicar(); aceptar();' class='ef-boton' disabled>	
	<input id='elem_cancelar' type='button' value='Cancelar' onClick='cancelar()' class='ef-boton' disabled>	
	&nbsp;	&nbsp;	&nbsp;
	<input id='elem_refrescar' type='button' value='Refrescar' onClick='refrescar()' class='ef-boton'>		
Example #15
0
 function conf__form_datos_perfil(toba_ei_formulario $componente)
 {
     if (toba::instalacion()->es_produccion()) {
         $componente->desactivar_efs(array('permite_edicion'));
     }
     $datos = array();
     if ($this->datos('accesos')->hay_cursor()) {
         $datos = $this->datos('accesos')->get();
         $componente->set_solo_lectura(array('usuario_grupo_acc'));
         if (toba::instalacion()->es_produccion() && isset($datos['permite_edicion']) && !$datos['permite_edicion']) {
             $this->pantalla()->eliminar_evento('guardar');
             $this->pantalla()->eliminar_evento('eliminar');
         }
     } else {
         $componente->ef('usuario_grupo_acc')->set_expreg('/^[a-z0-9_]+$/');
         $datos['proyecto'] = $this->s__filtro['proyecto'];
     }
     $componente->set_datos($datos);
 }
Example #16
0
 /**
  * Envia el archivo que contiene la imagen hacia el cliente.
  * @param file $archivo
  * @ignore
  */
 protected function enviar_archivo($archivo)
 {
     //Primero averiguo el mimetype del mapfile
     $formato = $this->_mapa->outputformat;
     $tipo_salida = $formato->getOption('mimetype');
     //Luego abro el archivo y veo que paso
     $dir_temp = toba::instalacion()->get_path_temp();
     $path_completo = $dir_temp . "/" . $archivo;
     if (file_exists($path_completo)) {
         $fp = fopen($path_completo, 'rb');
         if (isset($tipo_salida)) {
             header("Content-type: {$tipo_salida}");
         }
         header("Content-Length: " . filesize($path_completo));
         fpassthru($fp);
         fclose($fp);
         unlink($path_completo);
     } else {
         toba::logger()->error("El archivo {$path_completo} no se encuentra");
     }
 }
Example #17
0
 /**
  * Rutea el pedido del path de una  imagen como si se estubiera ejecutando el proyecto
  */
 static function dir_imagen_de_origen($img, $origen)
 {
     switch ($origen) {
         case 'apex':
             return toba::instalacion()->get_path() . '/www/img';
             break;
         case 'skin':
             $estilo = toba::proyecto(toba_editor::get_proyecto_cargado())->get_parametro('estilo');
             $proyecto = toba::proyecto(toba_editor::get_proyecto_cargado())->get_parametro('estilo_proyecto');
             return toba::instancia()->get_path_proyecto($proyecto) . "/www/skins/{$estilo}";
             break;
         case 'proyecto':
             $cargado = toba_editor::get_proyecto_cargado();
             return toba::instancia()->get_path_proyecto($cargado) . '/www/img';
             break;
         default:
             throw new toba_error("No esta contemplado el origen {$origen}");
     }
 }
Example #18
0
 /**
  * Retorna el número de versión propio del proyecto
  * @return toba_version
  */
 function get_version()
 {
     if (isset($this->ini_proyecto) && $this->ini_proyecto->existe_entrada('proyecto', 'version')) {
         return new toba_version($this->ini_proyecto->get('proyecto', 'version'));
     } else {
         //Se asume que si el proyecto no da un numero de version, se toma la del nucleo (para no mantener la de toba_referencia, usuarios, etc)
         return toba::instalacion()->get_version();
     }
 }
Example #19
0
 protected function iniciar_pedido_cas()
 {
     $this->instanciar_cliente_cas();
     phpCAS::setExtraCurlOption(CURLOPT_SSLVERSION, 3);
     // Se genera la URL de servicio
     $param = array();
     if (isset($this->parametros_url) && is_array($this->parametros_url)) {
         $param = $this->parametros_url;
     }
     $url = $this->generar_url($param);
     phpCAS::setFixedServiceURL($url);
     // Tipo de auth
     if (toba::instalacion()->es_produccion()) {
         phpCAS::setCasServerCACert($this->archivo_certificado, $this->validar_cn);
     } else {
         phpCAS::setNoCasServerValidation();
     }
     phpCAS::setServerLoginURL('');
     /** Llamada principal al authentificación de CAS, si no estás
     		autenticado te redirecciona ahí adentro y no sigue ejecutando
     		Si pasa está función significa que estás autenticado **/
     phpCAS::forceAuthentication();
 }
Example #20
0
 function get_autenticacion()
 {
     if (!isset($this->autenticacion)) {
         switch (toba::instalacion()->get_tipo_autenticacion()) {
             case 'ldap':
                 $this->set_autenticacion(new toba_autenticacion_ldap());
                 break;
             case 'openid':
                 $this->set_autenticacion(new toba_autenticacion_openid());
                 break;
             case 'cas':
                 $this->set_autenticacion(new toba_autenticacion_cas());
                 break;
             case 'saml':
                 $this->set_autenticacion(new toba_autenticacion_saml());
                 break;
             case 'saml_onelogin':
                 $this->set_autenticacion(new toba_autenticacion_saml_onelogin());
                 break;
             default:
                 //tipo == 'toba'
                 $this->set_autenticacion(new toba_autenticacion_basica());
                 break;
         }
     }
     return $this->autenticacion;
 }
Example #21
0
<?php

$url = toba_recurso::url_toba() . '/js/jsunit/testRunner.html?autorun=true&showTestFrame=50&testPage=';
$path = toba::instalacion()->get_path() . '/www/js/testing/';
$casos = glob($path . '*.html');
echo '<ul>';
if (is_array($casos)) {
    foreach ($casos as $caso) {
        $nombre = basename($caso);
        $direccion = $url . substr(toba_recurso::url_toba() . "/js/testing/{$nombre}", 7);
        //Para sacar el protocolo
        echo "<li><a href='#' onclick=\"solicitar_item_popup('{$direccion}', 700, 600, 'yes', 'yes');\">";
        echo substr($nombre, 0, -5);
        echo '</a></li>';
    }
}
echo '</ul>';
Example #22
0
 /**
  * Recupera pregunta/respuesta para el desafio
  * @param string $usuario
  * @return array 
  */
 function recuperar_pregunta_secreta($usuario)
 {
     try {
         $aux = null;
         $datos = toba::instancia()->get_pregunta_secreta($usuario);
         if (!is_null($datos)) {
             $clave = toba::instalacion()->get_claves_encriptacion();
             $aux['pregunta'] = mcrypt_decrypt(MCRYPT_BLOWFISH, $clave['get'], $datos['pregunta'], MCRYPT_MODE_CBC, substr($clave['db'], 0, 8));
             $aux['respuesta'] = mcrypt_decrypt(MCRYPT_BLOWFISH, $clave['get'], $datos['respuesta'], MCRYPT_MODE_CBC, substr($clave['db'], 0, 8));
         }
         return $aux;
     } catch (toba_error $e) {
         toba::logger()->error('Se intento modificar la clave del usuario:' . $usuario);
         return array();
     }
 }
Example #23
0
 /**
  * Rutea WSF hacia la extensión
  */
 function __call($nombre, $argumentos)
 {
     $srv_name = $this->_solicitud->get_id_operacion();
     if (!self::esta_activo($srv_name)) {
         toba::logger_ws()->debug('Se intento acceder a un servicio web inactivo: ' . $srv_name);
         toba::logger_ws()->set_checkpoint();
         throw new WSFault('Receiver', ' El servicio no esta activo');
     }
     //trac/toba/wiki/Referencia/ServiciosWeb/Seguridad
     if (!isset(self::$opciones['securityToken']) && self::servicio_con_firma()) {
         if (toba::instalacion()->es_produccion()) {
             throw new toba_error_seguridad("El servicio web esta configurado para requerir firma, sin embargo no se esta encriptando/firmando la conexion");
         } else {
             throw new toba_error_servicio_web("El servicio web esta configurado para requerir firma, sin embargo no se <a target='_blank' href='http://repositorio.siu.edu.ar/trac/toba/wiki/Referencia/ServiciosWeb/Seguridad#configuracion'>configuro correctamente</a> el servicio importando los certificados de los clientes.");
         }
     }
     //Elimina el guion bajo inicial y llama al metodo op__X
     toba::logger_ws()->debug("Metodo invocado: {$nombre}");
     toba::logger_ws()->debug('Argumentos recibidos');
     toba::logger_ws()->var_dump($argumentos);
     toba::logger_ws()->set_checkpoint();
     if (substr($nombre, 0, 1) != '_') {
         throw new BadMethodCallException('Call to undefined method ' . __CLASS__ . '::' . $nombre);
     }
     $metodo = substr($nombre, 1);
     toba::solicitud()->set_metodo_invocado($metodo);
     $this->mensaje_entrada = new toba_servicio_web_mensaje($argumentos[0]);
     try {
         if ($this->servicio_con_firma()) {
             $this->validar_certificado_cliente();
         }
         $mensaje_salida = $this->{$metodo}($this->mensaje_entrada);
         if (isset($mensaje_salida)) {
             $mensaje = $mensaje_salida->wsf();
             return $mensaje;
         } else {
             toba::logger_ws()->debug("Respuesta de retorno vacía");
             toba::logger_ws()->set_checkpoint();
             return;
         }
     } catch (toba_error_servicio_web $e) {
         toba::logger_ws()->error("Excepción lanzada: " . $e->get_mensaje() . ". Más detalles: " . $e->get_mensaje_log());
         toba::logger_ws()->set_checkpoint();
         toba::logger()->error("Excepción lanzada: " . $e->get_mensaje() . ". Más detalles: " . $e->get_mensaje_log());
         toba::solicitud()->registrar();
         throw new WSFault("Sender", utf8_e_seguro($e->get_mensaje()), null, $e->get_codigo());
     }
 }
 function conf__form_restriccion(toba_ei_formulario $componente)
 {
     if ($this->dep('restricciones')->esta_cargada()) {
         $datos = $this->dep('restricciones')->get();
         if (toba::instalacion()->es_produccion() && !$datos['permite_edicion']) {
             $this->pantalla()->eliminar_evento('guardar');
             $this->pantalla()->eliminar_evento('eliminar');
         }
     } else {
         $datos['proyecto'] = $this->get_proyecto_seleccionado();
     }
     $componente->set_datos($datos);
     if (toba::instalacion()->es_produccion()) {
         $componente->desactivar_efs(array('restriccion_funcional', 'permite_edicion'));
     }
 }
Example #25
0
 /**
  * Utiliza una llamada al sist. operativo para que abra el archivo en un edtiro del sist. de ventanas del servidor
  */
 function abrir()
 {
     $cmd = toba::instalacion()->get_editor_php();
     if (strlen($cmd) == 0) {
         throw new toba_error_def("No se encuentra definido el editor por defecto a utilizar en la instalación");
     }
     if (toba_manejador_archivos::es_windows()) {
         $archivo = toba_manejador_archivos::path_a_windows($this->nombre);
         $com = "{$cmd} {$archivo}";
         toba::logger()->debug("Intentando abrir archivo con comando: '{$com}'");
         exec($com);
     } else {
         $archivo = toba_manejador_archivos::path_a_unix($this->nombre);
         $archivo = str_replace(" ", "\\ ", $archivo);
         $com = "{$cmd} {$archivo}";
         toba::logger()->debug("Intentando abrir archivo con comando: '{$com}'");
         $fp = popen($com . ' 2>&1', 'r');
         stream_set_blocking($fp, 0);
         sleep(1);
         $salida = fgets($fp, 2096);
         pclose($fp);
         if ($salida != '') {
             throw new toba_error("Intentando abrir archivo con comando: '{$com}'<br><br>Mensaje de error:<br>" . $salida);
         }
     }
 }
Example #26
0
 private function desencriptar_datos($dato_encriptado)
 {
     $clave = toba::instalacion()->get_claves_encriptacion();
     return mcrypt_decrypt(MCRYPT_BLOWFISH, $clave['get'], base64_decode($dato_encriptado), MCRYPT_MODE_CBC, substr($clave['db'], 0, 8));
 }
Example #27
0
    function extender_objeto_js()
    {
        if (toba::instalacion()->get_tipo_autenticacion() == 'openid') {
            $personalizable = '';
            foreach ($this->get_openid_providers() as $id => $provider) {
                if (isset($provider['personalizable']) && $provider['personalizable']) {
                    $personalizable = $id;
                }
            }
            echo "\n\t\t\t\t{$this->dep('openid')->objeto_js}.evt__provider__procesar = function(inicial) {\n\t\t\t\t\tif (this.ef('provider').get_estado() == '{$personalizable}') {\n\t\t\t\t\t\tthis.ef('provider_url').mostrar();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.ef('provider_url').ocultar();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t";
        }
        $finalizar = toba::memoria()->get_parametro(apex_sesion_qs_finalizar);
        if (is_null($finalizar)) {
            //Sesion activa
            if (toba::manejador_sesiones()->existe_usuario_activo()) {
                //Si ya esta logueado y se abre el sistema en popup, abrirlo
                if (isset($this->s__item_inicio)) {
                    list($proyecto, $item) = explode($this->s__item_inicio);
                } else {
                    $proyecto = toba::proyecto()->get_id();
                    $item = toba::proyecto()->get_parametro('item_inicio_sesion');
                }
                $url = toba::vinculador()->get_url($proyecto, $item);
                if ($this->en_popup) {
                    echo " abrir_popup('sistema', '{$url}', {resizable: 1});\t";
                } else {
                    echo " window.location.href = '{$url}';";
                }
            }
        } elseif ($this->en_popup) {
            //Se finaliza la sesion
            echo '
					if (window.opener &&  window.opener.location) {
						window.opener.location.href = window.opener.location.href; 
					}
					window.close();
				';
        }
    }
Example #28
0
 private function __construct()
 {
     $this->clave = toba::instalacion()->get_claves_encriptacion();
 }
Example #29
0
 /**
  * Retorna el path absoluto de un proyecto perteneciente a esta instancia
  */
 function get_path_proyecto($proyecto)
 {
     //incluyo el archivo de informacion basica de la INSTANCIA
     if ($proyecto == 'toba') {
         return toba::instalacion()->get_path();
     } elseif (isset($this->memoria[$proyecto]['path'])) {
         $path = $this->memoria[$proyecto]['path'];
         if (substr($path, 0, 1) == '.') {
             return realpath(toba_dir() . '/' . $this->memoria[$proyecto]['path']);
         } else {
             return $this->memoria[$proyecto]['path'];
         }
     } else {
         return toba_dir() . "/proyectos/" . $proyecto;
     }
 }