added authchanged callback and change authent level in the player object
This commit is contained in:
parent
f0d78d5de6
commit
52c6a677e4
@ -23,7 +23,8 @@ class AuthenticationManager {
|
|||||||
const AUTH_LEVEL_ADMIN = 2;
|
const AUTH_LEVEL_ADMIN = 2;
|
||||||
const AUTH_LEVEL_SUPERADMIN = 3;
|
const AUTH_LEVEL_SUPERADMIN = 3;
|
||||||
const AUTH_LEVEL_MASTERADMIN = 4;
|
const AUTH_LEVEL_MASTERADMIN = 4;
|
||||||
|
|
||||||
|
const CB_AUTH_LEVEL_CHANGED = 'AuthenticationManager.AuthLevelChanged';
|
||||||
/**
|
/**
|
||||||
* Private properties
|
* Private properties
|
||||||
*/
|
*/
|
||||||
@ -130,6 +131,13 @@ class AuthenticationManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$authStatement->close();
|
$authStatement->close();
|
||||||
|
|
||||||
|
if($success){
|
||||||
|
// Trigger callback
|
||||||
|
$player->authLevel = $authLevel;
|
||||||
|
$this->maniaControl->callbackManager->triggerCallback(self::CB_AUTH_LEVEL_CHANGED, array(self::CB_AUTH_LEVEL_CHANGED, $player));
|
||||||
|
}
|
||||||
|
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'updateWidget');
|
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'updateWidget');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'updateWidget');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'updateWidget');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERDISCONNECT, $this, 'updateWidget');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERDISCONNECT, $this, 'updateWidget');
|
||||||
|
$this->maniaControl->callbackManager->registerCallbackListener(AuthenticationManager::CB_AUTH_LEVEL_CHANGED, $this, 'updateWidget');
|
||||||
//settings
|
//settings
|
||||||
$this->width = 150;
|
$this->width = 150;
|
||||||
$this->height = 80;
|
$this->height = 80;
|
||||||
|
Loading…
Reference in New Issue
Block a user