예제 #1
0
파일: index.php 프로젝트: OpenTransfr/Core
}
// Get the ID of the entity:
$entityID = $row['Entity'];
// Is the entity that signed this request the entity that registered it?
if ($verifiedEntity != $entityID) {
    // Not signed by the current owner.
    error('entity/notowner');
}
// Ok! Get the new values for the fields.
// New entity?
$newEntity = safe('entity', VALID_DOMAIN, null, true);
if ($newEntity != null) {
    // Get the local ID for this entity:
    $entityRow = $dz->get_row('select ID from `Root.Entities` where Endpoint="' . $newEntity . '"');
    if (!$entityRow) {
        // Entity was not found.
        error('entity/notfound');
    }
    // Update newEntity with the ID:
    $newEntity = $entityRow['ID'];
}
// New public key?
$key = safe('key', VALID_HEX, null, true);
if ($key != null) {
    // Add unhex around the hex key:
    $key = 'UNHEX("' . $key . '")';
}
// Get the SQL changes string (errors if there are none):
$changes = changes(array('Entity' => $newEntity, 'Key' => $key));
// Run the query now:
$dz->query('update `Root.Usernames` set ' . $changes . ' where ID=' . $row['ID']);
예제 #2
0
    $t = microtime();
    $tt = explode(' ', $t);
    return $tt[0] + $tt[1];
}
//----------------------------------------------------------
/* #####################################################################
   # Run baby, run !                                                   #
   #####################################################################
   if the date of you master css file and the computed one aren't equal, regenerate ! (changes made in the master css) 
   if the date of you auto_css.php file and the computed one aren't equal, regenerate ! (changes made in the values to replace) 
  
   otherwise, it doesn't touch and use the last computed version. 
   (server says: "thanks a lot folk !")
   
*/
$regen = changes($css_files);
// need to regen ?
if ($regen == true) {
    if ($auto_css['merge_css_files'] == true) {
        // MERGE ALL CSS FILES !
        $css = '';
        foreach ($css_files as $css_file) {
            $css .= '/*' . $css_file . '*/' . "\n" . file_get_contents($auto_css['path_to_css_file'] . $css_file) . "\n\n";
        }
        regenere_css('', $css);
    } else {
        // DO NOT MERGE ALL CSS FILES !
        foreach ($css_files as $css_file) {
            regenere_css($css_file, '');
        }
    }
예제 #3
0
         case HOURS_DISP:
             hours_send($SCION, $response);
             $SCION->status = array_shift($SCION->path);
             break 1;
             //go back around
         //go back around
         case BUTTON_DISP:
             include_once "lib/callback/buttons.php";
             button_send($SCION, $response);
             echo $response;
             $SCION->status = STATE::CHANGE;
             break 2;
             //break out
         //break out
         case STATE::CHANGE:
             changes($SCION, $response);
             //DO IT!
             $temp = STATE_pull($_STATE->thread, 1);
             total_hours($temp);
             //re-calculate for all projects
             $temp->replace();
             echo $response;
             break 2;
             //break out
         //break out
         default:
             throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): error");
     }
 }
 //while & switch
 $SCION->push();
예제 #4
0
파일: jihuosave.php 프로젝트: rolandx/dict
     }
     $temp2 = floor($y / pow(2, 5));
     if ($temp2 > 4294967296.0) {
         $temp2 = $temp2 - 4294967296.0;
     }
     $temp2 = $temp2 + $d;
     if ($temp2 > 4294967296.0) {
         $temp2 = $temp2 - 4294967296.0;
     }
     $num1d = $temp1;
     $num2d = $temp2;
     $xs = floor($num1d / pow(2, 31));
     $ys = floor($num2d / pow(2, 31));
     $r1 = $xs ^ $ys;
     $xs = changes($num1d);
     $ys = changes($num2d);
     $r2 = $xs ^ $ys;
     $sumd = $r1 * pow(2, 31) + $r2;
     $r3 = changesd($sumd);
     $temp1 = $r3;
     if ($temp1 > 4294967296.0) {
         $temp1 = $temp1 - 4294967296.0;
     }
     $z = $z + $temp1;
     if ($z > 4294967296.0) {
         $z = $z - 4294967296.0;
     }
 }
 $lTestV[0] = $y;
 $lTestV[1] = $z;
 $nTemp = array();
