diff --git a/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.html b/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.html new file mode 100755 index 00000000..61acf710 --- /dev/null +++ b/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.html @@ -0,0 +1,26 @@ +
+

reCaptcha V2 configurations

+
+
+

Google's recaptcha v2 won't work unless you provide these configurations to get your website's configurations Click here.

+
+
+
+ + +

Enter your google's recaptcha v2 site key

+
+
+ + +

Enter your google's recaptcha v2 secret key

+
+
+
+
+
+ +
+
+
+
diff --git a/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.php b/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.php new file mode 100755 index 00000000..9978e27b --- /dev/null +++ b/upload/plugins/recaptcha_v2/admin/recaptcha_v2_configs.php @@ -0,0 +1,47 @@ +admin_login_check(); +$pages->page_redir(); + +if(!defined('MAIN_PAGE')){ + define('MAIN_PAGE', 'reCaptcha v2'); +} +if(!defined('SUB_PAGE')){ + define('SUB_PAGE', "Configurations"); +} + +try { + + if(isset($_POST['recaptcha_v2_update'])){ + + + $param = $_POST; + + $response = $recv2->update_recaptcha_confs($param); + + e($response,"m"); + } + + + $rec_config=$recv2->get_recaptcha_confs(); + assign('rec_config',$rec_config); + + + +} catch (Exception $e) { + + + e($e->getMessage(),"e"); + + +} + + + + +subtitle("reCaptcha V2 configurations"); +template_files(RECAPTCHA_V2_DIR.'/admin/recaptcha_v2_configs.html'); \ No newline at end of file diff --git a/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.html b/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.html new file mode 100755 index 00000000..1092f2bf --- /dev/null +++ b/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.html @@ -0,0 +1,49 @@ + +
+ +
+

Documentation

+
+
+
+ Note: Plugin will only work with site key and the secret key set in configurations. +
+
+
+

Information About Plugin

+ +
+
+

Why You Need reCaptcha v2

+

reCaptcha v2 is the latest reCaptcha from google which is being used all over the web now a days to save websites from bots and scamers.All new reCaptcha is hard on bots and easy on humans just requires one click authentication.

+
+ +
+ +

Plugin Configurations

+

Prerequisites

+

Before getting started with reCaptcha v2 plugin you would have to get the site key and secret key from google reCaptcha to get them CLICK HERE sign in here with your google account and get you site key and site secret by follow these steps given below.

+ + + +
+
+ Warning : Plugin will only work on live domains it does not work for ip(s) or on localhost(s). +
+
+ +
+ +
diff --git a/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.php b/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.php new file mode 100755 index 00000000..a8e81b4c --- /dev/null +++ b/upload/plugins/recaptcha_v2/admin/recaptchav2_doc.php @@ -0,0 +1,19 @@ +admin_login_check(); +$pages->page_redir(); + +if(!defined('MAIN_PAGE')){ + define('MAIN_PAGE', 'reCaptcha v2'); +} +if(!defined('SUB_PAGE')){ + define('SUB_PAGE', "ReCaptcha v2 docs"); +} + + + +subtitle("Documentation"); +template_files(RECAPTCHA_V2_DIR.'/admin/recaptchav2_doc.html'); +?> \ No newline at end of file diff --git a/upload/plugins/recaptcha_v2/classes/reCaptchav2.class.php b/upload/plugins/recaptcha_v2/classes/reCaptchav2.class.php new file mode 100755 index 00000000..974cecdb --- /dev/null +++ b/upload/plugins/recaptcha_v2/classes/reCaptchav2.class.php @@ -0,0 +1,69 @@ +update(tbl('config'),array('value'),array($sitekey)," name='recaptcha_v2_site_key'"); + $db->update(tbl('config'),array('value'),array($secretkey)," name='recaptcha_v2_secret_key'"); + + $response="reCaptchav2 configurations Updated!"; + + } + + return $response; + + } + + function get_recaptcha_confs() + { + # code... + global $Cbucket; + + $rec_config = $Cbucket->configs; + // pr($rec_config,true); + if(!empty($rec_config)){ + + return $rec_config; + + }else{ + + throw new Exception("There was an error getting reCaptchav2 configs!"); + + } + } + + + +} + + +?> \ No newline at end of file diff --git a/upload/plugins/recaptcha_v2/install_recaptcha_v2.php b/upload/plugins/recaptcha_v2/install_recaptcha_v2.php new file mode 100755 index 00000000..0f72eaee --- /dev/null +++ b/upload/plugins/recaptcha_v2/install_recaptcha_v2.php @@ -0,0 +1,8 @@ +insert(tbl("config"),array("name","value"),array("recaptcha_v2_site_key","")); +$db->insert(tbl("config"),array("name","value"),array("recaptcha_v2_secret_key","")); + +?> \ No newline at end of file diff --git a/upload/plugins/recaptcha_v2/recaptcha_v2.php b/upload/plugins/recaptcha_v2/recaptcha_v2.php new file mode 100755 index 00000000..a506358d --- /dev/null +++ b/upload/plugins/recaptcha_v2/recaptcha_v2.php @@ -0,0 +1,76 @@ +configs['recaptcha_v2_site_key']; +$privatekey = $Cbucket->configs['recaptcha_v2_secret_key']; + +# the response from reCAPTCHA v2 +$resp = null; +# the error code from reCAPTCHA v2, if any +$error = null; + + + +function cbrecaptcha_v2(){ + + global $sitekey, $privatekey, $error; + return "
"; +} + + + +function validrecaptcha_v2() +{ + global $privatekey; + $ch = curl_init(sprintf( + 'https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s', + $privatekey, + $_POST['g-recaptcha-response'], + $_SERVER['REMOTE_ADDR'] + )); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + $resp = curl_exec($ch); + + curl_close($ch); + + if (($answer = json_decode($resp)) !== null) { + return $answer->success; + } + + return false; +} + + + +register_cb_captcha('cbrecaptcha_v2','validrecaptcha_v2',false); +register_anchor('; Recaptcha.reload ();','onClickAddComment'); +add_admin_menu("reCaptcha v2","Configurations",'recaptcha_v2_configs.php',_RECAPTCHA_V2_.'/admin'); +add_admin_menu("reCaptcha v2","ReCaptcha v2 docs",'recaptchav2_doc.php',_RECAPTCHA_V2_.'/admin'); + +?> \ No newline at end of file diff --git a/upload/plugins/recaptcha_v2/uninstall_recaptcha_v2.php b/upload/plugins/recaptcha_v2/uninstall_recaptcha_v2.php new file mode 100755 index 00000000..b82ff704 --- /dev/null +++ b/upload/plugins/recaptcha_v2/uninstall_recaptcha_v2.php @@ -0,0 +1,8 @@ +delete(tbl("config"),array("name"),array("recaptcha_v2_site_key")); +$db->delete(tbl("config"),array("name"),array("recaptcha_v2_secret_key")); + +?> \ No newline at end of file diff --git a/upload/styles/cb_28/layout/global_header.html b/upload/styles/cb_28/layout/global_header.html index 80c9a196..6d4834dc 100644 --- a/upload/styles/cb_28/layout/global_header.html +++ b/upload/styles/cb_28/layout/global_header.html @@ -69,9 +69,7 @@ {/if} - {if $smarty.const.THIS_PAGE == 'signup'} - - {/if} +