fix: fixed a bug retrieving an org with no users

pull/1912/head
iglocska 2017-02-06 18:15:26 +01:00
parent d6654b258e
commit a4696a9366
1 changed files with 4 additions and 1 deletions

View File

@ -900,6 +900,9 @@ App::uses('RandomTool', 'Tools');
'conditions' => $conditions
);
$orgs = $this->find($findType, $params);
if (empty($orgs)) {
return 0;
}
if ($org_id !== false) {
return $orgs[0]['num_members'];
} else {
@ -954,7 +957,7 @@ App::uses('RandomTool', 'Tools');
if ($fixedPassword) {
$password = $fixedPassword;
} else {
$password = $this->generateRandomPassword();
$password = $this->generateRandomPassword();
}
$body = str_replace('$password', $password, $body);
$body = str_replace('$username', $user['User']['email'], $body);