@@ 472-479 (lines=8) @@ | ||
469 | * |
|
470 | * @return bool |
|
471 | */ |
|
472 | public function enable($project_id) |
|
473 | { |
|
474 | return $this->exists($project_id) && |
|
475 | $this->db |
|
476 | ->table(self::TABLE) |
|
477 | ->eq('id', $project_id) |
|
478 | ->update(['is_active' => 1]); |
|
479 | } |
|
480 | ||
481 | /** |
|
482 | * Disable a project. |
|
@@ 488-495 (lines=8) @@ | ||
485 | * |
|
486 | * @return bool |
|
487 | */ |
|
488 | public function disable($project_id) |
|
489 | { |
|
490 | return $this->exists($project_id) && |
|
491 | $this->db |
|
492 | ->table(self::TABLE) |
|
493 | ->eq('id', $project_id) |
|
494 | ->update(['is_active' => 0]); |
|
495 | } |
|
496 | ||
497 | /** |
|
498 | * Enable public access for a project. |
@@ 73-80 (lines=8) @@ | ||
70 | * |
|
71 | * @return bool |
|
72 | */ |
|
73 | public function isLocked($username) |
|
74 | { |
|
75 | return $this->db->table(UserModel::TABLE) |
|
76 | ->eq('username', $username) |
|
77 | ->neq('lock_expiration_date', 0) |
|
78 | ->gte('lock_expiration_date', time()) |
|
79 | ->exists(); |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * Lock the account for the specified duration. |