diff --git a/INSTALL/MYSQL.sql b/INSTALL/MYSQL.sql index d559225c7..9afec4086 100644 --- a/INSTALL/MYSQL.sql +++ b/INSTALL/MYSQL.sql @@ -1661,4 +1661,6 @@ INSERT IGNORE INTO `org_blocklists` (`org_uuid`, `created`, `org_name`, `comment ('58d38339-7b24-4386-b4b4-4c0f950d210f', NOW(), 'Setec Astrononomy', 'default example'), ('58d38326-eda8-443a-9fa8-4e12950d210f', NOW(), 'Acme Finance', 'default example'); -INSERT IGNORE INTO `admin_settings` (`setting`, `value`) VALUES ('fix_login', NOW()); +INSERT IGNORE INTO `admin_settings` (`setting`, `value`) VALUES +('fix_login', NOW()), +('default_role', 3); \ No newline at end of file diff --git a/app/Model/AppModel.php b/app/Model/AppModel.php index 9280a572a..ffca8d7f4 100644 --- a/app/Model/AppModel.php +++ b/app/Model/AppModel.php @@ -84,6 +84,7 @@ class AppModel extends Model 87 => false, 88 => false, 89 => false, 90 => false, 91 => false, 92 => false, 93 => false, 94 => false, 95 => true, 96 => false, 97 => true, 98 => false, 99 => false, 100 => false, 101 => false, 102 => false, 103 => false, 104 => false, + 105 => false ); const ADVANCED_UPDATES_DESCRIPTION = array( @@ -1929,6 +1930,17 @@ class AppModel extends Model case 104: $sqlArray[] = "ALTER TABLE `access_logs` ADD `query_log` blob DEFAULT NULL"; break; + case 105: + // set a default role if there is none + if (!$this->AdminSetting->getSetting('default_role')) { + $role = $this->Role->findByName('User'); + if ($role) { + $sqlArray[] = "INSERT INTO `admin_settings` (setting, value) VALUES ('default_role', '".$role['Role']['id']."');"; + } else { + // there is no role called User, do nothing + } + } + break; case 'fixNonEmptySharingGroupID': $sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; $sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; diff --git a/app/View/Users/view.ctp b/app/View/Users/view.ctp index 74f3c9773..cfcd5fb9d 100755 --- a/app/View/Users/view.ctp +++ b/app/View/Users/view.ctp @@ -25,7 +25,7 @@ ); $table_data[] = array('key' => __('Role'), 'html' => $this->Html->link($user['Role']['name'], array('controller' => 'roles', 'action' => 'view', $user['Role']['id']))); $table_data[] = array('key' => __('Event alert enabled'), 'boolean' => $user['User']['autoalert']); - $table_data[] = ['key' => __('Periodic Notifications'), 'html' => $periodic_notification_settings_html]; + $table_data[] = array('key' => __('Periodic Notifications'), 'html' => $periodic_notification_settings_html); $table_data[] = array('key' => __('Contact alert enabled'), 'boolean' => $user['User']['contactalert']); if (!$admin_view && !$user['Role']['perm_auth']) { @@ -160,4 +160,6 @@ 'admin_view' => ['menuList' => 'admin', 'menuItem' => 'viewUser'], 'view' => ['menuList' => 'globalActions', 'menuItem' => 'view'] ]; + ?> + element('/genericElements/SideMenu/side_menu', $current_menu[$admin_view ? 'admin_view' : 'view']);