Skip to content

Commit

Permalink
update files/users status column reference
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Jul 21, 2017
1 parent 1634a22 commit 66707b8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 18 deletions.
Expand Up @@ -54,18 +54,6 @@ public function fetchAllWithGroupData()
return ['rows' => $results];
}

public function getTableSchema($tableName = null)
{
$schema = parent::getTableSchema($tableName);

// TODO: Add proper information to all system columns
$schema->setStatusColumn('active');
$schema->setPrimaryColumn('id');

return $schema;
}


public function findActiveUserIdsByGroupIds($ids = [])
{
$statusColumnName = $this->getTableSchema()->getStatusColumn();
Expand Down
Expand Up @@ -299,7 +299,7 @@ public function deleteFiles($tableName, $recordData)
return false;
}

$statusColumnName = 'active';
$statusColumnName = TableSchema::getTableSchema($tableName)->getStatusColumn();

// Get status delete value
$tableSchema = $this->getTableSchema();
Expand Down
2 changes: 1 addition & 1 deletion api/core/Directus/Util/Installation/InstallerUtils.php
Expand Up @@ -183,7 +183,7 @@ public static function addDefaultUser($data)
$data['avatar'] = get_gravatar($data['directus_email']);

$tableGateway->insert([
'active' => 1,
'status' => 1,
'first_name' => 'Admin',
'last_name' => 'User',
'email' => $data['directus_email'],
Expand Down
Expand Up @@ -41,7 +41,7 @@ public function up()
'auto_increment' => true,
'primary_key' => true
]);
$t->column('active', 'tinyinteger', [
$t->column('status', 'tinyinteger', [
'limit' => 1,
'default' => 1
]);
Expand Down
Expand Up @@ -49,7 +49,7 @@ public function up()
'auto_increment' => true,
'primary_key' => true
]);
$t->column('active', 'tinyinteger', [
$t->column('status', 'tinyinteger', [
'limit' => 1,
'default' => 1
]);
Expand Down
2 changes: 1 addition & 1 deletion api/routes/A1/Auth.php
Expand Up @@ -101,7 +101,7 @@ public function login()
$isUserActive = false;
// TODO: Add a method in RowGateway to check whether the user is active or not
// TODO: Add information about the user status
if ($user['active'] == STATUS_ACTIVE_NUM) {
if ($user['status'] == STATUS_ACTIVE_NUM) {
$isUserActive = true;
}

Expand Down
2 changes: 1 addition & 1 deletion api/routes/A1/Users.php
Expand Up @@ -68,7 +68,7 @@ protected function sendInvitationTo($email)

$token = StringUtils::randomString(128);
$result = $tableGateway->insert([
'active' => STATUS_DRAFT_NUM,
'status' => STATUS_DRAFT_NUM,
'email' => $email,
'token' => StringUtils::randomString(32),
'invite_token' => $token,
Expand Down

0 comments on commit 66707b8

Please sign in to comment.