function generate()
 {
     $code = base64_encode(chr(Rand(48, 57)) . chr(Rand(65, 90)) . chr(Rand(97, 122)) . chr(Rand(48, 57)) . chr(Rand(65, 90)) . chr(Rand(97, 122)));
     mysql_query("INSERT INTO hashcodes (hashcode,timestamp) VALUES('{$code}','" . time() . "')", $this->conn);
     $results = mysql_query("SELECT autoid FROM hashcodes WHERE hashcode = '{$code}' LIMIT 0,1");
     $autoid = mysql_fetch_array($results);
     return $autoid['autoid'];
 }
Esempio n. 2
0
 public function Generator()
 {
     $chaine = null;
     for ($cpt = 0; $cpt < $this->DIGIT; $cpt++) {
         $i = Rand(0, sizeof($this->CARACS) - 1);
         $chaine .= $this->CARACS[$i];
     }
     return $chaine;
 }
Esempio n. 3
0
 function insertKey()
 {
     $objConectar = new conexion();
     $conexion = $objConectar->conectar();
     $l = time() * 2;
     $r = Rand(111, 999);
     $llave = $l . $r;
     $sql = "INSERT INTO `boobob`.`keys` (`cod`, `idusuario`) VALUES (" . $r . ", " . $this->u->id . ")";
     $res = mysql_query($sql, $conexion) or die("Error: " . mysql_error() . "\n" . $sql);
     $objConectar->desconectar();
     return $r;
 }
