var $dblist;
function User($userId) {
$this->userId = $userId;
- $sql = sprintf("SELECT User.UserId, Username, Password, Name, Email, UL, bEnabled, nBytesSoft, nBytesHard, nBytes, nDatabases, nDatabasesHard
+ $sql = sprintf("SELECT User.UserId, Username, Password, Name, Email, UL, bEnabled, nBytesSoft, nBytesHard, nBytes, nDatabases, nDatabasesHard, IF(nBytes>nBytesHard,1,0) AS bOverQuota
FROM User
INNER JOIN UserQuota ON User.UserId = UserQuota.UserId
INNER JOIN UserStat ON User.UserId = UserStat.UserId
function getUsername() {
return $this->exists()?$this->info['Username']:'';
}
+ function isOverQuota() {
+ return $this->exists()?($this->info['bOverQuota']>0?true:false):'';
+ }
function getBytes() {
if($this->exists()) {
$arr['nBytes'] = $this->info['nBytes'];
mysql_escape_string($this->getUserId()));
// $r = fetchRows(DBSelect($sql),'DatabaseId');
$r = fetchRows(DBSelect($sql),'Name');
+ ksort($r);
return $r;
}
}
function addDB($name) {
- if (in_array($name, $this->getDBList())) return false;
+ if (in_array($name, array_keys($this->getDBList()))) return false;
if (!addDB($name, $this->getUserId())) return false;
$this->setAccess($name);
return true;
return isSess('_UserId') && isSess('UserId');
}
+function isOffline() {
+ return (defined('OFFLINE') && OFFLINE);
+}
+
+function isOnline() {
+ return !isOffline();
+}
+
function impersonate($userId=null) {
$wasImpersonating = isImpersonating();
if ($wasImpersonating) {
}
function isSSL() {
- return $_SERVER['SERVER_PORT'] == 443;
+ return isset($_SERVER['SERVER_PORT'])?($_SERVER['SERVER_PORT'] == 443):false;
}
function getSSLCert() {