[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1618] merge radio handshake from trunk
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1618] merge radio handshake from trunk |
Date: |
Fri, 15 May 2009 02:59:51 +0000 |
Revision: 1618
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1618
Author: clint
Date: 2009-05-15 02:59:50 +0000 (Fri, 15 May 2009)
Log Message:
-----------
merge radio handshake from trunk
Modified Paths:
--------------
branches/stable/nixtape/radio/handshake.php
Modified: branches/stable/nixtape/radio/handshake.php
===================================================================
--- branches/stable/nixtape/radio/handshake.php 2009-05-15 02:40:58 UTC (rev
1617)
+++ branches/stable/nixtape/radio/handshake.php 2009-05-15 02:59:50 UTC (rev
1618)
@@ -18,7 +18,7 @@
*/
-require_once('../database.php');
+require_once('../database2.php');
if(!isset($_GET['username']) || !isset($_GET['passwordmd5'])) {
die("BADAUTH\n");
@@ -27,18 +27,17 @@
$username = $_GET['username'];
$passmd5 = $_GET['passwordmd5'];
-$res = $mdb2->query('SELECT username FROM Users WHERE username = ' .
$mdb2->quote($username, 'text') . ' AND password = ' . $mdb2->quote($passmd5,
'text'));
-if (!$res->numRows()) {
+$res = $adodb->GetOne('SELECT username FROM Users WHERE username = ' .
$adodb->qstr($username) . ' AND password = ' . $adodb->qstr($passmd5));
+if (!$res) {
die("BADAUTH\n");
}
$session = md5($passmd5 . time());
-$mdb2->exec('DELETE FROM Radio_Sessions WHERE expires < ' .
$mdb2->quote(time(), 'integer'));
+$adodb->Execute('DELETE FROM Radio_Sessions WHERE expires < ' . (int)(time()));
-$mdb2->query('INSERT INTO Radio_Sessions (username, session, expires) VALUES (
' . $mdb2->quote($username, 'text"' . ', ' . $mdb2->quote($session, "text") .
', ' . $mdb2->quote(time() + 259200,'integer') . ')');
+$adodb->Execute('INSERT INTO Radio_Sessions (username, session, expires)
VALUES ( ' . $adodb->qstr($username) . ', ' . $adodb->qstr($session) . ', ' .
(int)(time() + 259200) . ')');
-
echo 'session=' . $session . "\n";
echo "stream_url=this.is.broken.{$username}.example.com\n";
echo "subscriber=0\n";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1618] merge radio handshake from trunk,
Clint Adams <=