Ignore:
Timestamp:
Dec 21, 2013, 6:39:06 PM (10 years ago)
Author:
mistic100
Message:

try to simplify integration of captchas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/main.inc.php

    r26067 r26072  
    3838{
    3939  add_event_handler('loc_end_section_init', 'crypto_document_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30);
     40  add_event_handler('loc_begin_register', 'crypto_register_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30);
    4041}
    4142
     
    6465    return;
    6566  }
    66  
    67   if (script_basename() == 'register' and $conf['cryptographp']['activate_on']['register'])
     67
     68  if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'])
    6869  {
    69     $conf['cryptographp']['template'] = 'register';
    70     include(CRYPTO_PATH . 'include/register.inc.php');
    71   }
    72   else if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'])
    73   {
    74     $conf['cryptographp']['template'] = 'comment';
    7570    include(CRYPTO_PATH . 'include/picture.inc.php');
    7671  }
     
    8479      )
    8580    {
    86       $conf['cryptographp']['template'] = 'comment';
    8781      include(CRYPTO_PATH . 'include/category.inc.php');
    8882    }
    8983    else if ($page['section'] == 'contact' && $conf['cryptographp']['activate_on']['contactform'])
    9084    {
    91       $conf['cryptographp']['template'] = 'contactform';
    9285      include(CRYPTO_PATH . 'include/contactform.inc.php');
    9386    }
    9487    else if ($page['section'] == 'guestbook' && $conf['cryptographp']['activate_on']['guestbook'])
    9588    {
    96       $conf['cryptographp']['template'] = 'guestbook';
    9789      include(CRYPTO_PATH . 'include/guestbook.inc.php');
    9890    }
     91  }
     92}
     93function crypto_register_init()
     94{
     95  global $conf;
     96 
     97  if (!is_a_guest())
     98  {
     99    return;
     100  }
     101
     102  if ($conf['cryptographp']['activate_on']['register'])
     103  {
     104    include(CRYPTO_PATH . 'include/register.inc.php');
    99105  }
    100106}
Note: See TracChangeset for help on using the changeset viewer.