function generatePassword()
{
    $length = 8;
    $upperCase = true;
    $specials = true;
    $numbers = true;
    $generatedPassword = "";
    $searchString = "abcdefghijklmnopqrstuvwxyz";
    for ($i = 0; $i < $length; $i++) {
        $generatedPassword = $generatedPassword . $searchString[Rand(0, strlen($searchString) - 1)];
    }
    $_SESSION["generatedPassword"] = $generatedPassword;
    echo $generatedPassword;
}
Esempio n. 5
0
function SNAC_Create($FamilyID, $SubTypeID, $Data = '')
{
    /****************************************************************************/
    $__args_types = array('integer', 'integer', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = Bytes_I2B(WORD, HexDec($FamilyID)) . Bytes_I2B(WORD, HexDec($SubTypeID)) . Bytes_I2B(BUTE, 0) . Bytes_I2B(BUTE, 0) . Bytes_I2B(DWORD, Rand(1, 65025));
    # Номер запроса
    #-----------------------------------------------------------------------------
    $Result .= $Data;
    # Сам пакет
    #-----------------------------------------------------------------------------
    return $Result;
}
Esempio n. 6
0
function createNumber()
{
    $n1 = Rand(1, 49);
    do {
        $n2 = Rand(1, 49);
    } while ($n2 == $n1);
    do {
        $n3 = Rand(1, 49);
    } while ($n3 == $n2 || $n3 == $n1);
    do {
        $n4 = Rand(1, 49);
    } while ($n4 == $n3 || $n4 == $n2 || $n4 == $n1);
    do {
        $n5 = Rand(1, 49);
    } while ($n5 == $n4 || $n5 == $n3 || $n5 == $n2 || $n5 == $n1);
    $str = "{$n1} {$n2} {$n3} {$n4} {$n5}";
    $str .= " mega: " . Rand(1, 27) . "<br>";
    echo $str;
}
Esempio n. 7
0
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return new gException('POSTINGS_NOT_FOUND', 'Операции по договору не найдены');
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
foreach ($WorksComplite as $WorkComplite) {
    #-------------------------------------------------------------------------------
    $CreateDate = $WorkComplite['CreateDate'];
    #-------------------------------------------------------------------------------
    if (isset($Verifies[$CreateDate])) {
        $CreateDate += Rand(1, 100) / 100;
    }
    #-------------------------------------------------------------------------------
    $Comp = Comp_Load('Formats/Percent', $WorkComplite['Discont']);
    if (Is_Error($Comp)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Cost = Comp_Load('Formats/Currency', $WorkComplite['Cost']);
    if (Is_Error($Cost)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Verifies[$CreateDate] = array('Founding' => SPrintF('%s %s', $WorkComplite['Service'], $WorkComplite['Comment']), 'Measure' => $WorkComplite['Measure'], 'Amount' => (int) $WorkComplite['Amount'], 'Cost' => $Cost, 'Discont' => $Comp, 'Debet' => 0, 'Credit' => $WorkComplite['Summ']);
    #-------------------------------------------------------------------------------
}
Esempio n. 8
0
<?php

//EDIT THIS
$mysqlserver = 'localhost';
//Server - Normally Localhost
$username = '******';
//Database Username
$password = '******';
//Database Password
$database = 'quotes';
//Default of mysql import
//If you do not know what your doing, do not touch!
$con = mysqli_connect("{$mysqlserver}", "{$username}", "{$password}", "{$database}");
// Check connection
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$num = Rand(0, 2);
$result = mysqli_query($con, "SELECT * FROM quotes ORDER BY RAND() LIMIT 1");
while ($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['quote'] . "</td>";
    echo "</tr>";
}
?>
		
     default:
         $title = "No Admin type selected";
         include "header.php";
         print "You did not enter an Admin Type.  Please use the back button and try again.";
         include "footer.php";
         exit;
 }
 /* Since we've gotten this far in this if routine (i.e. the script hasn't exited),
 the user must have entered the correct Admin password.  So, we can create the cookie
 and AdminAuthorization table entry */
 srand(time());
 $Pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 $Pool .= "abcdefghijklmnopqrstuvwxyz";
 $AuthorizationCode = "";
 for ($index = 0; $index < 12; $index++) {
     $AuthorizationCode .= substr($Pool, Rand() % strlen($Pool), 1);
 }
 $LoginTime = date('YmdHis');
 /* Do the insert into the database first, so that the cookie will not be set if the
 input fails */
 if (!mysql_query("INSERT INTO adminlogins\r\n        \t\t  VALUES({$MemberID},'{$AuthorizationCode}',{$LoginTime},'{$AdminType}')")) {
     $title = "Error in authorization process";
     include "header.php";
     print "The system was unable to register your authorization information.  The database returned the following message: <p>\n";
     print mysql_error();
     include "footer.php";
     exit;
 }
 /* Made it.  Set the cookies. */
 SetCookie("AuthorizationCode", $AuthorizationCode, time() + 7200);
 SetCookie("LoginTime", $LoginTime, time() + 7200);
<center>
<?php 
//Select random number form 1 to 50
$num = Rand(1, 50);
//Based on the random number, gives a quote
switch ($num) {
    case 1:
        echo "<b>Things work out best for those who make the best of how things work out.</b><BR> <h3 style='color:#782492;padding-top:5px'><b>John Wooden</b></h3>";
        break;
    case 2:
        echo "<b>Dream Dream Dream, Dreams transform into thoughts and thoughts result in action.</b><BR><h3 style='color:#782492;padding-top:5px'><b>Dr. Abdul Kalam</b></h3>";
        break;
    case 3:
        echo "<b>To live a creative life, we must lose our fear of being wrong.</b><BR> <b><h3 style='color:#782492;padding-top:5px'>Anonymous</b></h3>";
        break;
    case 4:
        echo "<b>If you are not willing to risk the usual you will have to settle for the ordinary.</b><BR> <b><h3 style='color:#782492;padding-top:5px'>Jim Rohn</b></h3>";
        break;
    case 5:
        echo "<b>Trust because you are willing to accept the risk, not because it's safe or certain.</b><BR><h3 style='color:#782492;padding-top:5px'><b>Anonymous</b></h3>";
        break;
    case 6:
        echo "<b>Take up one idea. Make that one idea your life--think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone. This is the way to success.</b><BR><h3 style='color:#782492;padding-top:5px'><b>Swami Vivekananda</b></h3>";
        break;
    case 7:
        echo "<b>All our dreams can come true if we have the courage to pursue them.</b><BR><h3 style='color:#782492;padding-top:5px'><b>Walt Disney</b></h3>";
        break;
    case 8:
        echo "<b>Good things come to people who wait, but better things come to those who go out and get them.</b><BR><h3 style='color:#782492;padding-top:5px'><b>Anonymous</b></h3>";
        break;
    case 9:
Esempio n. 11
0
    }
    #-------------------------------------------------------------------------------
    $Config = $XML->ToArray();
    #-------------------------------------------------------------------------------
    $Config = $Config['XML'];
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $Config = array();
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!isset($Config['CSRFKey']) || !$Config['CSRFKey']) {
    #-------------------------------------------------------------------------------
    $Config['CSRFKey'] = Str_Shuffle(Md5(MicroTime() . Rand(0, 1000000)));
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Interface']['Notes'])) {
    unset($Config['Interface']['Notes']);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Other']['Libs']['Http'])) {
    unset($Config['Other']['Libs']['Http']);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Users']['Register'])) {
Esempio n. 12
0
}
// Uprava symbolu
if (isset($_POST['symbolid']) && isset($_POST['editsymbol']) && $usrinfo['right_text']) {
    auditTrail(7, 2, $_POST['symbolid']);
    pageStart('Uložení změn');
    mainMenu(5);
    if (!isset($_POST['notnew'])) {
        unreadRecords(7, $_POST['symbolid']);
    }
    sparklets('<a href="./symbols.php">symboly</a> &raquo; <a href="./editsymbol.php?rid=' . $_POST['symbolid'] . '">úprava symbolu</a> &raquo; <strong>uložení změn</strong>', '<a href="./readsymbol.php?rid=' . $_POST['symbolid'] . '">zobrazit upravené</a>');
    if (is_uploaded_file($_FILES['symbol']['tmp_name'])) {
        $sps = MySQL_Query("SELECT symbol FROM " . DB_PREFIX . "symbols WHERE id=" . $_POST['symbolid']);
        if ($spc = MySQL_Fetch_Assoc($sps)) {
            unlink('./files/symbols/' . $spc['symbol']);
        }
        $sfile = Time() . MD5(uniqid(Time() . Rand()));
        move_uploaded_file($_FILES['symbol']['tmp_name'], './files/' . $sfile . 'tmp');
        $sdst = resize_Image('./files/' . $sfile . 'tmp', 100, 100);
        imagejpeg($sdst, './files/symbols/' . $sfile);
        unlink('./files/' . $sfile . 'tmp');
        MySQL_Query("UPDATE " . DB_PREFIX . "symbols SET symbol='" . $sfile . "' WHERE id=" . $_POST['symbolid']);
    }
    if ($usrinfo['right_org'] == 1) {
        $sql = "UPDATE " . DB_PREFIX . "symbols SET `desc`='" . mysql_real_escape_string($_POST['desc']) . "', archiv='" . (isset($_POST['archiv']) ? '1' : '0') . "', search_lines='" . $_POST['liner'] . "', search_curves='" . $_POST['curver'] . "', search_points='" . $_POST['pointer'] . "', search_geometricals='" . $_POST['geometrical'] . "', search_alphabets='" . $_POST['alphabeter'] . "', search_specialchars='" . $_POST['specialchar'] . "' WHERE id=" . $_POST['symbolid'];
        MySQL_Query($sql);
    } else {
        $sql = "UPDATE " . DB_PREFIX . "symbols SET `desc`='" . mysql_real_escape_string($_POST['desc']) . "', modified='" . Time() . "', modified_by='" . $usrinfo['id'] . "', archiv='" . (isset($_POST['archiv']) ? '1' : '0') . "', search_lines='" . $_POST['liner'] . "', search_curves='" . $_POST['curver'] . "', search_points='" . $_POST['pointer'] . "', search_geometricals='" . $_POST['geometrical'] . "', search_alphabets='" . $_POST['alphabeter'] . "', search_specialchars='" . $_POST['specialchar'] . "' WHERE id=" . $_POST['symbolid'];
        MySQL_Query($sql);
    }
    echo '<div id="obsah"><p>Symbol upraven.</p></div>';
    pageEnd();
Esempio n. 13
0
 private function _taskUpdate()
 {
     foreach ($this->_devices as $mac => $device) {
         if ($device["type"] != "Plugwise(USBStick)") {
             $now = time();
             if ($device["powerrequest"] == NULL) {
                 $lastrequest = $now - $this->_pollPower - 1;
                 //writelog ("Task Update : $mac - set last request");
             } else {
                 $lastrequest = strtotime($device["powerrequest"]);
                 //writelog ("Task Update : $mac - set last request");
             }
             $diffrequest = $now - $lastrequest + Rand(-2, 2);
             if ($device["powercontact"] == NULL && $diffrequest > $this->_pollPower) {
                 writelog($this->_process . " : TaskUpdate : {$mac} - Force update power");
                 $this->_devices[$mac]["powerrequest"] = $this->_now();
                 $this->_requestDevicePowerInfo($mac);
             } elseif ($device["powercontact"] !== NULL) {
                 $lastupdate = strtotime($device["powercontact"]);
                 $diffcontact = $now - $lastupdate;
                 if ($diffcontact > $this->_pollPower && $diffrequest > $this->_pollPower) {
                     writelog($this->_process . " : TaskUpdate : {$mac} - Need update power");
                     $this->_requestDevicePowerInfo($mac);
                     $this->_devices[$mac]["powerrequest"] = $this->_now();
                 }
             }
             if ($device["inforequest"] == NULL) {
                 $lastrequest = $now - $this->_pollInfo - 1;
             } else {
                 $lastrequest = strtotime($device["inforequest"]);
             }
             $diffrequest = $now - $lastrequest + Rand(-2, 2);
             if ($device["infocontact"] == NULL && $diffrequest > $this->_pollInfo) {
                 $this->_devices[$mac]["inforequest"] = $this->_now();
                 $this->_requestDeviceInfo($mac);
             } elseif ($device["infocontact"] !== NULL) {
                 $lastupdate = strtotime($device["infocontact"]);
                 $diffcontact = $now - $lastupdate;
                 if ($diffcontact > $this->_pollInfo && $diffrequest > $this->_pollInfo) {
                     writelog($this->_process . " : TaskUpdate : {$mac} - Need update info");
                     $this->_requestDeviceInfo($mac);
                     $this->_devices[$mac]["inforequest"] = $this->_now();
                 }
             }
             /*--------------------------------------------------------------
              *          Clock Update
              *------------------------------------------------------------*/
             if ($device["clockrequest"] == NULL) {
                 $lastrequest = $now - $this->_pollClock - 1;
             } else {
                 $lastrequest = strtotime($device["clockrequest"]);
             }
             $diffrequest = $now - $lastrequest + Rand(-2, 2);
             if ($device["clockcontact"] == NULL && $diffrequest > $this->_pollClock) {
                 writelog($this->_process . " : TaskUpdate : {$mac} - Force clock update");
                 $this->_requestClockSet($mac);
                 $this->_devices[$mac]["clockrequest"] = $this->_now();
             } elseif ($device["clockcontact"] !== NULL) {
                 $lastupdate = strtotime($device["clockcontact"]);
                 $diffcontact = $now - $lastupdate;
                 if ($diffcontact > $this->_pollClock && $diffrequest > $this->_pollClock) {
                     writelog($this->_process . " : TaskUpdate : {$mac} - Need clock update");
                     $this->_requestClockSet($mac);
                     $this->_devices[$mac]["clockrequest"] = $this->_now();
                 }
             }
         }
     }
 }
Esempio n. 14
0
$m = date("M");
echo "The goal for this month is to review the {$goal[$m]} site!<br>";
echo "<hr size='1'>";
echo "TV List: ";
$site = array("hbo", "cnn", "cbs", "abc", "nbc", "fox", "tnt", "tbs", "mtv");
foreach ($site as $key => $url) {
    echo "<a href=\"http://www.{$url}.com\">{$url}</a> | ";
}
echo "<hr size = '1'>";
$x;
//declare array
for ($i = 0; $i < 50; $i++) {
    $x[$i] = $i + 1;
}
echo "Original list: <br>";
for ($i = 0; $i < sizeof($x); $i++) {
    echo $x[$i] . " ";
}
echo "<br>Shuffled list: <br>";
$size = sizeof($x);
$last = $size - 1;
for ($j = 0; $j < $last; $j++) {
    $r = Rand(0, $size - 1);
    $temp = $x[$r];
    $x[$r] = $x[$last];
    $x[$last] = $temp;
    $last--;
}
for ($i = 0; $i < sizeof($x); $i++) {
    echo $x[$i] . " ";
}
Esempio n. 15
0
 public function SaveVcard($randName = false)
 {
     if ($randName) {
         $this->fileName = $this->fileName . uniqid(MD5(Rand(00, 9999999)));
     }
     $handel = @fopen($this->saveTo . "/" . $this->fileName . ".vcf", "w");
     $write = @fwrite($handel, $this->vcard, strlen($this->vcard));
     @fclose($handel);
     return $write ? true : false;
 }
Esempio n. 16
0
<img src="img/banner1.jpg?a" border="0" title="LikesPlanet.com" style="border-radius: 12px;">
</a>
<?php 
}
?>

</td>
<td width="5"></td>
<td width="350">
<center>
<div id="HintHits">
<font color='blue' size='5'> 3 </font>
</div>
<div id="ClickMe" style="display: none;">
<?php 
for ($clickerr = 1; $clickerr <= $randclicker + Rand(0, 2); $clickerr++) {
    ?>
<input type="submit" value=">>" class="submit" style="width: 50; height: 30; background: <?php 
    if ($randclicker == $clickerr) {
        echo '#00F900';
    } else {
        echo '#FF0000';
    }
    ?>
 " onclick="SendConfirm('<?php 
    echo $clickerr;
    ?>
', '<?php 
    echo $codeconfirmm;
    ?>
', '<?php 
Esempio n. 17
0
<?php

function generateRandomString($length = 1)
{
    $characters = '0123456789abcd';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
echo Rand(0, 15) . '<br />';
// Echo the random string.
// Optionally, you can give it a desired string length.
$nama = generateRandomString();
if ($nama == 0) {
    $name = "Riedka";
}
if ($nama == 1) {
    $name = "Ollie";
}
if ($nama == 2) {
    $name = "Wiwiek";
}
if ($nama == 3) {
    $name = "Enry";
}
if ($nama == 4) {
    $name = "Fia";
}
Esempio n. 18
0
$stream = file_get_contents("php://input");
$request = empty($stream) ? $_REQUEST : $stream;
$bot = new \fritak\MessengerPlatform(['accessToken' => 'your_token', 'webhookToken' => 'my_secret_token', 'facebookApiUrl' => 'https://graph.facebook.com/v2.6/me/'], $request);
// Check if request is subscribe and then return challenge (see https://developers.facebook.com/docs/messenger-platform/implementation#setup_webhook)
if ($bot->checkSubscribe()) {
    print $bot->request->getChallenge();
    exit;
}
// Subscribe the App to a Page. Messenger documentation: In order for your webhook to receive events for a specific page, you must subscribe your app to the page.
$bot->subscribe();
// Messenger is calling your URL, someone is sending a message...
$bot->getMessagesReceived();
// Simple sending messages:
// Send a simple text message.
$bot->sendMessage($userToSendMessage, 'Example!');
// Send an image (file).
$bot->sendImage($userToSendMessage, 'http://placehold.it/150x150');
// Send a structured Message - button template.
$buttons = [new Button('Click', Button::TYPE_WEB, 'example.com'), new Button('Click2', Button::TYPE_POSTBACK, 'example.com')];
$bot->sendButton($userToSendMessage, 'Example text... Not too long, hehe.', $buttons);
// Send a structured Message - receipt template.
$elements = [new ReceiptElement(['title' => 'Panda', 'price' => 9.99]), new ReceiptElement(['title' => 'Bunny', 'price' => 9.99])];
$summary = new Summary(['total_cost' => 17.98]);
$address = new Address(['street_1' => 'Queens 1', 'city' => 'Example city', 'postal_code' => '10000', 'state' => 'DO', 'country' => 'CZ']);
$receipt = new Receipt('User', Rand(1, 9999), 'USD', 'card', $elements, $summary, $address, $adjustments, time(), 'example.com');
$adjustments = [new Adjustment(['name' => 'Discount', 'amount' => 2])];
$bot->sendReceipt($userToSendMessage, $receipt);
// You can send it with StructuredMessage:
$bot->sendComplexMessage(new StructuredMessage($userToSendMessage, ['url' => 'http://placehold.it/150x150'], MessageSend::NOTIFICATION_TYPE_SILENT_PUSH, StructuredMessage::ATTACHMENT_TYPE_IMAGE));
$bot->sendComplexMeesage(new StructuredMessage($userToSendMessage, [new Element('Example.', 'Example...', 'http://placehold.it/150x150', 'http://placehold.it/150x150', [new Button('Click', Button::TYPE_WEB, 'example.com')])], MessageSend::NOTIFICATION_TYPE_SILENT_PUSH, StructuredMessage::ATTACHMENT_TYPE_TEMPLATE, StructuredMessage::TEMPLATE_PAYLOAD_TYPE_GENERIC));
$bot->sendComplexMeesage(new StructuredMessage($userToSendMessage, ['text' => 'Example text... Not too long, hehe.', 'buttons' => [new Button('Click', Button::TYPE_WEB, 'example.com'), new Button('Click2', Button::TYPE_POSTBACK, 'example.com')]], MessageSend::NOTIFICATION_TYPE_SILENT_PUSH, StructuredMessage::ATTACHMENT_TYPE_TEMPLATE, StructuredMessage::TEMPLATE_PAYLOAD_TYPE_BUTTON));
Esempio n. 19
0
 /**
  * A kind of deconstructor but not always run
  *
  * @param int $time Time to mark all topics as read to the time set
  * @author Geoffrey Dunn <*****@*****.**>
  * @since 1.2.0
  **/
 function cleanup()
 {
     if ($this->cleanupchance && Rand(1, 20) == 1) {
         $this->_cleanup_readmarks();
     }
 }
Esempio n. 20
0
        sparklets('<a href="./cases.php">případy</a> &raquo; <a href="./editcase.php?rid=' . $_POST['caseid'] . '">úprava případu</a> &raquo; <strong>uložení změn</strong>', '<a href="./readcase.php?rid=' . $_POST['caseid'] . '">zobrazit upravené</a>');
        echo '<div id="obsah"><p>Případ upraven.</p></div>';
    }
    pageEnd();
} else {
    if (isset($_POST['editcase'])) {
        pageStart('Uložení změn');
        mainMenu(4);
        sparklets('<a href="./cases.php">případy</a> &raquo; <a href="./editcase.php?rid=' . $_POST['caseid'] . '">úprava případu</a> &raquo; <strong>uložení změn neúspěšné</strong>');
        echo '<div id="obsah"><p>Chyba při ukládání změn, ujistěte se, že jste vše provedli správně a máte potřebná práva.</p></div>';
        pageEnd();
    }
}
if (isset($_POST['uploadfile']) && is_uploaded_file($_FILES['attachment']['tmp_name']) && is_numeric($_POST['caseid']) && is_numeric($_POST['secret'])) {
    auditTrail(3, 4, $_POST['caseid']);
    $newname = Time() . MD5(uniqid(Time() . Rand()));
    move_uploaded_file($_FILES['attachment']['tmp_name'], './files/' . $newname);
    $sql = "INSERT INTO " . DB_PREFIX . "data VALUES('','" . $newname . "','" . mysql_real_escape_string($_FILES['attachment']['name']) . "','" . mysql_real_escape_string($_FILES['attachment']['type']) . "','" . $_FILES['attachment']['size'] . "','" . Time() . "','" . $usrinfo['id'] . "','3','" . $_POST['caseid'] . "','" . $_POST['secret'] . "')";
    MySQL_Query($sql);
    if (!isset($_POST['fnotnew'])) {
        unreadRecords(3, $_POST['caseid']);
    }
    Header('Location: ' . $_POST['backurl']);
} else {
    if (isset($_POST['uploadfile'])) {
        pageStart('Přiložení souboru');
        mainMenu(4);
        sparklets('<a href="./cases.php">případy</a> &raquo; <a href="./editcase.php?rid=' . $_POST['caseid'] . '">úprava případu</a> &raquo; <strong>přiložení souboru neúspěšné</strong>');
        echo '<div id="obsah"><p>Soubor nebyl přiložen, něco se nepodařilo. Možná nebyl zvolen přikládaný soubor.</p></div>';
        pageEnd();
    }
 function imageCircle()
 {
     $total = 0;
     $item_array = Split($this->ARRAYSPLIT, $this->ITEMARRAY);
     $num = Count($item_array);
     $item_max = 0;
     for ($i = 0; $i < $num; $i++) {
         $item_max = Max($item_max, $item_array[$i]);
         $total += $item_array[$i];
     }
     $yy = $this->Y - $this->BORDER * 2;
     //画饼状图的阴影部分
     $e = 0;
     for ($i = 0; $i < $num; $i++) {
         srand((double) microtime() * 1000000);
         if ($this->R != 255 && $this->G != 255 && $this->B != 255) {
             $R = Rand($this->R, 200);
             $G = Rand($this->G, 200);
             $B = Rand($this->B, 200);
         } else {
             $R = Rand(50, 200);
             $G = Rand(50, 200);
             $B = Rand(50, 200);
         }
         $s = $e;
         $leight = $item_array[$i] / $total * 360;
         $e = $s + $leight;
         $color = ImageColorAllocate($this->IMAGE, $R, $G, $B);
         $colorarray[$i] = $color;
         //画圆
         for ($j = 90; $j > 70; $j–) {
             imagefilledarc($this->IMAGE, 110, $j, 200, 100, $s, $e, $color, IMG_ARC_PIE);
         }
         //imagefilledarc($this->IMAGE, 110, 70, 200, 100, $s, $e, $color, IMG_ARC_PIE);
         //ImageFilledRectangle($this->IMAGE,$this->BORDER,$yy-$this->BORDER,$leight,$yy,$color);
         //ImageString($this->IMAGE,$this->FONTSIZE,$leight+2,$yy-$this->BORDER,$item_array[$i],$this->FONTCOLOR);
         //用于间隔
         $yy = $yy - $this->BORDER * 2;
     }
     //画饼状图的表面部分
     $e = 0;
     for ($i = 0; $i < $num; $i++) {
         srand((double) microtime() * 1000000);
         if ($this->R != 255 && $this->G != 255 && $this->B != 255) {
             $R = Rand($this->R, 200);
             $G = Rand($this->G, 200);
             $B = Rand($this->B, 200);
         } else {
             $R = Rand(50, 200);
             $G = Rand(50, 200);
             $B = Rand(50, 200);
         }
         $s = $e;
         $leight = $item_array[$i] / $total * 360;
         $e = $s + $leight;
         //$color=$colorarray[$i];
         $color = ImageColorAllocate($this->IMAGE, $R, $G, $B);
         //画圆
         //for ($j = 90; $j > 70; $j–) imagefilledarc($this->IMAGE, 110, $j, 200, 100, $s, $e, $color, IMG_ARC_PIE);
         imagefilledarc($this->IMAGE, 110, 70, 200, 100, $s, $e, $color, IMG_ARC_PIE);
     }
 }
Esempio n. 22
0
        }
        $File = SPrintF('%s/Config.xml', $Folder);
        $Data = <<<EOD
<XML>
 <DBConnection>
  <User>%s</User>
  <Password>%s</Password>
  <DbName>%s</DbName>
  <Server>%s</Server>
  <Port>%s</Port>
 </DBConnection>
 <EncryptionKey>%s</EncryptionKey>
 <CSRFKey>%s</CSRFKey>
</XML>
EOD;
        if (File_Put_Contents($File, SPrintF($Data, $__SETTINGS['db-user'], $__SETTINGS['db-password'], $__SETTINGS['db-name'], $__SETTINGS['db-server'], $__SETTINGS['db-port'], Str_Shuffle(Md5(MicroTime() . Rand(0, 1000000))), Str_Shuffle(Md5(MicroTime() . Rand(0, 1000000)))))) {
            Message('Настройки конфигурации успешно сохранены');
            if (!chmod($File, 0600)) {
                Error(SPrintF('Не удалось поставить права 0600 на файл конфигурации (%s)', $File));
            } else {
                Message(SPrintF('Права 0600 на файл конфигурации (%s) успешно установлены.', $File));
                # пропускаем стадию с рассказом про триггеры и предложением их установки
                #$__STEP_ID = 5;
                $__STEP_ID = 6;
            }
        } else {
            Error(SPrintF('Не возможно создать файл конфигурации (%s)', $File));
        }
    }
}
#-------------------------------------------------------------------------------
Esempio n. 23
0
 private function create_str()
 {
     if ($this->config['type'] == "int") {
         for ($i = 1; $i <= $this->config['length']; $i++) {
             $coder .= Rand(0, 9);
         }
         $_SESSION[$this->config['codname']] = $coder;
         return True;
     }
     $len = strlen($this->str[$this->config['type']]);
     if (!$len) {
         $this->config['type'] = "default";
         $this->create_str();
     }
     for ($i = 1; $i <= $this->config['length']; $i++) {
         $offset = rand(0, $len - 1);
         $coder .= substr($this->str[$this->config['type']], $offset, 1);
     }
     $_SESSION[$this->config['codname']] = $coder;
     return True;
 }
