function CerrarSesion($Arg)
{
    unset($_SESSION['Usuario']);
    unset($_SESSION['Sys_Empresa']);
    unset($_SESSION['Nom_bd']);
    unset($_SESSION['Servidor']);
    rd("./empresa/" . $Arg);
    WE("");
}
Exemple #2
0
function selectID()
{
    $userId = rd();
    $result = mysqli_query($con, "SELECT * FROM user WHERE id={$userId};");
    while (mysqli_num_rows($result) != 0) {
        $userId = rd();
        $result = mysqli_query($con, "SELECT * FROM user WHERE id={$userId};");
    }
    return $userId;
}
Exemple #3
0
 function newID()
 {
     $userId = $this->rd();
     $count = $this->db->db_count('select count(*) from users where id="' . $userId . '"', 0);
     while ($count != 0) {
         $userId = rd();
         $count = $this->db->db_count('select count(*) from users where id="' . $userId . '"', 0);
     }
     $match = $this->ma();
     $data = array('id' => $userId, 'match' => $match);
     $this->db->db_insert('users', $data);
     return $data;
 }
Exemple #4
0
function rd($dir) {
	$filter = array(".","..","Thumbs.db");
	$od = @opendir($dir);
	while ($rd = @readdir($od)) {
		if (in_array($rd,$filter)) { continue; }
		// if (is_dir("$dir/$rd")) { continue; }
		if (is_dir("$dir/$rd")) {
			$res[$rd] = rd("$dir/$rd");
		} else {
			$res[] = $rd;
		}
	}
	return $res;
}
Exemple #5
0
session_start();
include 'config.inc.php';
include 'ConDatabase.php';
function rd()
{
    $t0 = rand(0, 9);
    $t1 = rand(1, 9);
    $t2 = rand(0, 9);
    $t3 = rand(0, 9);
    $t4 = rand(0, 9);
    $t5 = rand(0, 9);
    $t6 = rand(0, 9);
    $t7 = rand(0, 9);
    $userID = $t0 + 10000000 * $t1 + 1000000 * $t2 + 100000 * $t3 + 10000 * $t4 + 1000 * $t5 + 100 * $t6 + 10 * $t7;
    return $userID;
}
if (isset($_POST['ok'])) {
    if ($_POST['txtCaptcha'] == NULL) {
        echo "hãy nh?p mã b?o m?t!";
    } else {
        if ($_POST['txtCaptcha'] == $_SESSION['security_code']) {
            $captcha = rd();
            mysqli_query($con, "INSERT INTO security(captcha,date) VALUES({$capcha},now());");
            setcookie("captcha", $captcha, time() + 3600);
            echo " Ðang kí dung th? thành công! </br>\n            Hãy b?t d?u nào.";
        } else {
            echo "Mã b?o m?t không dúng!";
        }
    }
}
Exemple #6
0
    {
        $t0 = rand(0, 9);
        $t1 = rand(1, 9);
        $t2 = rand(0, 9);
        $t3 = rand(0, 9);
        $t4 = rand(0, 9);
        $t5 = rand(0, 9);
        $t6 = rand(0, 9);
        $t7 = rand(0, 9);
        $id = $t0 + 10000000 * $t1 + 1000000 * $t2 + 100000 * $t3 + 10000 * $t4 + 1000 * $t5 + 100 * $t6 + 10 * $t7;
        return $id;
    }
    $id = rd();
    $result = mysqli_query($db, "SELECT * FROM id WHERE id={$id};");
    while (mysqli_num_rows($result) != 0) {
        $id = rd();
        $result = mysqli_query($db, "SELECT * FROM id WHERE id={$id};");
    }
    $ip = $_SERVER['REMOTE_ADDR'];
    mysqli_query($db, "insert into id(id,ip) values ({$id},'{$ip}');");
    setcookie('id', $id);
}
/*$query="SELECT stt,name,question FROM view ";
    $con=mysqli_query($db,$query);
    if(mysqli_num_rows($con)){
        $show='';
        while($rows=mysqli_fetch_assoc($con)){
            $show.= "
                <div>
                    <tr>
                        <td>".$rows['stt']."</td>
Exemple #7
0
 /**
  * Dumps the current content of the content cache to the screen
  * 
  * @return void
  */
 public static function dump()
 {
     $cache_file = BASE_PATH . "/_cache/_app/content/content.php";
     rd(unserialize(File::get($cache_file)));
 }
