Removed password creation for new users through the contact users menu

pull/217/head
iglocska 2013-07-25 17:23:52 +02:00
parent e577d587fd
commit 8bf54e7c01
1 changed files with 2 additions and 14 deletions

View File

@ -609,12 +609,12 @@ class UsersController extends AppController {
$message2 .= "\n\nBest Regards,\n" . Configure::read('CyDefSIG.org') . ' MISP support';
// Return an error message if the action is a password reset for a new user
if ($this->request->data['User']['recipient'] == 2 && $this->request->data['User']['action'] == '1') {
$this->Session->setFlash(__('Cannot reset the password of a user that doesn\'t exist.'));
$this->redirect(array('action' => 'email', 'admin' => true));
}
// Setting up the list of recipient(s) based on the setting and creating the final message for each user, including the password
// If the recipient is all users, and the action to create a password, create it and for each user and squeeze it between the main message and the signature
if ($this->request->data['User']['recipient'] == 0) {
@ -651,18 +651,6 @@ class UsersController extends AppController {
}
}
// If the recipient is a future user, and the action to create a password, create it and squeeze it between the main message and the signature
if ($this->request->data['User']['recipient'] == 2) {
$recipients[0] = $this->request->data['User']['recipientEmail'];
$recipientGPG[0] = $this->request->data['User']['gpg'];
if ($this->request->data['User']['action'] == '1') {
$password = $this->User->generateRandomPassword();
$message[0] = $message1 . "\n\nYour temporary password: " . $password . $message2;
$recipientPass[0] = $password;
} else {
$message[0] = $message1;
}
}
require_once 'Crypt/GPG.php';
$i = 0;
foreach ($recipients as $recipient) {