- system alias no longer persists after system delete
- reset some character table columns on corp change or character sold
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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" >
|
||||
|
||||
Reference in New Issue
Block a user