Esempio n. 24
0
 function getOffsets()
 {
     $width_left = $this->original_width - $this->mark_width;
     $height_left = $this->original_height - $this->mark_height;
     switch ($this->mark_position) {
         case "TL":
             // Top Left
             $this->mark_offset_x = $width_left >= 5 ? 5 : $width_left;
             $this->mark_offset_y = $height_left >= 5 ? 5 : $height_left;
             break;
         case "TM":
             // Top middle
             $this->mark_offset_x = intval(($this->original_width - $this->mark_width) / 2);
             $this->mark_offset_y = $height_left >= 5 ? 5 : $height_left;
             break;
         case "TR":
             // Top right
             $this->mark_offset_x = $this->original_width - $this->mark_width;
             $this->mark_offset_y = $height_left >= 5 ? 5 : $height_left;
             break;
         case "CL":
             // Center left
             $this->mark_offset_x = $width_left >= 5 ? 5 : $width_left;
             $this->mark_offset_y = intval(($this->original_height - $this->mark_height) / 2);
             break;
         case "CM":
             // Center middle
             $this->mark_offset_x = intval(($this->original_width - $this->mark_width) / 2);
             $this->mark_offset_y = intval(($this->original_height - $this->mark_height) / 2);
             break;
         case "CR":
             // Center right
             $this->mark_offset_x = $this->original_width - $this->mark_width;
             $this->mark_offset_y = intval(($this->original_height - $this->mark_height) / 2);
             break;
         case "BL":
             // Bottom left
             $this->mark_offset_x = $width_left >= 5 ? 5 : $width_left;
             $this->mark_offset_y = $this->original_height - $this->mark_height - 5;
             break;
         case "BM":
             // Bottom middle
             $this->mark_offset_x = intval(($this->original_width - $this->mark_width) / 2);
             $this->mark_offset_y = $this->original_height - $this->mark_height - 5;
             break;
         case "BR":
             // Bottom right
             $this->mark_offset_x = $this->original_width - $this->mark_width - 5;
             $this->mark_offset_y = $this->original_height - $this->mark_height - 5;
             break;
         case "ABS":
             // Absolute position
             $this->mark_offset_x = $this->mark_offset_x >= 0 && $this->mark_offset_x <= $width_left ? $this->mark_offset_x : 0;
             $this->mark_offset_y = $this->mark_offset_y >= 0 && $this->mark_offset_y <= $height_left ? $this->mark_offset_y : 0;
             break;
         case "RND":
             $this->mark_offset_x = Rand(5, $width_left - 5);
             $this->mark_offset_y = Rand(5, $height_left - 5);
             break;
     }
 }
