We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 7bc9f038 authored by clint's avatar clint

convert nixtape/{invite,register,track}.php to adodb

parent aecf004d
......@@ -19,7 +19,7 @@
*/
require_once('database.php');
require_once('database2.php');
require_once('templating.php');
require_once('utils/EmailAddressValidator.php');
......@@ -47,9 +47,9 @@ if(isset($_POST['invite'])) {
if(empty($errors)) {
$code = md5(md5($username) . time());
$mdb2->query('INSERT INTO Invitations (inviter, code) VALUES ('
. $mdb2->quote($username, 'text') . ', '
. $mdb2->quote($code, 'text') . ')');
$adodb->Execute('INSERT INTO Invitations (inviter, code) VALUES ('
. $adodb->qstr($username) . ', '
. $adodb->qstr($code) . ')');
$url = $base_url . '/register.php?authcode=' . $code;
$headers = 'From: Libre.fm Invitations <invitations@libre.fm>';
......
......@@ -30,8 +30,8 @@ if($logged_in == true){
// Moving to open alpha
/*$authcode = $_GET["authcode"];
$res = $mdb2->query("SELECT inviter FROM Invitations WHERE code = " . $mdb2->quote($authcode, "text"));
if(!$res->numRows()) {
$res = $adodb->GetRow('SELECT inviter FROM Invitations WHERE code = ' . $adodb->qstr($authcode));
if(!$res) {
$invalid_authcode = true;
} else {
$invalid_authcode = false;
......@@ -152,9 +152,9 @@ if(isset($_POST['register'])) {
sendEmail($content, $email);
// Remove auth code and set their username as the invitee
//$mdb2->query("UPDATE Invitations SET code = NULL, invitee = " . $mdb2->quote($username, "text") . " WHERE code = " . $mdb2->quote($authcode, "text"));
//$removesql = "DELETE FROM Invitation_Request WHERE email=" . $mdb2->quote($email, 'text');
//$mdb2->exec($removesql);
//$adodb->Execute("UPDATE Invitations SET code = NULL, invitee = " . $adodb->qstr($username) . " WHERE code = " . $adodb->qstr($authcode));
//$removesql = "DELETE FROM Invitation_Request WHERE email=" . $adodb->qstr($email);
//$adodb->Execute($removesql);
$smarty->assign('registered', true);
} else {
$smarty->assign('username', $username);
......
......@@ -19,7 +19,7 @@
*/
require_once('database.php');
require_once('database2.php');
require_once('templating.php');
require_once('data/sanitize.php');
require_once('data/Server.php');
......@@ -40,12 +40,13 @@ if (!PEAR::isError ($aTagCloud)) {
$smarty->assign('tagcloud', $aTagCloud);
}
$res = $mdb2->query('SELECT * FROM Track WHERE lower(artist_name) = ' . $mdb2->quote(mb_strtolower($track->artist_name, 'UTF-8'), 'text') . ' AND lower(name) = ' . $mdb2->quote(mb_strtolower($track->name, 'UTF-8'), 'text'));
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->GetAll('SELECT * FROM Track WHERE lower(artist_name) = ' . $adodb->qstr(mb_strtolower($track->artist_name, 'UTF-8')) . ' AND lower(name) = ' . $adodb->qstr(mb_strtolower($track->name, 'UTF-8')));
$aOtheralbums = array();
$i = 0;
while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
foreach($res as &$row) {
$trow = sanitize($row);
if ($trow['album']) {
$aOtherAlbums[$i++] = new Album($trow['album'], $trow['artist']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment