function crear_vista_productos_miniatura() { for ($i = 0; $i < count($this->productos); $i++) { $str_producto = $this->esqueleto_producto; $str_producto = str_replace("id_producto", encripta($this->productos[$i]->id), $str_producto); $str_producto = str_replace("Titulo Producto", $this->productos[$i]->titulo, $str_producto); $str_producto = str_replace("Informacion Producto", $this->productos[$i]->descripcion, $str_producto); $str_producto = str_replace("Imagen Principal", $this->crear_string_imagen($this->productos[$i]), $str_producto); $str_producto = str_replace("Precio Producto", "Q. " . number_format($this->productos[$i]->precio, 2, '.', ','), $str_producto); $this->productos[$i]->set_vista($str_producto); } }
function crear_vista_productos_miniatura() { for ($i = 0; $i < count($this->productos); $i++) { $str_producto = $this->esqueleto_producto; $str_producto = str_replace("id_producto", encripta($this->productos[$i]->id), $str_producto); $str_producto = str_replace("Titulo Producto", $this->productos[$i]->titulo, $str_producto); $str_producto = str_replace("Descripcion Producto", $this->productos[$i]->descripcion, $str_producto); $str_producto = str_replace("Direccion Producto", $this->productos[$i]->direccion, $str_producto); $str_producto = str_replace("Horarios Producto", $this->productos[$i]->horarios, $str_producto); $str_producto = str_replace("Telefonos Producto", $this->productos[$i]->telefonos, $str_producto); $str_producto = str_replace("Imagen Principal", $this->crear_string_imagen($this->productos[$i]), $str_producto); $this->productos[$i]->set_vista($str_producto); } }
<input name="nombre" type="text" value="Nombre de categoria..." onFocus="if(this.value == 'Nombre de categoria...') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Nombre de categoria...';}"/> </p> <p> <input class="button" type="submit" value="AGREGAR" id="aceptar" name="aceptar" tabindex="5"/> </p> <?php $aceptar = $_POST['aceptar']; if ($aceptar) { //antes de enviar los caracteres que pasamos por la URL debemos ponerlo en buen recaudo encriptar $nick1 = encripta($nick, "rayedgard"); $nombre = $_POST['nombre']; $path1 = "../imagenes/fotos/"; //$tipo= $_POST['tipo']; $resultado = mysql_query("INSERT INTO categoriaFotos (idCategoriaFoto,nombreCategoria) VALUES ('{$id}','{$nombre}')", $link); $my_error = mysql_error($link); if (!empty($my_error)) { echo "Ha habido un error al insertar los valores. {$my_error}"; } else { mkdir($path1 . $nombre, 7777); echo "<meta http-equiv ='refresh' content='0;url=principal.php?q=1&p=" . $p . "&nick=" . $nick1 . "'>"; } } if ($cancelar) { echo "<script languaje='javascript' type='text/javascript'>window.close();</script>"; }
<div class="form-group"> <div class="col-sm-8"> <input name="aceptar" type="submit" class="btn-success btn"> </div> </div> <?php $p = $_GET['p']; $q = encripta('1', 'rayedgard'); $aceptar = $_POST['aceptar']; if ($aceptar) { $nombre = $_POST['nombre']; $sistema = $_POST['sistema']; $enlace = $_POST['link']; $consulta = mysql_query("INSERT INTO tvideos (ids,nombre,link) VALUES ('{$sistema}','{$nombre}','{$enlace}')", $link); $my_error = mysql_error($link); if (!empty($my_error)) { echo "Ha habido un error al insertar los valores. {$my_error}"; } else { echo "<meta http-equiv ='refresh' content='0;url=index.php?p={$p}&q={$q}>'"; } } ?>
if ($submit == "Salvar") { // Se a senha validacao de senha for igual if ($novasenha == $novasenha2) { // Verifica se a variavel existe $descricao = replace_accents($descricao); if (!empty($descricao)) { $entry["description"][0] = $descricao; } if (!empty($grupo)) { $entry["description"][1] = $grupo; } if (!empty($novasenha)) { $entry["userpassword"][0] = "{crypt}" . crypt($novasenha); } if (!empty($novasenha)) { $entry["userpassword"][1] = encripta($novasenha, $key, $iv); } $uptdn = "uid=" . $info[$valor]["uid"][0] . ",ou=" . $info[$valor]["host"][0] . ",ou=people," . $dn; if (ldap_modify($conexao, $uptdn, $entry)) { // Envia email para informar alteracao $emails = getemail($info[$valor]["description"][1]); $mensagem = "Sistema de senhas\n\nA seguinte senha foi editada pelo usuбrio " . $usuario . ":\n\nCliente: " . $info[$valor]["o"][0] . "\nHost: " . $info[$valor]["host"][0] . "\nUsuбrio: " . $info[$valor]["uid"][0] . "\nGrupo: " . $info[$valor]["description"][1]; $subject = "Sist. senhas: atenзгo: " . $usuario . " editou (C:" . $info[$valor]["o"][0] . ", H:" . $info[$valor]["host"][0] . ", U:" . $info[$valor]["uid"][0] . ", G:" . $info[$valor]["description"][1] . ")"; if (count($emails) != 0) { enviaemail($emails, $subject, $mensagem); //echo "Enviando notificacao..."; } $senhade = decripta($info[$valor]["userpassword"][1], $key, $iv); if ($senhade != $novasenha) { writehistory("sysuser="******" user="******"uid"][0] . " cliente=" . $info[$valor]["o"][0] . " host=" . $info[$valor]["host"][0] . " pw=" . $senhade); }
$clave_maestra = "maestro"; // clave para realizar el proceso de encriptado y desencriptado $key = 'key123'; // clave pública $secret = 'secret123'; // clave secreta $url = "http://pruebas/oauth-ejemplo/server.php"; // URL del servidor $options = array('consumer_key' => $key, 'consumer_secret' => $secret); OAuthStore::instance("2Leg", $options); $method = "GET"; $params = null; // BASE DE DATOS // encriptación de las claves $key_encriptada = encripta($key); $secret_encriptada = encripta($secret); // inserción de las claves en la BD $conexion = mysqli_connect("localhost", "root", "", "base1") or die("Problemas con la conexión"); mysqli_query($conexion, "insert into usuarios(clave, secreta) values ('{$key_encriptada}', '{$secret_encriptada}')") or die("Problemas en el select" . mysqli_error($conexion)); mysqli_close($conexion); // CONEXIÓN CON EL SERVIDOR try { // Obtain a request object for the request we want to make $request = new OAuthRequester($url, $method, $params); // Sign the request, perform a curl request and return the results, // throws OAuthException2 exception on an error // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string) $result = $request->doRequest(); $response = $result['body']; var_dump($response); } catch (OAuthException2 $e) {
$mensaje .= "</label></div>"; } $respuesta = array("codigo" => "1", "mensaje" => $mensaje); } break; case '5': $codigo = $_POST['codigo']; $seleccion = array("ca.titulo", "cate.titulo as padre"); $limitantes[] = array("", "ca.id", "=", $codigo); $limitantes[] = array("and", "ca.estatus", "!=", "0"); $tabla = array("categoria ca LEFT OUTER JOIN categoria cate ON ca.padre = cate.id"); $respuesta = $cdb->seleccionar($seleccion, $limitantes, $tabla); if ($respuesta['codigo'] == 1) { $respuesta['mensaje'] = $respuesta['mensaje'][0]['padre'] . " -- " . $respuesta['mensaje'][0]['titulo']; } break; case '6': $estructura = $_POST['estructura']; $codigo = $_POST['codigo']; $respuesta = traer_formulario($codigo, $estructura, array($tabla)); break; case '7': $codigo = $_POST['codigo']; $respuesta = array("codigo" => "1", "mensaje" => encripta($codigo)); break; default: $respuesta = array("codigo" => "0", "mensaje" => "Error interno"); break; } echo json_encode($respuesta); }
<?php require_once "{$_SERVER['DOCUMENT_ROOT']}/granlibreria.php"; $cdb = new base(); $salida = ""; $respuesta = $cdb->seleccionar(array("titulo", "id", "imagen"), array(array("", "estatus", "=", "1"), array("and", "padre", "=", "1")), array("categoria")); if ($respuesta['codigo'] == "1") { $mensaje = $respuesta['mensaje']; for ($i = 0; $i < count($mensaje); $i++) { $salida .= "<a href=\"http://gtcompra.com/contenedores/negocios/?ct=" . encripta($mensaje[$i]['id']) . "\">" . "<div class=contenedor_categoria>" . "<div class=imagen_categoria><img src=\"" . $mensaje[$i]['imagen'] . "\"></div>" . "<label>" . $mensaje[$i]['titulo'] . "</label>" . "</div></a>"; } } else { $salida .= $respuesta['mensaje']; } encabezado("Directorio"); echo $salida; pie(); ?> <link rel="stylesheet" type="text/css" href="http://gtcompra.com/modulos/categoria/css/inicio.css">
<div class="col-md-4 services-grid wow bounceInLeft animated" data-wow-delay="0.4s" style="visibility: visible; -webkit-animation-delay: 0.4s;"> <a href="../administracion/imagenes/sistemas/<?php echo $icono[$j]; ?> " class="swipebox"> <img src="../administracion/imagenes/sistemas/<?php echo $icono[$j]; ?> " class="img-responsive" alt="" style="border-radius:50%;margin-left:18%;" /></a> <p><?php echo $nombre[$j]; ?> </p> <a href="desarrollo.php?c=<?php echo encripta($id[$j], 'rayedgard'); ?> " class="button1 hvr-shutter-in-vertical">leer más</a> </div> <?php $cont++; } ?> </div> </div> </div>
/* $trim_usuario=rtrim(ltrim($_SESSION["usuario"])); $trim_clave=rtrim(ltrim($_SESSION["clave"]));*/ $trim_usuario = rtrim(ltrim($usuario)); $trim_clave = rtrim(ltrim($clave)); $clave_des = encripta($trim_clave); $sql = "select * from usuarios where usuario='{$trim_usuario}' and clave='{$clave_des}'"; /* die($sql);*/ $result = mysql_query($sql, $con_ic); if (!$result) { $this->Error = mysql_error(); echo "error select" . $this->Error; } if ($row = mysql_fetch_array($result)) { $nivel_acceso_actual = $row["nivel_acceso"]; session_register("nivel_acceso_actual"); $clave_nueva_en = encripta(rtrim(ltrim($clave_nueva))); $sql = "update usuarios set clave='{$clave_nueva_en}' where usuario='{$trim_usuario}' "; $result = mysql_query($sql, $con_ic); /* die($sql);*/ die('Cambio la clave'); /* $_SESSION["nivel_acceso_actual"]=$nivel_acceso_actual;*/ include 'index.php'; } else { die("<br> Contraseña Inválida."); ?> <table width="780" border="0" align="center"> <tr><td><INPUT TYPE="button" VALUE="Volver" onClick="history.back()"></td></tr> </table> <?php return; }
$newentry["ou"] = $host; ldap_add($conexao, "ou=" . $host . ",ou=people," . $dn, $newentry); //echo ldap_error($conexao); } $newentry = array(); $newentry["userid"][0] = $user; $newentry["cn"][0] = $user; $newentry["uidNumber"][0] = "0"; $newentry["gidNumber"][0] = "0"; $newentry["homeDirectory"][0] = "/"; $newentry["objectclass"][0] = "top"; $newentry["objectclass"][1] = "posixAccount"; $newentry["objectclass"][2] = "account"; $newentry["objectclass"][3] = "shadowAccount"; $newentry["userpassword"][0] = "{crypt}" . crypt($password); $newentry["userpassword"][1] = encripta($password, $key, $iv); $newentry["o"][0] = $cliente; $newentry["host"][0] = $host; $newentry["description"][0] = $description; $newentry["description"][1] = $grupo; $newentry["localityName"][0] = $dc; $newentry["localityName"][1] = $hwtipo; $newentry["localityName"][2] = $ip; $newentry["localityName"][3] = $os; if (ldap_add($conexao, "uid=" . $user . ",ou=" . $host . ",ou=people," . $dn, $newentry)) { writelog("CREATE status=ok user="******" uid=" . $user . " o=" . $cliente . " host=" . $host . " description=" . $description); echo "<br><center><b>Usuário adicionado com sucesso!</b></center>"; echo "<br><a href=\"menu.php\"><img src=\"../figuras/volta.gif\" border=\"0\" align=\"middle\"> Volta ao menu principal</a>"; } else { if (ldap_errno($conexao) == 68) { echo "<br><font color=\"red\"><center><b>Este usuário já existe!</b></center></font>";
echo encripta($id[$j], 'rayedgard'); ?> " title="DESACTIVAR"><img src="../images/elimina.png"></a> </td> <td> <a href="#" onclick="javascript:direc('index.php?p=<?php echo $p; ?> &q=<?php echo $q; ?> &e=<?php echo encripta("2", "rayedgard"); ?> &cod=<?php echo encripta($id[$j], "rayedgard"); ?> ','<?php echo $nombre[$j]; ?> ');" title="ELIMINAR" ><img src="../images/eliminar.png"></a> </td> </tr> <?php $cont++; } ?> </tbody>
break; case '2': $extension = ""; @($imagen = $_FILES['archivo']); $array_nombre = explode(".", $imagen['name']); $extension = end($array_nombre); $datos = json_decode($_POST['datos']); $codigo = $_POST['codigo']; if ($extension != "") { $datos->url = "http://{$_SERVER['HTTP_HOST']}/modulos/imagen/repositorio/" . encripta($codigo) . "." . $extension; } $datos->estatus = '1'; $limitantes[] = array("", "id", "=", $codigo); $respuesta = $cdb->actualizar($datos, $limitantes, $tabla); if ($respuesta['codigo'] != 0) { $destino = "repositorio/" . encripta($codigo) . "." . $extension; if ($extension != "") { if (move_uploaded_file($_FILES['archivo']['tmp_name'], $destino)) { chmod($destino, 0755); $respuesta = array("codigo" => "1", "mensaje" => "Actualizacion Ok"); } else { $respuesta = array("codigo" => "0", "mensaje" => "Error no se actualizo la imagen"); } } else { $respuesta['mensaje'] = "Actualizacion de datos ok"; } } // break; case '3': $datos = array("estatus" => "0");
</div> <div class="boton"> <div><a href="index.php?p=<?php echo encripta($p, 'rayedgard'); ?> &q=<?php echo encripta('1', 'rayedgard'); ?> "> <img src="../images/listar.png" width="40" /></a> </div> <div><a href="index.php?p=<?php echo encripta($p, 'rayedgard'); ?> &q=<?php echo encripta('1', 'rayedgard'); ?> ">Listar</a></div> </div> </div> <!--////////////////FIN EL TITULO DE LOS FORMULARIOS////////////////--> <?php
<?php session_start(); include "extras/php/conexion.php"; $trim_usuario = strtoupper(rtrim(ltrim($_POST["usuario"]))); $trim_clave = rtrim(ltrim($_POST["clave"])); $clave_des = encripta($trim_clave); $sql = "select * from usuarios where usuario='{$trim_usuario}' and clave='{$clave_des}' and sistema like '%A%'"; //require('configuracion_ic.php'); $result = mysql_query($sql, $con); // error de acceso if (!$result) { $Error = mysql_error(); echo "error select:" . $sql . ' - ' . $Error; echo '<a href=index.php>Volver a intentar </a>'; } // si econtro if ($row = mysql_fetch_array($result)) { session_start(); $_SESSION["usuario"] = $trim_usuario; //$_POST["usuario"]; $_SESSION["usuario_adm"] = $trim_usuario; //$_POST["usuario"]; $_SESSION["usuario_nombre"] = $row["nombre"]; $_SESSION["nivel_acceso_actual"] = $row["nivel_acceso"]; /* log*/ $sql = "insert into log (usuario,sistema,fecha)values('{$trim_usuario}','ARTE JOVEN',now())"; $result = mysql_query($sql, $con); if (!$result) { $Error = mysql_error(); echo "error select" . $Error;
</td> <td> <a href="#" onclick="javascript:direc('index.php?p=<?php echo $p; ?> &q=<?php echo $q; ?> &e=<?php echo encripta("2", "rayedgard"); ?> &cod=<?php echo encripta($id[$j], "rayedgard"); ?> &nn=<?php echo encripta($nombre[$j], "rayedgard"); ?> ','<?php echo $nombre[$j]; ?> ');" title="ELIMINAR" ><img src="../images/eliminar.png"></a> </td> </tr> <?php $cont++; } ?> </tbody>