Esempio n. 25
0
    $Config = $XML->ToArray();
    #-----------------------------------------------------------------------------
    $Config = $Config['XML'];
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $Config = array();
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['EncryptionKey'])) {
    $OldEncryptionKey = $Config['EncryptionKey'];
}
#-------------------------------------------------------------------------------
$Config['EncryptionKey'] = Md5(MicroTime() . Rand(0, 1000000));
#-------------------------------------------------------------------------------
Debug(SPrintF("[patches/hosting/files/1000011.php]: Config = %s", print_r($Config, true)));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$File = IO_Write($ConfigPath, To_XML_String($Config), TRUE);
if (Is_Error($File)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsFlush = CacheManager::flush();
if (!$IsFlush) {
    @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Esempio n. 26
0
	<body>
		<div id="fb-root"></div>
		<script>(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4&appId=273504892693836";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));</script>
		
		<div id="container">
			<span id="first"><a href="http://whentumblrisdown.com" title="Click for another one... or just refresh">When Tumblr is down, </a></span>
			<span id="second"><a href="http://whentumblrisdown.com" title="Click for another one... or just refresh">
<?
//Chooses a random number
$num = Rand (1,54);
//Based on the random number, gives a second part
switch ($num)
{
case 1:
echo "this is the most entertaining site you'll find.";
break;
case 2:
echo "you'll have to go directly to CollegeHumor to watch Jake &amp; Amir.";
break;
case 3:
echo "you'll have to go somewhere else to look at p**n.";
break;
case 4:
echo "you'll finally have time to finish that project.";
break;
Esempio n. 27
0
    $DiskTemplates = Explode("\n", $VPSServer->Settings['Params']['DiskTemplate']);
    #-------------------------------------------------------------------------------
    $Template = Explode('=', Trim($DiskTemplates[0]));
    #-------------------------------------------------------------------------------
    $DiskTemplate = $Template[0];
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/VPSCreate]: DiskTemplate = (%s)', print_r($DiskTemplate, true)));
#-------------------------------------------------------------------------------
$VPSOrder['DiskTemplate'] = $DiskTemplate;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IPsPool = Explode("\n", $VPSServer->Settings['Params']['IPsPool']);
#-------------------------------------------------------------------------------
$IP = $IPsPool[Rand(0, Count($IPsPool) - 1)];
#-------------------------------------------------------------------------------
$Args = array($VPSOrder, $IP, $VPSScheme);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IsCreate = Call_User_Func_Array(array($VPSServer, 'Create'), $Args);
#-------------------------------------------------------------------------------
switch (ValueOf($IsCreate)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return $IsCreate;
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
if ($fast < 1) {
    $fast = 0;
} else {
    $fast = 1;
}
//echo $query_num . ' ' . $vis;
$name = basename($image_url);
$fullname = $savepath . $name;
$pos = strrpos($fullname, ".");
if ($pos === false) {
    // note: three equal signs
    // not found...
    $fullname = $fullname . '.jpg';
    $pos = strrpos($fullname, ".");
}
$fullnamet = substr_replace($fullname, "_" . Rand(), $pos, 0);
downloadFile($image_url, $fullnamet);
$output = shell_exec("md5sum " . $fullnamet);
list($md5, $tmp) = split(" ", $output);
$fullname = substr_replace($fullname, "_" . $md5, $pos, 0);
if (file_exists($fullname)) {
    //echo "The file $filename exists";
    unlink($fullnamet);
} else {
    //echo "The file $filename does not exist";
    rename($fullnamet, $fullname);
}
$fgval = fopen("global_var.json", "rb");
$gread = fread($fgval, filesize("global_var.json"));
$global_var = json_decode($gread);
if ($fast) {
Esempio n. 29
0
}
#-------------------------------------------------------------------------------
$Table[] = array(new Tag('NOBODY', new Tag('SPAN', 'Подтверждение пароля'), new Tag('BR'), new Tag('SPAN', array('class' => 'Comment'), 'Аналогично полю [Будущий пароль]')), $Comp);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Table[] = 'Персональные данные';
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => 'Name', 'size' => 25, 'class' => 'Duty', 'prompt' => $Messages['Prompts']['User']['Name'], 'type' => 'text'));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table[] = array(new Tag('NOBODY', new Tag('SPAN', 'Ваше имя'), new Tag('BR'), new Tag('SPAN', array('class' => 'Comment'), 'Например: Иван Иванович')), $Comp);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Img = new Tag('IMG', array('id' => 'Protect', 'align' => 'left', 'width' => 80, 'height' => 30, 'alt' => 'Включите отображение картинок', 'src' => SPrintF('/Protect?Rand=%u', Rand(1000, 9999))));
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('name' => 'Protect', 'size' => 8, 'class' => 'Duty', 'type' => 'text'));
if (Is_Error($Comp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (!isset($GLOBALS['__USER']) && $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR']) {
    #-------------------------------------------------------------------------------
    $Table[] = 'Защита от автоматических регистраций';
    #-------------------------------------------------------------------------------
    $Table[] = array(new Tag('NOBODY', new Tag('SPAN', 'Защитный код'), new Tag('BR'), new Tag('SPAN', array('class' => 'Comment'), 'Цифры на изображении')), new Tag('DIV', $Img, new Tag('SPAN', ' = '), $Comp));
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Esempio n. 30
0
$User = DB_Select('Users', 'ID', array('UNIQ', 'ID' => $UserID ? $UserID : $GLOBALS['__USER']['ID']));
#-------------------------------------------------------------------------------
switch (ValueOf($User)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$UserID = (int) $User['ID'];
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('Users', array('Watchword' => Md5($Password), 'UniqID' => Md5(SPrintF('%s.%s,', UniqID(), Rand(0, 1000000)))), array('ID' => $UserID));
if (Is_Error($IsUpdate)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Path = SPrintF('%s/sessions', $Tmp);
#-------------------------------------------------------------------------------
if (File_Exists($Path)) {
    #-------------------------------------------------------------------------------
    $SessionIDsIDs = IO_Scan($Path);