- system alias no longer persists after system delete

- reset some character table columns on corp change or character sold
This commit is contained in:
Exodus4D
2017-05-28 15:00:00 +02:00
parent f126e07fdb
commit 398615cc5c
4 changed files with 31 additions and 6 deletions

View File

@@ -429,10 +429,7 @@ class System extends Controller\AccessController {
foreach($systemIds as $systemId){
if( $system = $map->getSystemById($systemId) ){
// check whether system should be deleted OR set "inactive"
if(
!empty($system->description) ||
( !empty($system->alias) && ($system->alias != $system->name) )
){
if( !empty($system->description) ){
// keep data -> set "inactive"
$system->setActive(false);
$system->save();

View File

@@ -200,6 +200,22 @@ class CharacterModel extends BasicModel {
return $characterData;
}
/**
* set corporation for this character
* -> corp change resets admin actions (e.g. kick/ban)
* @param $corporationId
* @return mixed
*/
public function set_corporationId($corporationId){
$currentCorporationId = (int)$this->get('corporationId', true);
if($currentCorporationId !== $corporationId){
$this->resetAdminColumns();
}
return $corporationId;
}
/**
* set unique "ownerHash" for this character
* -> Hash will change when character is transferred (sold)
@@ -207,9 +223,12 @@ class CharacterModel extends BasicModel {
* @return string
*/
public function set_ownerHash($ownerHash){
if( $this->ownerHash !== $ownerHash ){
if( $this->hasUserCharacter() ){
// reset admin actions (e.g. kick/ban)
$this->resetAdminColumns();
// new ownerHash -> new user (reset)
$this->userCharacter->erase();
}
@@ -365,6 +384,13 @@ class CharacterModel extends BasicModel {
parent::clearCacheDataWithPrefix(self::DATA_CACHE_KEY_LOG);
}
/**
* resets some columns that could have changed by admins (e.g. kick/ban)
*/
private function resetAdminColumns(){
$this->kick();
}
/**
* check whether this character has already a user assigned to it
* @return bool

View File

@@ -394,6 +394,8 @@ class SystemModel extends BasicModel {
if( !$self->isActive()){
// system becomes inactive
$self->alias = '';
// reset "rally point" fields
$self->rallyUpdated = 0;
$self->rallyPoke = false;

View File

@@ -1,5 +1,5 @@
<check if="{{ @SESSION.SSO.ERROR }}">
<div class="container-fluid">
<div class="container-fluid no-padding text-left">
<div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2">
<div class="alert alert-danger" >