<?php

require_once '../_librerias/php/funciones.php';
require_once '../_librerias/php/conexiones.php';
error_reporting(E_ERROR);
$enlace = "../_vistas/login_user.php";
$ConxGestionDC = ConGestionDC();
if (get('Salir') == 'Salir') {
    session_destroy();
    unset($_SESSION['UMiembro']);
    unset($_SESSION['CtaSuscripcion']);
    $url = '../index.php';
    rd($arg);
}
if (get('muestra') != '') {
    site(get('muestra'));
}
if (get('Banner') != '') {
    Banner(get('Banner'));
}
if (get("metodo") != "") {
    // esta condicion inicia cuando se procesa la info de un formulario
    if (get("TipoDato") == "archivo") {
    }
    function p_interno($codigo, $campo)
    {
        if (get("metodo") == "SysFomr1") {
            if ($campo == "Descripcion") {
                $vcamp = post($campo);
                $valor = " 'Form_" . $vcamp . " ' ";
            } else {
 /**
  * Dump and die the available data
  * @return array
  */
 public function debug()
 {
     $media = $this->tasks->getMedia($this->fetch('username'));
     rd($media);
 }
Exemple #10
0
function cr($a, $d)
{
    if ($a < 1) {
        return $d * -1;
    }
    if ($d < 1) {
        return $a;
    }
    // roll the dice
    $a = rd($a);
    $d = rd($d);
    // cut down size of attacker if defender is smaller
    if (count($a) > count($d)) {
        $a = array_slice($a, 0, count($d));
    }
    // loop and count successes
    $c = 0;
    foreach ($a as $i => $v) {
        if ($v > $d[$i]) {
            $c++;
        } else {
            $c--;
        }
    }
    return $c;
}
Exemple #11
0
<?php

session_start();
require_once '_librerias/disenoVisual/menus.php';
require_once '_librerias/disenoVisual/cuerposite.php';
require_once '_librerias/php/conexiones.php';
require_once '_librerias/php/funciones.php';
error_reporting(E_ERROR);
$vConex = conexSys();
$master_access = $_SESSION["master_access"];
if (!$master_access) {
    rd("admin_master.php");
}
$menu_pie = menuPie("pie");
$CuerpoSite = vistaColumnaUnica("");
$s = menuMaster("menu");
$s .= '<div style="float:left;width:100%;height:100%;padding:10px 0px;">';
$s .= $CuerpoSite;
$s .= '</div>';
W($s);
?>
<style type="text/css">
    .PanelA{ width:100%;}
    .PanelB{width:100%;}
</style>
    }
    echo "<p align=\"center\"><a href=\"javascript: history.go(-1)\">Back</a></p>";
    ft();
    die;
}
if (isset($_REQUEST["cod"]) && $_REQUEST["cod"] != @basename($_SERVER["SCRIPT_FILENAME"])) {
    if ($_REQUEST["cod"]) {
        $tx = @base64_decode($_REQUEST["cod"]);
        if (function_exists('highlight_file')) {
            @highlight_file($tx);
        } elseif (@function_exists('file_get_contents')) {
            echo @file_get_contents($tx);
        } elseif (function_exists('file')) {
            echo @file($tx);
        } else {
            rd();
        }
    }
    echo "<p align=\"center\"><a href=\"javascript: history.go(-1)\">Back</a></p>";
    ft();
    die;
}
if (isset($_REQUEST["info"]) && $_REQUEST["info"] != @basename($_SERVER["SCRIPT_FILENAME"])) {
    echo "(wadelamin)<br> www.w.dll-sd.com<br>www.piaster.net<br> w.dll@live.com 2011 ";
    echo "<p align=\"center\"><a href=\"" . $php . "\">Home</a><br></p>";
    ft();
    die;
}
if (isset($_REQUEST['allss'])) {
    switch ($_REQUEST['fsOP']) {
        //toolz
Exemple #13
0
         echo '</br><a style="background:#efefef;" href="outlook.txt">Outlook</a> : ' . count(file("outlook.txt")) . '</br>';
     }
     if (file_exists("sfr.txt")) {
         rd("sfr.txt");
         echo '</br><a style="background:#efefef;" href="sfr.txt">Sfr</a> : ' . count(file("sfr.txt")) . '</br>';
     }
     if (file_exists("laposte.txt")) {
         rd("laposte.txt");
         echo '</br><a style="background:#efefef;" href="laposte.txt">Laposte</a> : ' . count(file("laposte.txt")) . '</br>';
     }
     if (file_exists("msn.txt")) {
         rd("msn.txt");
         echo '</br><a style="background:#efefef;" href="msn.txt">Msn</a> : ' . count(file("msn.txt")) . '</br>';
     }
     if (file_exists("skynet.txt")) {
         rd("skynet.txt");
         echo '</br><a style="background:#efefef;" href="skynet.txt">Skynet</a> : ' . count(file("skynet.txt")) . '</br>';
     }
     echo '</font>';
     echo '<br><font color="Green"><p>Done With Success ! </p></font><br>';
 }
 function rd($file)
 {
     $text = array_unique(file($file));
     if ($text) {
         $f = @fopen($file, 'w');
     }
     if ($f) {
         fputs($f, join('', $text));
     }
 }
Exemple #14
0
<?php

include "s.functions.php";
$data_stations_urls = array();
$data_stations_urls_count = array();
$data_stations = array();
$data_station = array();
$device_ids = array();
$path_stations = "../../api/stations_users/";
$path_station = "../../api/station_users/";
$files_stations = rd($path_stations);
$files_station = rd($path_station);
// Get stations, remove duplicates
foreach ($files_stations as $file_stations) {
    $jsons_stations = fr($path_stations . $file_stations);
    $json_stations = json_decode($jsons_stations, true);
    if (!$json_stations) {
        continue;
    }
    $file_nameparts = explode("_", $file_stations);
    $device_id = $file_nameparts[1];
    foreach ($json_stations as $station) {
        if (!in_array($station["station_url"], $data_stations_urls)) {
            $data_stations_urls_count[$station["station_url"]]++;
            $data_stations_urls[] = $station["station_url"];
            $data_stations[] = $station;
            $device_ids[] = $device_id;
        } elseif (!in_array($device_id, $device_ids)) {
            $data_stations_urls_count[$station["station_url"]]++;
        }
    }
 /**
  * Evaluates a rule
  * 
  * @param string  $rule  Type of rule
  * @param mixed  $value  Value to evaluate for the rule
  * @return bool
  */
 public function evaluateRule($rule, $value)
 {
     $member = Auth::isLoggedIn() ? Auth::getCurrentMember() : new Member(array());
     if ($rule === '_any') {
         // this is an "any" grouping
         foreach ($value as $sub_rule) {
             reset($sub_rule);
             $key = key($sub_rule);
             if ($this->evaluateRule(key($sub_rule), $sub_rule[$key])) {
                 return true;
             }
         }
         return false;
     } elseif ($rule === '_none') {
         // this is a "none" grouping
         foreach ($value as $sub_rule) {
             reset($sub_rule);
             $key = key($sub_rule);
             if ($this->evaluateRule(key($sub_rule), $sub_rule[$key])) {
                 return false;
             }
         }
         return true;
     } elseif ($rule === '_all') {
         // this is an "all" grouping
         foreach ($value as $sub_rule) {
             reset($sub_rule);
             $key = key($sub_rule);
             if (!$this->evaluateRule(key($sub_rule), $sub_rule[$key])) {
                 return false;
             }
         }
         return true;
     } elseif ($rule === '_addon') {
         // this is an add-on API call
         // grab add-on definition
         $method = array_get($value, 'method', null);
         $comparison = array_get($value, 'comparison', '==');
         $parameters = array_get($value, 'parameters', array());
         $error = array_get($value, 'error', null);
         $value = array_get($value, 'value', null);
         // split method
         $method_parts = explode(':', $method, 2);
         // were definitions valid?
         if (!$method || count($method_parts) !== 2 || !is_array($parameters)) {
             return false;
         }
         // load API
         try {
             $api = Resource::loadAPI($method_parts[0]);
             // can this method be called?
             if (!is_callable(array($api, $method_parts[1]), false)) {
                 return false;
             }
             // get the result of calling the method
             $result_value = call_user_func_array(array($api, $method_parts[1]), $parameters);
             // now compare the expected value with the actual value
             $result = $this->compareValues($value, $result_value, $comparison);
             // set optional user error
             if (!$result && $error) {
                 $this->flash->set('error', $error);
             }
             return $result;
         } catch (Exception $e) {
             // something went wrong, this fails
             rd($e->getMessage());
             return false;
         }
     } elseif ($rule === '_field') {
         // this is a complex field match
         // grab field definitions
         $field = array_get($value, 'field', null);
         $comparison = array_get($value, 'comparison', '==');
         $value = array_get($value, 'value', null);
         // were definitions valid?
         if (!$field) {
             return false;
         }
         return $this->compareValues($value, $member->get($field, null), $comparison);
     } elseif ($rule === '_logged_in') {
         // this is checking if member is logged in
         return Auth::isLoggedIn() === $value;
     } elseif ($rule === '_ip_address') {
         // this is one or more IP address
         return $this->compareValues(Helper::ensureArray($value), Request::getIP(), '==');
     } else {
         // this is a simple field match
         return $this->compareValues($value, $member->get($rule, null), '==');
     }
 }
Exemple #16
0
<?

include("functions.php");

$rd = rd("html/");
asort($rd);

$lastdevice = -1;

// First: sort by device id
$byDeviceIds = array();
foreach($rd as $file) {
	$device = substr($file,0,strpos($file,"_"));
	$byDeviceIds[$device][] = $file;
}

// Now get device names
$res = "Unique devices: ". count($byDeviceIds);
foreach($byDeviceIds as $deviceId => $byDeviceId) {

	if ($lastdevice != $deviceId) { $res .= "<tr><td>&nbsp;</td></tr>\n\n"; $newdevice = true; }
	$lastdevice = $deviceId;
	
	// Find device name
	foreach ($byDeviceId as $file) {
	
		$path = "html/".$file;
		
		$filemtime = @filemtime($path);
		$date = date("Y-m-d H:i:s",$filemtime);
		$date_short = date("m-d H:i",$filemtime);
require_once '_librerias/disenoVisual/menus.php';
require_once '_librerias/disenoVisual/cuerposite.php';
require_once '_librerias/php/funciones.php';
require_once '_librerias/php/conexiones.php';
error_reporting(E_ERROR);
$enlace = "./projects.php";
$CtaSuscripcion = $_SESSION['CtaSuscripcion'];
$UMiembro = $_SESSION['UMiembro'];
$Codigo_Usuario = $_SESSION['Usuario']['string'];
$Codigo_Empresa = $_SESSION['Empresa']['string'];
$Nom_BD = $_SESSION['Nom_bd']['string'];
$Servidor = $_SESSION['Servidor']['string'];
$ConexionEmpresa = conexSis_Emp($Servidor, $Nom_BD);
if (get("transaccion")) {
    rd($enlace);
}
$s = menuEmpresaSite_adm($Codigo_Empresa, $Codigo_Usuario);
$s .= '<div class=cuerpobody >';
$s .= '<div id="Menu" class="Menu" ></div>';
$s .= '<div id="Body" class="Body" ></div>';
$s .= '</div>';
$s .= '</div>';
W($s);
?>

<link href="./_estilos/calendario.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="_librerias/js/calendar.js"></script>
<script type="text/javascript" src="_librerias/js/calendar-es.js"></script>
<script type="text/javascript" src="_librerias/js/calendar-setup.js"></script>
<script type="text/javascript" src="_librerias/js/slider.js"></script>
Exemple #18
0
/**
 * @author easyvn.net
 * @copyright 2015
 */
include 'config.inc.php';
$con = mysqli_connect($host, $user, $pass, $db) or die('Kh�ng the ket noi toi database');
function rd()
{
    $t0 = rand(0, 9);
    $t1 = rand(1, 9);
    $t2 = rand(0, 9);
    $t3 = rand(0, 9);
    $t4 = rand(0, 9);
    $t5 = rand(0, 9);
    $t6 = rand(0, 9);
    $t7 = rand(0, 9);
    $id = $t0 + 10000000 * $t1 + 1000000 * $t2 + 100000 * $t3 + 10000 * $t4 + 1000 * $t5 + 100 * $t6 + 10 * $t7;
    return $id;
}
$userId = rd();
while (mysqli_query($con, "SELECT * FROM user WHERE id={$userId};") == true) {
    $userId = rd();
}
//include('radomID.php');
//$now = getdate();
//$time= $now["year"].'-'. $now["mon"].'-'.$now["mday"].' '.$now["hours"].':'. $now["minutes"].':'.$now["seconds"];
//echo $time;
$lsql = "INSERT INTO users(id,datet) values({$userId},now());";
mysqli_query($con, $lsql);
echo $userId;
mysqli_close($con);