summaryrefslogtreecommitdiff
path: root/jsonrpc.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-01-19 21:49:01 -0500
committerFrederic Guillot <fred@kanboard.net>2015-01-19 21:49:01 -0500
commit0d80102c4837ccd01edfec948b59be97385c6a16 (patch)
tree718a1f4b8200a0dea53b54025118b5ca14196224 /jsonrpc.php
parent525d31d1bf485552330222049b630345814c9b44 (diff)
Minor code improvements for the pull-request
Diffstat (limited to 'jsonrpc.php')
-rw-r--r--jsonrpc.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/jsonrpc.php b/jsonrpc.php
index 3de9de1b..0b71af10 100644
--- a/jsonrpc.php
+++ b/jsonrpc.php
@@ -160,15 +160,16 @@ $server->register('createUser', function($username, $password, $name = '', $emai
$server->register('createLdapUser', function($username = '', $email = '', $is_admin = 0, $default_project_id = 0) use ($container) {
$ldap = new Auth\Ldap($container);
- $res = $ldap->lookup($username, $email);
+ $user = $ldap->lookup($username, $email);
- if (!$res)
+ if (! $user) {
return false;
+ }
$values = array(
- 'username' => $res['username'],
- 'name' => $res['name'],
- 'email' => $res['email'],
+ 'username' => $user['username'],
+ 'name' => $user['name'],
+ 'email' => $user['email'],
'is_ldap_user' => 1,
'is_admin' => $is_admin,
'default_project_id' => $default_project_id,