diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-14 15:43:08 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-14 15:43:08 -0400 |
commit | b2cce5a3a1a0be68102e614b42d2ee6a030bd523 (patch) | |
tree | 0014f4362cee39f98727276bc79aa96adc213fee /app/Api | |
parent | 80fb3bc9aa842ef75f1f8282db63ca43282aacd7 (diff) |
Add new role Project Administrator
Diffstat (limited to 'app/Api')
-rw-r--r-- | app/Api/User.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/Api/User.php b/app/Api/User.php index 7409a41b..4884c45c 100644 --- a/app/Api/User.php +++ b/app/Api/User.php @@ -27,7 +27,7 @@ class User extends \Core\Base return $this->user->remove($user_id); } - public function createUser($username, $password, $name = '', $email = '', $is_admin = 0) + public function createUser($username, $password, $name = '', $email = '', $is_admin = 0, $is_project_admin = 0) { $values = array( 'username' => $username, @@ -36,14 +36,14 @@ class User extends \Core\Base 'name' => $name, 'email' => $email, 'is_admin' => $is_admin, + 'is_project_admin' => $is_project_admin, ); list($valid,) = $this->user->validateCreation($values); - return $valid ? $this->user->create($values) : false; } - public function createLdapUser($username = '', $email = '', $is_admin = 0) + public function createLdapUser($username = '', $email = '', $is_admin = 0, $is_project_admin = 0) { $ldap = new Ldap($this->container); $user = $ldap->lookup($username, $email); @@ -58,12 +58,13 @@ class User extends \Core\Base 'email' => $user['email'], 'is_ldap_user' => 1, 'is_admin' => $is_admin, + 'is_project_admin' => $is_project_admin, ); return $this->user->create($values); } - public function updateUser($id, $username = null, $name = null, $email = null, $is_admin = null) + public function updateUser($id, $username = null, $name = null, $email = null, $is_admin = null, $is_project_admin = null) { $values = array( 'id' => $id, @@ -71,6 +72,7 @@ class User extends \Core\Base 'name' => $name, 'email' => $email, 'is_admin' => $is_admin, + 'is_project_admin' => $is_project_admin, ); foreach ($values as $key => $value) { |