site_403 is not an easy variable to find when using strongarm and features. I spent too long looking for it.

I suggest if you have time, you save someone else this pain.
To save you some time I've done this..
(sorry no time for patch atm)

$  grep -R 'site_403' *
logintoboggan.admin.inc:  $site403 = variable_get('site_403', '');
logintoboggan.admin.inc:  $form['other']['logintoboggan_site_403'] = array(
logintoboggan.admin.inc:  $site_403 = $form_state['values']['logintoboggan_site_403'] == '0' ? '' : $form_state['values']['logintoboggan_site_403'];
logintoboggan.admin.inc:  variable_set('site_403', $site_403);
logintoboggan.admin.inc:  unset($form_state['values']['logintoboggan_site_403']);
logintoboggan.install:  if (variable_get('site_403', '') == 'toboggan/denied') {
logintoboggan.install:    variable_set('site_403', '');
CommentFileSizeAuthor
#1 variable_rename-1832296-1.patch748 bytesmd2

Comments

md2’s picture

StatusFileSize
new748 bytes

site_403 is a core variable, not an LT variable. The following patch brings all variables $site403 consistant with $site_403 to make things a little easier to find.

dynamicdan’s picture

hmm...
Perhaps I found the wrong var?

I'm looking for the one that shows the login box for 403 pages... 'logintoboggan_site_403' in form.

md2’s picture

Hi dynamicdan,

The variable will have the same name as the $form api array that defines it. So

$form['other']['logintoboggan_site_403'] = array(
...
...

will have the variable name of logintoboggan_site_403.

You can get its value by doing a
variable_get('logintoboggan_site_403');

Hope this helps,
Mark

ACF’s picture

Status: Active » Closed (works as designed)
dynamicdan’s picture

Status: Closed (works as designed) » Active

I see the following variables when using strongarm and features:

  • logintoboggan_confirm_email_at_registration
  • logintoboggan_immediate_login_on_register
  • logintoboggan_login_successful_message
  • logintoboggan_login_with_email
  • logintoboggan_minimum_password_length
  • logintoboggan_override_destination_parameter
  • logintoboggan_pre_auth_role
  • logintoboggan_purge_unvalidated_user_interval
  • logintoboggan_redirect_on_confirm
  • logintoboggan_redirect_on_register
  • logintoboggan_unified_login

Which is the right one that handles showing the login box for access denied pages? logintoboggan_site_403 is simply not shown.

ptmkenny’s picture

Category: feature » support

I'm having the same issue as dynamicdan in #5. I'm trying to get all my variables exported in features using strongarm and I simply can't find the value for "Present login form on access denied (403)."

md2’s picture

Hi dynamicdan . ptmkenny,

Sorry dynamicdan, I think I misunderstood your original post. Your spot on, the logintoboggan_site_403 doesn't appear and can't be exported.

Looking into the form's code it looks like the module, during the submit handler unsets the value for 'logintoboggan_site_403'. Before doing so it sets the Drupal variable 'site_403' to the correct settings taken from the logic of logintoboggan_site_403.

/**
 * Takes custom settings on the main settings page, transforms them into the
 * appropriate core setting, and cleans up the custom values.
 */
function logintoboggan_main_settings_submit($form, &$form_state) {
  ...
  ...

  // Site 403 setting.
  $site_403 = $form_state['values']['logintoboggan_site_403'] == '0' ? '' : $form_state['values']['logintoboggan_site_403'];
  variable_set('site_403', $site_403);
  unset($form_state['values']['logintoboggan_site_403']);
  ...
  ...

Therefore, to export the logintoboggan 403 configuration, I believe you should instead export the core drupal site_403 variable. This isn't overly clear from a site configuration point of view.

Hope this helps,
Mark