forked from biblat/Biblat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
321db6d
commit 3409019
Showing
10 changed files
with
215 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
cache/ | ||
.DS_Store | ||
database/* | ||
node_modules/* | ||
.po | ||
logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | ||
$recaptcha['development']['public_key'] = '6LexnuoSAAAAACzbXNAf3Ul1qgBeubEWOIxbqk0b'; | ||
$recaptcha['development']['private_key'] = '6LexnuoSAAAAAMsVr9HWpykARQhecRJ-NAeRgf74'; | ||
$recaptcha['production']['public_key'] = '6LeOneoSAAAAAPxWX1XOJFFDSHHel811saFQvELE'; | ||
$recaptcha['production']['private_key'] = '6LeOneoSAAAAAKcZfvAKicQd6_spDKVxDe0vxkkI'; | ||
$config['public_key'] = $recaptcha[ENVIRONMENT]['public_key']; | ||
$config['private_key'] = $recaptcha[ENVIRONMENT]['private_key']; | ||
// Set Recaptcha theme, default red (red/white/blackglass/clean) | ||
$config['recaptcha_theme'] = 'white'; | ||
?> | ||
<?php | ||
defined('BASEPATH') OR exit('No direct script access allowed'); | ||
/** | ||
* Recaptcha configuration settings | ||
* | ||
* recaptcha_sitekey: Recaptcha site key to use in the widget | ||
* recaptcha_secretkey: Recaptcha secret key which is used for communicating between your server to Google's | ||
* lang: Language code, if blank "en" will be used | ||
* | ||
* recaptcha_sitekey and recaptcha_secretkey can be obtained from https://www.google.com/recaptcha/admin/ | ||
* Language code can be obtained from https://developers.google.com/recaptcha/docs/language | ||
* | ||
* @author Damar Riyadi <[email protected]> | ||
*/ | ||
$config['recaptcha_sitekey'] = ''; | ||
$config['recaptcha_secretkey'] = ''; | ||
$config['lang'] = "es"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,16 +339,39 @@ public function articulo($revista='', $articulo='', $mail=''){ | |
} | ||
|
||
public function solicitudDocumento(){ | ||
$this->output->enable_profiler(false); | ||
if(!empty($_POST['email']) && !empty($_POST['from']) && !empty($_POST['revista']) && !empty($_POST['articulo'])): | ||
$this->output->enable_profiler(FALSE); | ||
$send_email = TRUE; | ||
$result = array( | ||
'type' => 'error', | ||
'title' => _('No se pudo enviar la solicitud') | ||
); | ||
if(empty($_POST['email']) || empty($_POST['from']) || empty($_POST['revista']) || empty($_POST['articulo'])): | ||
$send_email =FALSE; | ||
endif; | ||
|
||
$verify_email = verifyEmail($_POST['email'], $this->config->item('valitation_email'), true); | ||
if($verify_email[0] == 'invalid'): | ||
$send_email =FALSE; | ||
$result['title'] = _('Correo electrónico no valido'); | ||
endif; | ||
|
||
$captcha_answer = $this->input->post('g-recaptcha-response'); | ||
$response = $this->recaptcha->verifyResponse($captcha_answer); | ||
|
||
if(!$response['success']): | ||
$send_email =FALSE; | ||
$result['title'] = _('Verificación incorrecta'); | ||
endif; | ||
|
||
if ($send_email): | ||
$biblatDB = $this->load->database('biblat', TRUE); | ||
$config['mailtype'] = 'html'; | ||
$this->load->library('email'); | ||
$this->email->initialize($config); | ||
$this->email->from('[email protected]', 'Solicitud Biblat'); | ||
$this->email->to('[email protected]'); | ||
//$this->email->to('[email protected]'); | ||
//$this->email->cc('[email protected]'); | ||
// $this->email->to('[email protected]'); | ||
// $this->email->cc('[email protected]'); | ||
$this->email->subject('Solicitud de documento Biblat'); | ||
$data = $_POST; | ||
$data['fichaDocumento'] = $this->articulo($data['revista'], $data['articulo'], 'true'); | ||
|
@@ -376,11 +399,6 @@ public function solicitudDocumento(){ | |
'type' => 'success', | ||
'title' => _('La solicitud ha sido enviada') | ||
); | ||
else: | ||
$result = array( | ||
'type' => 'error', | ||
'title' => _('No se pudo enviar la solicitud') | ||
); | ||
endif; | ||
echo json_encode($result); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.