| 626 |
/** |
/** |
| 627 |
* @param database A database connector object |
* @param database A database connector object |
| 628 |
*/ |
*/ |
| 629 |
function mosMenu( $dummy ) { |
function mosMenu() { |
| 630 |
$db =& mamboDatabase::getInstance(); |
$db =& mamboDatabase::getInstance(); |
| 631 |
$this->mosDBTable( '#__menu', 'id', $db ); |
$this->mosDBTable( '#__menu', 'id', $db ); |
| 632 |
} |
} |
| 1493 |
/** |
/** |
| 1494 |
* @param database A database connector object |
* @param database A database connector object |
| 1495 |
*/ |
*/ |
| 1496 |
function mosUser( $dummy ) { |
function mosUser() { |
| 1497 |
$database =& mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 1498 |
$this->mosDBTable( '#__users', 'id', $database ); |
$this->mosDBTable( '#__users', 'id', $database ); |
| 1499 |
} |
} |
| 1565 |
} |
} |
| 1566 |
|
|
| 1567 |
function delete($oid=null) { |
function delete($oid=null) { |
| 1568 |
|
global $acl; |
| 1569 |
|
$k = $this->_tbl_key; |
| 1570 |
if ($oid) $this->id = intval( $oid ); |
if ($oid) $this->id = intval( $oid ); |
| 1571 |
$aro_id = $acl->get_object_id( 'users', $this->$k, 'ARO' ); |
$aro_id = $acl->get_object_id( 'users', $this->$k, 'ARO' ); |
| 1572 |
$acl->del_object( $aro_id, 'ARO', true ); |
$acl->del_object( $aro_id, 'ARO', true ); |
| 2115 |
/** |
/** |
| 2116 |
* @param database A database connector object |
* @param database A database connector object |
| 2117 |
*/ |
*/ |
| 2118 |
function mosSession( &$db ) { |
function mosSession() { |
| 2119 |
$database =& mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 2120 |
$this->mosDBTable( '#__session', 'session_id', $database ); |
$this->mosDBTable( '#__session', 'session_id', $database ); |
| 2121 |
$this->time = time(); |
$this->time = time(); |
| 2124 |
function &getCurrent () { |
function &getCurrent () { |
| 2125 |
static $currentSession; |
static $currentSession; |
| 2126 |
if (!is_object($currentSession)) { |
if (!is_object($currentSession)) { |
| 2127 |
$currentSession = new mosSession($dummy); |
$currentSession = new mosSession(); |
| 2128 |
$currentSession->purge(intval(mamboCore::get('mosConfig_lifetime'))); |
$currentSession->purge(intval(mamboCore::get('mosConfig_lifetime'))); |
| 2129 |
$sessionCookieName = md5('site'.mamboCore::get('mosConfig_live_site')); |
$sessionCookieName = md5('site'.mamboCore::get('mosConfig_live_site')); |
| 2130 |
$sessioncookie = mosGetParam($_COOKIE, $sessionCookieName, null); |
$sessioncookie = mosGetParam($_COOKIE, $sessionCookieName, null); |
| 2181 |
if ($randnum != "") { |
if ($randnum != "") { |
| 2182 |
$cryptrandnum = md5( $randnum ); |
$cryptrandnum = md5( $randnum ); |
| 2183 |
$this->_db->setQuery( "SELECT $this->_tbl_key FROM $this->_tbl WHERE $this->_tbl_key=MD5('$randnum')" ); |
$this->_db->setQuery( "SELECT $this->_tbl_key FROM $this->_tbl WHERE $this->_tbl_key=MD5('$randnum')" ); |
| 2184 |
if(!$result = $this->_db->query()) { |
if(!($result = $this->_db->query())) { |
| 2185 |
die( $this->_db->stderr( true )); |
die( $this->_db->stderr( true )); |
| 2186 |
// todo: handle gracefully |
// todo: handle gracefully |
| 2187 |
} |
} |
| 2430 |
} |
} |
| 2431 |
// If this is not login, we should already have a valid admin session |
// If this is not login, we should already have a valid admin session |
| 2432 |
else { |
else { |
| 2433 |
|
ini_set('session.use_trans_sid', 0); |
| 2434 |
|
ini_set('session.use_cookies', 1); |
| 2435 |
|
ini_set('session.use_only_cookies', 1); |
| 2436 |
session_name(md5(mamboCore::get('mosConfig_live_site'))); |
session_name(md5(mamboCore::get('mosConfig_live_site'))); |
| 2437 |
session_start(); |
session_start(); |
| 2438 |
// Handle the remaining special options |
// Handle the remaining special options |