fixing some queries for users with mysql in strict mode
parent
a9e88a27db
commit
e6a5682bf4
|
@ -211,6 +211,8 @@ class InstallController extends AbstractController {
|
||||||
if(!defined('PSM_DB_PREFIX') || !$this->db->status()) {
|
if(!defined('PSM_DB_PREFIX') || !$this->db->status()) {
|
||||||
return $this->executeConfig();
|
return $this->executeConfig();
|
||||||
}
|
}
|
||||||
|
$add_user = false;
|
||||||
|
|
||||||
// check if user submitted username + password in previous step
|
// check if user submitted username + password in previous step
|
||||||
// this would only be the case for new installs, and install from
|
// this would only be the case for new installs, and install from
|
||||||
// before 3.0
|
// before 3.0
|
||||||
|
@ -220,6 +222,7 @@ class InstallController extends AbstractController {
|
||||||
'password' => psm_POST('password'),
|
'password' => psm_POST('password'),
|
||||||
'password_repeat' => psm_POST('password_repeat'),
|
'password_repeat' => psm_POST('password_repeat'),
|
||||||
'email' => psm_POST('email', ''),
|
'email' => psm_POST('email', ''),
|
||||||
|
'mobile' => '',
|
||||||
'level' => PSM_USER_ADMIN,
|
'level' => PSM_USER_ADMIN,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -227,15 +227,16 @@ class UserController extends AbstractController {
|
||||||
if(!empty($clean['password'])) {
|
if(!empty($clean['password'])) {
|
||||||
$password = $clean['password'];
|
$password = $clean['password'];
|
||||||
}
|
}
|
||||||
unset($clean['password']);
|
|
||||||
unset($clean['password_repeat']);
|
unset($clean['password_repeat']);
|
||||||
|
|
||||||
if($user_id > 0) {
|
if($user_id > 0) {
|
||||||
// edit user
|
// edit user
|
||||||
|
unset($clean['password']); // password update is executed separately
|
||||||
$this->db->save(PSM_DB_PREFIX.'users', $clean, array('user_id' => $user_id));
|
$this->db->save(PSM_DB_PREFIX.'users', $clean, array('user_id' => $user_id));
|
||||||
$this->addMessage(psm_get_lang('users', 'updated'), 'success');
|
$this->addMessage(psm_get_lang('users', 'updated'), 'success');
|
||||||
} else {
|
} else {
|
||||||
// add user
|
// add user
|
||||||
|
$clean['password'] = ''; // password update is executed separately
|
||||||
$user_id = $this->db->save(PSM_DB_PREFIX.'users', $clean);
|
$user_id = $this->db->save(PSM_DB_PREFIX.'users', $clean);
|
||||||
$this->addMessage(psm_get_lang('users', 'inserted'), 'success');
|
$this->addMessage(psm_get_lang('users', 'inserted'), 'success');
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Installer {
|
||||||
|
|
||||||
$this->log('Populating database...');
|
$this->log('Populating database...');
|
||||||
$queries = array();
|
$queries = array();
|
||||||
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "servers` (`ip`, `port`, `label`, `type`, `status`, `error`, `rtime`, `last_online`, `last_check`, `active`, `email`, `sms`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes')";
|
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "servers` (`ip`, `port`, `label`, `type`, `pattern`, `status`, `error`, `rtime`, `last_online`, `last_check`, `active`, `email`, `sms`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', '', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', '', 'on', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'yes', 'yes', 'yes')";
|
||||||
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "users_servers` (`user_id`,`server_id`) VALUES (1, 1), (1, 2);";
|
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "users_servers` (`user_id`,`server_id`) VALUES (1, 1), (1, 2);";
|
||||||
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUE
|
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUE
|
||||||
('language', 'en_US'),
|
('language', 'en_US'),
|
||||||
|
|
Loading…
Reference in New Issue