Minor code improvements for the pull-request

This commit is contained in:
Frederic Guillot
2015-01-19 21:49:01 -05:00
parent 525d31d1bf
commit 0d80102c48
2 changed files with 18 additions and 13 deletions

View File

@@ -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,