Changeset 23207


Ignore:
Timestamp:
Jun 14, 2013, 3:10:07 PM (7 years ago)
Author:
mistic100
Message:

fix loop redirect when no email configured

Location:
extensions/ContactForm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/admin.php

    r17483 r23207  
    1717include(CONTACT_FORM_PATH . 'admin/' . $page['tab'] . '.php');
    1818
    19 if (!count(get_contact_emails()))
     19if (!$conf['ContactForm']['cf_ready'])
    2020{
    2121  array_push($page['errors'], l10n('No active email address'));
  • extensions/ContactForm/admin/emails.php

    r18649 r23207  
    3434    $emails
    3535    );
     36   
     37  $conf['ContactForm']['cf_ready'] = count($emails);
    3638 
    3739  array_push($page['infos'], l10n('Information data registered in database'));
  • extensions/ContactForm/include/contact_form.inc.php

    r22665 r23207  
    44global $template, $user, $conf, $page, $pwg_loaded_plugins;
    55
    6 if ( (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) or !count(get_contact_emails()) )
     6if ( (!is_classic_user() and !$conf['ContactForm']['cf_allow_guest']) or !$conf['ContactForm']['cf_ready'] )
    77{
    8   redirect(get_root_url());
     8  redirect(get_absolute_root_url());
    99}
    1010
  • extensions/ContactForm/include/functions.inc.php

    r23206 r23207  
    4848  if ( !$conf['ContactForm']['cf_menu_link'] ) return;
    4949  if ( !is_classic_user() and !$conf['ContactForm']['cf_allow_guest'] ) return;
    50   if ( !count(get_contact_emails()) ) return;
     50  if ( !$conf['ContactForm']['cf_ready'] ) return;
    5151
    5252  $menu = &$menu_ref_arr[0];
     
    6565function contact_form_footer_link($content, &$smarty)
    6666{
     67  global $conf;
     68  if ( !$conf['ContactForm']['cf_ready'] ) return $content;
     69 
    6770  $search = '<a href="mailto:{$CONTACT_MAIL}?subject={\'A comment on your site\'|@translate|@escape:url}">';
    6871  $replace = '<a href="'.CONTACT_FORM_PUBLIC.'">';
  • extensions/ContactForm/main.inc.php

    r21208 r23207  
    4242function contact_form_init()
    4343{
    44   global $conf, $template,  $pwg_loaded_plugins;
     44  global $conf, $template, $pwg_loaded_plugins;
    4545 
    4646  if (
     
    7979  }
    8080 
     81  $conf['ContactForm']['cf_ready'] = count(get_contact_emails());
     82 
    8183  $template->set_prefilter('tail', 'contact_form_footer_link');
    8284}
Note: See TracChangeset for help on using the changeset viewer.