Changeset 26025 for extensions/EasyCaptcha/main.inc.php
- Timestamp:
- Dec 18, 2013, 6:48:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/EasyCaptcha/main.inc.php
r24234 r26025 11 11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 // TODO : teston mobile13 // TODO : captcha on mobile 14 14 if (mobile_theme()) 15 15 { … … 17 17 } 18 18 19 define d('EASYCAPTCHA_ID') or define('EASYCAPTCHA_ID',basename(dirname(__FILE__)));20 define('EASYCAPTCHA_PATH' , PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/');21 define('EASYCAPTCHA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID);19 define('EASYCAPTCHA_ID', basename(dirname(__FILE__))); 20 define('EASYCAPTCHA_PATH' , PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/'); 21 define('EASYCAPTCHA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID); 22 22 define('EASYCAPTCHA_VERSION', 'auto'); 23 23 … … 40 40 global $conf, $pwg_loaded_plugins; 41 41 42 if ( 43 EASYCAPTCHA_VERSION == 'auto' or 44 $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] == 'auto' or 45 version_compare($pwg_loaded_plugins[EASYCAPTCHA_ID]['version'], EASYCAPTCHA_VERSION, '<') 46 ) 47 { 48 include_once(EASYCAPTCHA_PATH . 'include/install.inc.php'); 49 easycaptcha_install(); 50 51 if ( $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] != 'auto' && EASYCAPTCHA_VERSION != 'auto' ) 52 { 53 $query = ' 54 UPDATE '. PLUGINS_TABLE .' 55 SET version = "'. EASYCAPTCHA_VERSION .'" 56 WHERE id = "'. EASYCAPTCHA_ID .'"'; 57 pwg_query($query); 58 59 $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] = EASYCAPTCHA_VERSION; 60 } 61 } 42 include_once(EASYCAPTCHA_PATH . 'maintain.inc.php'); 43 $maintain = new EasyCaptcha_maintain(EASYCAPTCHA_ID); 44 $maintain->autoUpdate(EASYCAPTCHA_VERSION, 'install'); 62 45 63 46 load_language('plugin.lang', EASYCAPTCHA_PATH); … … 71 54 global $conf, $pwg_loaded_plugins, $page; 72 55 73 if (!is_a_guest()) return; 56 if (!is_a_guest()) 57 { 58 return; 59 } 74 60 75 if ( script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register'])61 if (script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register']) 76 62 { 77 63 $conf['EasyCaptcha']['template'] = 'register'; 78 64 include(EASYCAPTCHA_PATH . 'include/register.inc.php'); 79 65 } 80 else if ( script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture'])66 else if (script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture']) 81 67 { 82 68 $conf['EasyCaptcha']['template'] = 'comment'; … … 95 81 include(EASYCAPTCHA_PATH . 'include/category.inc.php'); 96 82 } 97 else if ( $page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform'])83 else if ($page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform']) 98 84 { 99 85 $conf['EasyCaptcha']['template'] = 'contactform'; 100 86 include(EASYCAPTCHA_PATH . 'include/contactform.inc.php'); 101 87 } 102 else if ( $page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook'])88 else if ($page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook']) 103 89 { 104 90 $conf['EasyCaptcha']['template'] = 'guestbook'; … … 112 98 function easycaptcha_plugin_admin_menu($menu) 113 99 { 114 array_push($menu,array(100 $menu[] = array( 115 101 'NAME' => 'Easy Captcha', 116 102 'URL' => EASYCAPTCHA_ADMIN, 117 ) );103 ); 118 104 return $menu; 119 105 }
Note: See TracChangeset
for help on using the changeset viewer.