diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-05-28 15:14:52 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-05-28 15:14:52 -0400 |
commit | 445ef6d1481745cd4e7af7e671f534a25d4495dc (patch) | |
tree | 7990903e398d77339587595ef5a07df8464f5a2e /app/Model/Config.php | |
parent | 75ab09e28b22e9a5676ee912482027926e271515 (diff) |
Add CSRF protections
Diffstat (limited to 'app/Model/Config.php')
-rw-r--r-- | app/Model/Config.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Model/Config.php b/app/Model/Config.php index 23abd8b5..469e6447 100644 --- a/app/Model/Config.php +++ b/app/Model/Config.php @@ -5,6 +5,7 @@ namespace Model; use SimpleValidator\Validator; use SimpleValidator\Validators; use Core\Translator; +use Core\Security; /** * Config model @@ -29,7 +30,7 @@ class Config extends Base */ public function getTimezones() { - $timezones = \timezone_identifiers_list(); + $timezones = timezone_identifiers_list(); return array_combine(array_values($timezones), $timezones); } @@ -171,12 +172,12 @@ class Config extends Base */ public function regenerateTokens() { - $this->db->table(self::TABLE)->update(array('webhooks_token' => $this->generateToken())); + $this->db->table(self::TABLE)->update(array('webhooks_token' => Security::generateToken())); $projects = $this->db->table(Project::TABLE)->findAllByColumn('id'); foreach ($projects as $project_id) { - $this->db->table(Project::TABLE)->eq('id', $project_id)->update(array('token' => $this->generateToken())); + $this->db->table(Project::TABLE)->eq('id', $project_id)->update(array('token' => Security::generateToken())); } } } |