You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2013-07-19 06:17:15

tempelh
Member
Registered: 2013-07-19
Posts: 2

Prevent Users from changing 'Location'

Hi all,

I've created a new profile, named it "Customer Profile" and set it as the default profile with simplified interface. Everything looks great and works fine.

Now I'd like to prevent logged in users from changing their "Location" under Settings -> Tab "Main" -> Location.

How can I accomplish this?

Thanks-
Holger

Offline

#2 2013-07-19 11:34:42

geoalbi
Member
From: Romania
Registered: 2012-12-18
Posts: 182

Re: Prevent Users from changing 'Location'

There is no setting that can accomplish that.
You can change the code though.

Search for user.class.php andfind and  comment 2 lines of code that echo that element in the form like this:

/*         echo "<tr class='tab_bg_1'><td>" . $LANG['common'][15] . "&nbsp;:</td><td colspan='3'>";
         Dropdown::show('Location', array('value'  => $this->fields["locations_id"],
                                          'entity' => $entities));
*/

Offline

#3 2013-07-19 22:27:33

tempelh
Member
Registered: 2013-07-19
Posts: 2

Re: Prevent Users from changing 'Location'

Thanks for the reply. Just did so but the field is still being displayed.

What went wrong?

Offline

#4 2013-07-31 14:02:11

geoalbi
Member
From: Romania
Registered: 2012-12-18
Posts: 182

Re: Prevent Users from changing 'Location'

tempelh wrote:

Thanks for the reply. Just did so but the field is still being displayed.

What went wrong?

This bit of code displays the location field in the form:

 echo "<tr class='tab_bg_1'><td>" . $LANG['common'][15] . "&nbsp;:</td><td colspan='3'>";
         Dropdown::show('Location', array('value'  => $this->fields["locations_id"],
                                          'entity' => $entities));
echo "</td></tr>";

If you cannot comment that out of your user.class.php, then you are in the wrong line of business.

Offline

Board footer

Powered by FluxBB