User preferences

One instance of phpMyAdmin can be installed to serve multiple users; however, before version 3.4.0, these users had to be content with the parameter values as chosen by the person in charge for this instance.

It's true that some pages on the interface has allowed tweaking specific parameters and that some of these were remembered in cookies, for example, the chosen language; but this version is the first to offer a global mechanism for adjusting and remembering preferences per user.

Even in the case where the instance has only one user, it's more convenient to be able to fine-tune preferences from the interface rather than manipulating the configuration file.

Accessing user preferences

From the home page, we click on More settings. From any page in Server view, we click on the Settings menu tab. Upon entering the Settings panel, we see the Manage your settings sub-page:

Accessing user preferences

This sub-page is where we act globally on our preferences. Other sub-pages such as Features and Main frame are used to change specific preferences—refer to the Changing settings section.

The Import and Export dialogs will be covered in the Possible locations for saving preferences section. The More settings dialog reminds us that config.inc.php is the place to configure all possibilities, for example, specifying servers and authentication modes is out of scope for user preferences.

The Reset dialog enables us to go back to default values for all user preferences in one easy click.

Possible locations for saving preferences

There are three possible places where user preferences can be saved. Each one has pros and cons; this section covers these modes.

Saving in phpMyAdmin configuration storage

To enable this mode, $cfg['Servers'][$i]['userconfig'] must be configured with the name of the table which holds these preferences, and the table must exist. This saving location is most useful because settings are immediately applied to the running instance upon login; moreover, it follows the user on whichever browser he happens to use.

If this storage is not configured, the settings page greets us with the following message:

Your preferences will be saved for current session only. Storing them permanently requires phpMyAdmin configuration storage.

Saving in a file

We always have the possibility of exporting our settings to a file and importing them back. The file follows the JSON format (see http://json.org). This method can be handy in the following situations:

  • We plan to use these settings on another phpMyAdmin instance
  • We want to keep a history of our settings; therefore, saving them from time to time in several files

Saving in the browser's local storage

Recent browsers, for example Firefox 6 and Internet Explorer 9, offer a local storage mechanism which is persistent between sessions. The first time we enter the Manage your settings sub-page, we see the You have no saved settings! message inside the Import from browser's storage dialog. However, after exporting settings to browser's local storage, the Import section tells us the date and time when settings were last saved using this mechanism.

In addition, when phpMyAdmin settings are found in the browser's storage and the phpMyAdmin configuration storage is not available, each phpMyAdmin page has the following message at the top:

Your browser has phpMyAdmin configuration for this domain. Would you like to import it for current session? Yes / No

A drawback of using this method is that our settings are only available when we are using this browser; moreover, if our browser's settings do not follow us when we change workstations, the settings are tied to this specific workstation (and apply to any other user running phpMyAdmin on it).

Changing settings

Upon entering a sub-page for specific preferences—in this case, the Main frame sub-page, we see a third level of menus related to this subject:

Changing settings

If a preference has been changed from its default value, the checkbox or data field has a different background color and a recycle icon is shown next to it, to quickly reset this preference to its default value. Quick explanations are given for each directive and links point to the documentation and the official wiki. As a general advice, we need to save any change we make on a page before changing to a different sub-page; however, in this example, we can switch from Startup to other third-level menus such as Browse mode and back without losing our changes.

Disallowing specific preferences

The person in charge of config.inc.php has the last word about which settings are changeable in the user preferences. To disallow some settings, we use the $cfg['UserprefsDisallow'] directive. We place into it an array containing the keys in $cfg that represent the directives to disallow. As an example, we set this directive to:

$cfg['UserprefsDisallow'] = array('AjaxEnable', 'MaxDbList'),

This produces a warning as shown in the following screenshot:

Disallowing specific preferences

Showing developer settings

Some settings are sensitive and are intended only for the persons developing phpMyAdmin. For example, the possibility of displaying all errors, including PHP notices, can lead to disclose the full path of the phpMyAdmin instance. Therefore, in the Features sub-tab, the Developer menu is shown only if $cfg['UserprefsDeveloperTab'] is set to true.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.172.93