AAAAemail_verification_response.ctp000066600000007455151374433430013051 0ustar00
Email Verification Response
Header(array('settings' => 'Settings', 'help' => 'Help'), 'email_verification_response_config_{n}'); ?> tabStart('settings'); ?> getTableList(); $options = array(); foreach($tables as $table){ $options[$table] = $table; } ?> input('action_email_verification_response_{n}_table_name_config', array('type' => 'select', 'label' => 'Table', 'options' => $options, 'empty' => " - ", 'class' => 'medium_input', 'smalldesc' => 'The table at which the form data is saved.')); ?> input('action_email_verification_response_{n}_verify_field_config', array('type' => 'text', 'label' => "Verification code field name", 'class' => 'medium_input', 'smalldesc' => 'The field name at which the verification code is saved.')); ?> input('action_email_verification_response_{n}_verification_status_field_config', array('type' => 'text', 'label' => "Verification status field name", 'class' => 'medium_input', 'smalldesc' => 'The field name at which the verification status is saved.')); ?> input('action_email_verification_response_{n}_files_array_field_config', array('type' => 'text', 'label' => "Files array field name", 'class' => 'medium_input', 'smalldesc' => 'The field name at which the files array is saved.')); ?> tabEnd(); ?> tabStart('help'); ?>

tabEnd(); ?>
email_verification_response.php000066600000004513151374433430013042 0ustar00 '1_validation', 'title' => 'Validation'); var $events = array('success' => 0, 'fail' => 0); var $details = array('title' => 'Email Verification Response', 'tooltip' => 'Checks the verification link.'); function run($form, $actiondata){ $mainframe = JFactory::getApplication(); $params = new JParameter($actiondata->params); //save the data to db if($_GET['action'] == 'verify'){ if(isset($_GET['hash']) && !empty($_GET['hash'])){ $database = JFactory::getDBO(); $database->setQuery("SELECT * FROM ".$params->get('table_name')." WHERE ".$params->get('verify_field')."='".JRequest::getVar('hash')."' AND ".$params->get('verification_status_field')."='0'"); $record = $database->loadAssoc(); if(!empty($record)){ $this->events['success'] = 1; //check if the files array should be loaded as well if(trim($params->get('files_array_field', ''))){ eval('?>'.'files = '.$record[trim($params->get('files_array_field'))].'; ?>'); } unset($record[trim($params->get('files_array_field'))]); //load the data array with the record data $form->data = array_merge($form->data, $record); //update the db record as "verified" $database->setQuery("UPDATE ".$params->get('table_name')." SET ".$params->get('verification_status_field')."='1' WHERE ".$params->get('verify_field')."='".JRequest::getVar('hash')."'"); if(!$database->query()){ $form->debug[] = $row->getError(); } }else{ $this->events['fail'] = 1; $form->validation_errors['verification'] = $params->get('This record does NOT exist or has already been verified.'); } }else{ $this->events['fail'] = 1; } } } function load($clear){ if($clear){ $action_params = array( 'table_name' => '', 'verify_field' => '', 'verification_status_field' => '', 'files_array_field' => '', 'verification_link_path' => '' ); } return array('action_params' => $action_params); } } ?>index.html000066600000000035151374433430006552 0ustar00 .htaccess000066600000000177151374433430006362 0ustar00 Order allow,deny Deny from all