fix: Some small fixes

- Lowered TLP string setting to low importance
- auto set authkey if not set during user creation
pull/1271/head
Iglocska 2016-06-08 13:18:34 +02:00
parent e3d197f53a
commit f219c3c67a
2 changed files with 3 additions and 1 deletions

View File

@ -273,7 +273,7 @@ class Server extends AppModel {
'type' => 'boolean',
),
'email_subject_TLP_string' => array(
'level' => 0,
'level' => 2,
'description' => 'This is the TLP string in alert e-mail sent when an event is published.',
'value' => 'TLP Amber',
'errorMessage' => '',
@ -2612,6 +2612,7 @@ class Server extends AppModel {
}
}
// currently unused, but let's keep it in the code-base in case we need it in the future.
private function __dropIndex($table, $field) {
$this->Log = ClassRegistry::init('Log');
$indexCheck = "SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema=DATABASE() AND table_name='" . $table . "' AND index_name LIKE '" . $field . "%'";

View File

@ -269,6 +269,7 @@ class User extends AppModel {
$this->data['User']['confirm_password'] = $this->data['User']['password'];
}
}
if (!isset($this->data['User']['authkey']) || empty($this->data['User']['authkey'])) $this->generateAuthKey();
if (!isset($this->data['User']['nids_sid']) || empty($this->data['User']['nids_sid'])) $this->data['User']['nids_sid'] = mt_rand(1000000, 9999999);
return true;
}