Commit acd924ca authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Fix error when adding an empty username. Bug 1438390"

parents 7c11ff0a 5686c113
......@@ -161,7 +161,7 @@ function webservices_token_submit(Pieform $form, $values) {
global $SESSION, $USER;
if ($values['action'] == 'generate') {
if (isset($values['userid'][0])) {
if (!empty($values['userid'][0])) {
$dbuser = get_record('usr', 'id', $values['userid'][0]);
if (!empty($dbuser)) {
$services = get_records_array('external_services', 'restrictedusers', 0);
......@@ -208,7 +208,7 @@ function webservices_user_submit(Pieform $form, $values) {
global $SESSION, $USER;
if ($values['action'] == 'add') {
if (isset($values['userid'][0])) {
if (!empty($values['userid'][0])) {
$dbuser = get_record('usr', 'id', $values['userid'][0]);
if ($auth_instance = webservice_validate_user($dbuser)) {
// make sure that this account is not already in use
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment