[Phonehome-commits] r46 - in branches/server-pamadio: . common
pamadio at garage.maemo.org
pamadio at garage.maemo.org
Sat Oct 18 16:55:33 EEST 2008
Author: pamadio
Date: 2008-10-18 16:55:33 +0300 (Sat, 18 Oct 2008)
New Revision: 46
Modified:
branches/server-pamadio/common/useful_stuff.php
branches/server-pamadio/ets.php
Log:
database use change
Modified: branches/server-pamadio/common/useful_stuff.php
===================================================================
--- branches/server-pamadio/common/useful_stuff.php 2008-10-18 13:31:13 UTC (rev 45)
+++ branches/server-pamadio/common/useful_stuff.php 2008-10-18 13:55:33 UTC (rev 46)
@@ -122,14 +122,15 @@
//-----------------------------------------
function db_connect()
{
+
if (stripos($_SERVER['SERVER_NAME'],"etmaemo.gagnews") !== false){
- @mysql_connect("db.gagfoot.com","et_maemo","melmoth");
- if (@mysql_select_db("db_etmaemo"))
+ mysql_connect("localhost","phonehome","tmppass");
+ if (mysql_select_db("db_etmaemo"))
return true;
}
else {
- @mysql_connect("localhost","et_maemo","melmoth");
- if (@mysql_select_db("db_etmaemo"))
+ mysql_connect("localhost","phonehome","tmppass");
+ if (mysql_select_db("etmaemo"))
return true;
}
Modified: branches/server-pamadio/ets.php
===================================================================
--- branches/server-pamadio/ets.php 2008-10-18 13:31:13 UTC (rev 45)
+++ branches/server-pamadio/ets.php 2008-10-18 13:55:33 UTC (rev 46)
@@ -12,9 +12,10 @@
// check if a given user exists based on mac & password
function get_uid($mac,$pw)
{
- $safe_uname = mysql_real_escape_string($uname);
+ $safe_mac = mysql_real_escape_string($mac);
$safe_pw = mysql_real_escape_string($pw);
- $res = mysql_query("select user_id from users where uname='{$safe_uname}' and pw='{$safe_pw}'");
+ //$res = mysql_query("select user_id from users where uname='{$safe_uname}' and pw='{$safe_pw}'");
+ $res=mysql_query("select d.user_id from devices as d, users as u where d.mac='{$safe_mac}' and u.pw='{safe_pw}' and u.user_id=d.user_id");
$row = mysql_fetch_assoc($res);
if (!$row)
return 0;
More information about the Phonehome-commits
mailing list