function legacy_GenerateUserHash($id)
{
    $hash = bin2hex(openssl_random_pseudo_bytes(24));
    db_Connect();
    db_DoInsert("INSERT IGNORE " . CMW_TABLE_LEGACY_USER . " (\n\t\t\tid, `hash`, `timestamp`\n\t\t)\n\t\tVALUES ( \n\t\t\t?, ?, NOW()\n\t\t)\n\t\tON DUPLICATE KEY UPDATE\n\t\t\t`hash`=VALUES(`hash`),\n\t\t\t`timestamp`=VALUES(`timestamp`)\n\t\t;", $id, $hash);
    return $hash;
}
Beispiel #2
0
function access_LogUser($user, $ip)
{
    db_connect();
    return db_DoInsert("INSERT INTO " . CMW_TABLE_USER_ACCESS . " (\n\t\t\tuser, ip, first_timestamp, last_timestamp, total\n\t\t)\n\t\tVALUES ( \n\t\t\t?, " . (defined('CMW_USING_MARIADB') ? "INET6_ATON(?)" : "INET_ATON(?)") . ", NOW(), NOW(), 1\n\t\t)\n\t\tON DUPLICATE KEY UPDATE\n\t\t\tlast_timestamp=NOW(),\n\t\t\ttotal=total+1\n\t\t;", $user, $ip);
}
Beispiel #3
0
function theme_AddFinalVote($node, $value, $user)
{
    return db_DoInsert("INSERT INTO " . CMW_TABLE_THEME_FINAL_VOTE . " (\n\t\t\tnode, user, value, `timestamp`\n\t\t)\n\t\tVALUES ( \n\t\t\t?, ?, ?, NOW()\n\t\t)\n\t\tON DUPLICATE KEY UPDATE \n\t\t\tvalue=VALUES(value),\n\t\t\t`timestamp`=VALUES(`timestamp`)\n\t\t", $node, $user, $value);
}
function user_AddStrike($reason, $node, $user)
{
    return db_DoInsert("INSERT INTO " . CMW_TABLE_USER_STRIKE . " (\n\t\t\treason, node, user, `timestamp`\n\t\t)\n\t\tVALUES ( \n\t\t\t?, ?, ?, NOW()\n\t\t)", $reason, $node, $user);
}