예제 #5
0
파일: index.php 프로젝트: OpenTransfr/Core
    $entityRow = $dz->get_row('select ID from `Root.Entities` where Endpoint="' . $newIssuer . '"');
    if (!$entityRow) {
        // Entity was not found.
        error('entity/notfound');
    }
    // Update the ID:
    $newIssuerID = $entityRow['ID'];
}
// Policy must be either 'public', 'closed' or 'reviewed'
$policy = safe('policy', array('closed' => 0, 'public' => 1, 'reviewed' => 2));
// New name/ description?
$name = safe('name', VALID_ARRAY, null, true);
// These are sets and it's optional.
$description = safe('description', VALID_ARRAY, null, true);
// These are sets and it's optional.
// Get the English name/ description.
$name_en = null;
$description_en = null;
if ($name != null) {
    // En is required if they're declaring a new name.
    $name_en = safe('en', VALID_TITLE, $name);
}
if ($description != null) {
    // En is required if they're declaring a new description.
    $description_en = safe('en', VALID_TEXT, $description);
}
// Get the SQL changes string (errors if there are none):
$changes = changes(array('Issuer' => $newIssuerID, 'Divisor' => $divisor, 'Name_en' => $name_en, 'Description_en' => $description_en, 'Policy' => $policy));
// Run the query now:
$dz->query('update `Root.Commodities` set ' . $changes . ' where ID=' . $commodity['ID']);
changed('com', array('tag' => $tag, 'description' => array('en' => $description_en), 'name' => array('en' => $name_en), 'divisor' => $divisor, 'issuer' => $newIssuer, 'policy' => $policy));
예제 #6
0
파일: index.php 프로젝트: OpenTransfr/Core
<?php

// Updates a delivery address (from a particular bank account).
postedTo();
if ($verifiedAccount == 0) {
    // Account required!
    error('account/required');
}
// Get the ID:
$id = safe('id', VALID_NUMBER);
// Get the new properties (all optional but there must be at least one):
$preference = safe('preference', VALID_NUMBER, null, true);
$name = safe('name', VALID_TITLE, null, true);
// Build the change query (errors if there are none):
$changeQuery = changes(array('Preference' => $preference, 'Name' => $name));
// Update the location now:
$result = $dz->query('update `Bank.Account.Locations` set ' . $changeQuery . ' where `Account`=' . $verifiedAccount . ' and `ID`=' . $id);
if (!$result) {
    // Not found.
    error('location/notfound');
}
예제 #7
0
파일: logic.php 프로젝트: Bouteloua/p2
    }
}
if ($words = file('words.txt')) {
    $regex = array("\r\n", "\r", "\n");
    $words = str_replace($regex, "", $words);
    $selected_words = array();
    // Check is count is less than 1 and greater than 10 and return a error
    if ($_GET['WordCount'] <= 1 or $_GET['WordCount'] >= 11) {
        $selected_words = 'Pick a number between 2 and 10';
    } else {
        // Return a random number of words by the amount of words
        $rand_keys = array_rand($words, $NumWordCount);
        for ($i = 0; $i < count($rand_keys); $i++) {
            $selected_words[$i] = $words[$rand_keys[$i]];
        }
        $selected_words = changes($selected_words);
    }
}
// Leave a checkbox checked if check
function cachedCheckBox()
{
    $checkedCase = isset($_REQUEST['UpperCase']) ? 'checked' : '';
    $checkedSymbol = isset($_REQUEST['Symbol']) ? 'checked' : '';
    $checkedNumber = isset($_REQUEST['Number']) ? 'checked' : '';
    return array($checkedCase, $checkedSymbol, $checkedNumber);
}
// shuffle the array
function arrayConcatenateAndShuffle($selected_words)
{
    shuffle($selected_words);
    return implode("-", $selected_words);