Author: cfinck
Date: Tue Apr 21 00:22:12 2009
New Revision: 388
URL:
http://svn.reactos.org/svn/reactos?rev=388&view=rev
Log:
Integrate People Map into RosCMS 4
Modified:
branches/danny-web/www/www.reactos.org/peoplemap/ajax-deletelocation.php
branches/danny-web/www/www.reactos.org/peoplemap/ajax-getuser.php
branches/danny-web/www/www.reactos.org/peoplemap/ajax-setlocation.php
branches/danny-web/www/www.reactos.org/peoplemap/index.php
Modified:
branches/danny-web/www/www.reactos.org/peoplemap/ajax-deletelocation.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/p…
==============================================================================
---
branches/danny-web/www/www.reactos.org/peoplemap/ajax-deletelocation.php [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/peoplemap/ajax-deletelocation.php [iso-8859-1]
Tue Apr 21 00:22:12 2009
@@ -25,7 +25,7 @@
}
// Get the user ID from the session key
- $stmt = $dbh->prepare("SELECT usersession_user_id FROM $DB_ROSCMS.user_sessions
WHERE usersession_id = :usersessionid LIMIT 1");
+ $stmt = $dbh->prepare("SELECT user_id FROM $DB_ROSCMS.roscms_accounts_sessions
WHERE id = :usersessionid LIMIT 1");
$stmt->bindParam(":usersessionid", $_COOKIE["roscmsusrkey"]);
$stmt->execute() or die("<error>Query failed #1</error>");
$userid = (int)$stmt->fetchColumn();
Modified:
branches/danny-web/www/www.reactos.org/peoplemap/ajax-getuser.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/p…
==============================================================================
---
branches/danny-web/www/www.reactos.org/peoplemap/ajax-getuser.php [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/peoplemap/ajax-getuser.php [iso-8859-1] Tue Apr
21 00:22:12 2009
@@ -28,27 +28,27 @@
}
// Build the query
- $query = "SELECT u.user_id, u.user_name, u.user_fullname, l.latitude, l.longitude
" .
- "FROM $DB_ROSCMS.users u " .
- "JOIN $DB_PEOPLEMAP.user_locations l ON u.user_id = l.roscms_user_id
";
+ $query = "SELECT u.id, u.name, u.fullname, l.latitude, l.longitude " .
+ "FROM $DB_ROSCMS.roscms_accounts u " .
+ "JOIN $DB_PEOPLEMAP.user_locations l ON u.id = l.roscms_user_id ";
switch($_GET["subject"])
{
case "username":
- $query .= "WHERE u.user_name LIKE :query";
+ $query .= "WHERE u.name LIKE :query";
break;
case "fullname":
- $query .= "WHERE u.user_fullname LIKE :query";
+ $query .= "WHERE u.fullname LIKE :query";
break;
case "group":
- $query .= "JOIN $DB_ROSCMS.usergroup_members g ON u.user_id =
g.usergroupmember_userid " .
- "WHERE g.usergroupmember_usergroupid = :query";
+ $query .= "JOIN $DB_ROSCMS.roscms_rel_groups_accounts g ON u.id = g.user_id
" .
+ "WHERE g.group_id = :query";
break;
case "userid":
- $query .= "WHERE u.user_id = :query";
+ $query .= "WHERE u.id = :query";
$_GET["query"] = (int)$_GET["query"];
break;
@@ -56,7 +56,7 @@
die("<error>Invalid subject!</error>");
}
- $query .= " ORDER BY u.user_name ASC";
+ $query .= " ORDER BY u.name ASC";
switch($_GET["subject"])
{
Modified:
branches/danny-web/www/www.reactos.org/peoplemap/ajax-setlocation.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/p…
==============================================================================
---
branches/danny-web/www/www.reactos.org/peoplemap/ajax-setlocation.php [iso-8859-1]
(original)
+++
branches/danny-web/www/www.reactos.org/peoplemap/ajax-setlocation.php [iso-8859-1] Tue
Apr 21 00:22:12 2009
@@ -25,7 +25,7 @@
}
// Get the user ID from the session key
- $stmt = $dbh->prepare("SELECT usersession_user_id FROM $DB_ROSCMS.user_sessions
WHERE usersession_id = :usersessionid LIMIT 1");
+ $stmt = $dbh->prepare("SELECT user_id FROM $DB_ROSCMS.roscms_accounts_sessions
WHERE id = :usersessionid LIMIT 1");
$stmt->bindParam(":usersessionid", $_COOKIE["roscmsusrkey"]);
$stmt->execute() or die("<error>Query failed #1</error>");
$userid = (int)$stmt->fetchColumn();
@@ -44,7 +44,7 @@
$stmt->execute() or die("<error>Query failed #2</error>");
// We succeeded, return all information about our account
- $stmt = $dbh->prepare("SELECT user_name, user_fullname FROM $DB_ROSCMS.users
WHERE user_id = :userid LIMIT 1");
+ $stmt = $dbh->prepare("SELECT name AS user_name, fullname AS user_fullname FROM
$DB_ROSCMS.roscms_accounts WHERE id = :userid LIMIT 1");
$stmt->bindParam(":userid", $userid);
$stmt->execute() or die("<error>Query failed #3</error>");
$row = $stmt->fetch(PDO::FETCH_NUM);
Modified:
branches/danny-web/www/www.reactos.org/peoplemap/index.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/p…
==============================================================================
---
branches/danny-web/www/www.reactos.org/peoplemap/index.php [iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/peoplemap/index.php [iso-8859-1] Tue Apr 21
00:22:12 2009
@@ -85,10 +85,10 @@
catch(PDOException $e)
{
// Give no exact error message here, so no server internals are exposed
- die("<error>Could not establish the DB
connection</error>");
- }
-
- $stmt = $dbh->query("SELECT COUNT(*) FROM $DB_ROSCMS.users") or
die("Query failed #1");
+ die("Could not establish the DB connection");
+ }
+
+ $stmt = $dbh->query("SELECT COUNT(*) FROM
$DB_ROSCMS.roscms_accounts") or die("Query failed #1");
$user_count = (int)$stmt->fetchColumn();
$stmt = $dbh->query("SELECT COUNT(*) FROM
$DB_PEOPLEMAP.user_locations") or die("Query failed #2");
@@ -142,7 +142,7 @@
$iconcode = '<script type="text/javascript">';
$iconcode .= 'IconTable = new Object();';
- $stmt = $dbh->query("SELECT usrgroup_name_id, usrgroup_name FROM
$DB_ROSCMS.usergroups WHERE usrgroup_visible = 1") or die("Query failed
#3");
+ $stmt = $dbh->query("SELECT id, name FROM $DB_ROSCMS.roscms_groups WHERE
visible = 1") or die("Query failed #3");
while($row = $stmt->fetch(PDO::FETCH_NUM))
{
@@ -234,7 +234,7 @@
if($_COOKIE["roscmsusrkey"])
{
- $stmt = $dbh->prepare("SELECT usersession_user_id FROM
$DB_ROSCMS.user_sessions WHERE usersession_id = :usersessionid LIMIT 1");
+ $stmt = $dbh->prepare("SELECT user_id FROM
$DB_ROSCMS.roscms_accounts_sessions WHERE id = :usersessionid LIMIT 1");
$stmt->bindParam(":usersessionid",
$_COOKIE["roscmsusrkey"]);
$stmt->execute() or die("Query failed #4");
$userid = (int)$stmt->fetchColumn();