Hallo Skalpa!
Was just going through the legacy.php and found
something that I just thought of drawing your
attention, if you could have a look, when you come out
of your developers submarine, as follows:
class xoops_db_Database_legacy extends
xoops_db_Database_mysql {
/** * Get field name * * @param resource $result query result * @param int numerical field index * @return string */ function getFieldName($result, $offset) { return mysql_field_name($result, $offset); }
I suggest:
function getXoopsFieldName{
....blah
}
And add to it:
function getExternalFieldName{
...
connect to array_remote_db[xx]
...
Get Field Names of Table[xx] (as saved in the Pluggin DB)
...
}
Implications:
The Xoops would then have capacity to save names of the
database and tables to capture the fields.
Hence, all the Users and Groups table from any script
could be loaded by this function.
Use:
Xoops would then have potential to administrate any CMS
including to that of Joomla, provided Xoops remain the
Primary (Super) or Master CMS and others (for e.g.
Joomla) as a slave.
Thereafter, all the Users, Groups and Sessions table of
any CMS could be handled through a database mapping.
Does it make sense, dear captain?
Logged In: YES
user_id=1329834
Ah!
I forgot to post the URL of the script. Thats here:
http://svn.berlios.de/viewcvs/xoops4/XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/CoreServices/Database.xofrm/legacy.php?view=markup
Logged In: YES
user_id=1329834
Further, was just going through more and found the following
in the file:
XOOPS / Frameworks / XoopsCore / CoreServices / Http.xofrm /
session.xoobj / handler-db.php
http://svn.berlios.de/viewcvs/xoops4/XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/CoreServices/Http.xofrm/session.xoobj/handler-db.php?view=markup
function write( $sessionId, $data ) {
$sessionId = $this->db->quote( $sessionId );
$data = $this->db->quote( $data );
$time = time();
"SELECT COUNT(*) FROM
$this->tableName
WHEREsess_id=$sessionId" ) );
sess_updated=$time,sess_data=$data WHERE sess_id=$sessionId";
} else {
$ip = $this->db->quote( $_SERVER['REMOTE_ADDR'] );
$sql = "INSERT INTO
$this->tableName
(sess_id,sess_updated,sess_ip,sess_data) VALUES
($sessionId,$time,$ip,$data)";
}
return $this->db->queryF( $sql );
}
The mapping I suggested could be very simple and could be
implemented as follows:
"SELECT COUNT(*) FROM
$this->MAPPEDtableName
WHEREsess_id=$sessionId" ) );
sess_updated=$time,sess_data=$data WHERE sess_id=$sessionId";
} else {
$ip = $this->db->quote( $_SERVER['REMOTE_ADDR'] );
$sql = "INSERT INTO
$this->MAPPEDtableName
(sess_id,sess_updated,sess_ip,sess_data) VALUES
($sessionId,$time,$ip,$data)";
}
And the $this->MAPPEDtableName will go through all the
sessions table listed in the DB, update them.
Xoops shall provide a Gateway to all other CMS, as User
table is also mapped with this concept!