Permalink
Browse files

Deleted column for users

  • Loading branch information...
jonasdekeukelaere committed Jul 5, 2013
1 parent 35bcca0 commit ea8d063f17f561f1163b322029a05953da63b6ea
Showing with 4 additions and 2 deletions.
  1. +1 −1 default_data.sql
  2. +3 −1 modules/users/model/model.php
View
@@ -36,4 +36,4 @@ CREATE TABLE IF NOT EXISTS `settings` (
`key` varchar(255) NOT NULL,
`value` text,
PRIMARY KEY (`key`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -24,7 +24,7 @@ class User
/**
* Boolean properties
*/
- public $isAdmin = false, $isBlocked = false;
+ public $isAdmin = false, $isBlocked = false, $isDeleted = false;
/**
* DateTime properties
@@ -182,6 +182,7 @@ public function initialize($data)
}
if($this->type == 'admin') $this->isAdmin = true;
if(isset($data['blocked'])) $this->isBlocked = ($data['blocked'] == 'Y');
+ if(isset($data['deleted'])) $this->isDeleted = ($data['deleted'] == 'Y');
if(isset($data['created_on'])) $this->createdOn = new DateTime('@' . $data['created_on']);
if(isset($data['edited_on'])) $this->editedOn = new DateTime('@' . $data['edited_on']);
if(isset($data['blocked_on'])) $this->blockedOn = new DateTime('@' . $data['blocked_on']);
@@ -202,6 +203,7 @@ public function save()
$item['type'] = $this->type;
$item['data'] = serialize(array('settings' => $this->settings));
$item['blocked'] = ($this->isBlocked) ? 'Y' : 'N';
+ $item['deleted'] = ($this->isDeleted) ? 'Y' : 'N';
$item['edited_on'] = Site::getUTCDate('Y-m-d H:i:s', $this->editedOn->getTimestamp());
$item['blocked_on'] = ($this->isBlocked) ? Site::getUTCDate('Y-m-d H:i:s', $this->blockedOn->getTimestamp()) : null;

0 comments on commit ea8d063

Please sign in to comment.