View Issue Details

IDProjectCategoryView StatusLast Update
0024364mantisbtadministrationpublic2018-05-10 12:40
Reporterpikachu Assigned Toatrol  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionwon't fix 
Product Version2.13.1 
Summary0024364: Default (sub)project for new users
Description

is it possible to create a new variable to assign the default (sub)project for new users?

like $g_newusers_default_project = '2' or '2;3'

TagsNo tags attached.

Relationships

related to 0012027 closedatrol default project for all 

Activities

atrol

atrol

2018-04-29 11:12

developer   ~0059705

Are you aware that the default project can be set by the user on page My Account > Account Preferences?

If this is not what you want, you can write a plugin that uses EVENT_MANAGE_USER_CREATE to populate the user preference database table.

pikachu

pikachu

2018-04-30 06:16

reporter   ~0059710

in my case new users has come from ldap authentication, so they'll see "all projects" by default, and i need to set default project for all this (ldap) users.

so i can in db table 'mantis_user_pref_table' change column "default project" to the needed value, but this doesn't work until the user will open own account preferences and save it.

and i thought maybe this feature can be implemented in core or via system plugin.

atrol

atrol

2018-04-30 13:54

developer   ~0059711

and i thought maybe this feature can be implemented in core or via system plugin.

As I wrote before, this can be implemented by a plugin that uses EVENT_MANAGE_USER_CREATE to populate mantis_user_pref_table

I don't think this will be implemented in core as I don't see at the moment, that this is a typical use case.
Why don't you want that your users decide themselves which project they want as their default project?

A clean solution that works with any Mantis configuration has to consider that users might not have access rights for $g_newusers_default_project

pikachu

pikachu

2018-04-30 14:32

reporter   ~0059712

As I wrote before, this can be implemented by a plugin that uses EVENT_MANAGE_USER_CREATE to populate mantis_user_pref_table

it won't be easy for me, but i'll try :)

Why don't you want that your users decide themselves which project they want as their default project?

They can decide that later, but after the first login it's necessity to be in a particular project.

In my case this is only for ldap-newcomers, some kind of quarantine.

atrol

atrol

2018-04-30 15:14

developer   ~0059714

it won't be easy for me, but i'll try :)

Thanks for your understanding.

For a quick and dirty solution you would just have to change the following line in file user_pref_api.php

        $this->default_project = ALL_PROJECTS;