function setKeys($userEmail)
{
    $controlURL = $_GET['CONTROLSERVER'] . "?m=" . $_GET['MPDPORT'];
    $authRow = array("MPDPORT" => $_GET['MPDPORT']);
    $authRow['EMAIL'] = $userEmail;
    if (!empty($_GET['MPDPASS'])) {
        $controlURL .= "&p=" . $_GET['MPDPASS'];
        $authRow['MPDPASS'] = $_GET['MPDPASS'];
    }
    if (!empty($_GET['MPDHOST'])) {
        $controlURL .= "&h=" . $_GET['MPDHOST'];
        $authRow['MPDHOST'] = $_GET['MPDHOST'];
    }
    if (!empty($_GET['LABEL'])) {
        $controlURL .= "&l=" . $_GET['LABEL'];
        $authRow['LABEL'] = $_GET['LABEL'];
    }
    $authRow['KPASS'] = passGenerator();
    $authRow['RPASS'] = passGenerator();
    $controlURL .= "&k=" . $authRow['KPASS'];
    $resetURL = $_GET['CONTROLSERVER'] . "authority.php?r=" . $authRow['RPASS'];
    printURL($controlURL, "Control Link");
    printURL($resetURL, "Reset Link");
    $m = new MongoClient("mongodb://*****:*****@localhost/authority");
    $db = $m->authority;
    $c = $db->playnodeca;
    //  $c->insert($authRow);
    $c->update(array("MPDPORT" => $_GET['MPDPORT']), $authRow, array("upsert" => true));
    var_dump($c->findOne());
    //  var_dump($authRow);
    echo "PHEW";
}
Esempio n. 2
0
<?php

header('Content-Type: text/html; charset=utf-8');
include_once "helperPHP.php";
$arrayNames = array();
$arrayNames[] = array("name" => "ác");
$arrayNames[] = array("name" => "bb");
$arrayNames[] = array("name" => "ab");
$arrayNames[] = array("name" => "ñ");
$arrayNames[] = array("name" => "n");
uasort($arrayNames, "uasortCallback");
//var_dump($arrayNames);
echo passGenerator(9);
/*fin del archivo*/