AAAAindex.html000066600000000035151375050360006550 0ustar00 check_fields_hash.php000066600000003626151375050360010703 0ustar00 'form_security', 'title' => 'Security'); var $events = array('success' => 0, 'fail' => 0); var $details = array('title' => 'Check Fields Hash', 'tooltip' => "Generates a new hash based on the new fields values and compares it to the existing one.
Your fields list here should match the list in the load action, and should be in the SAME ORDER."); function run($form, $actiondata){ $mainframe = JFactory::getApplication(); $session = JFactory::getSession(); $params = new JParameter($actiondata->params); //get secret $secret = $mainframe->getCfg('secret'); $fields = array(); if(strlen(trim($params->get('fields', '')))){ $fields = explode(',', trim($params->get('fields', ''))); } $hashed_values = array(); foreach($fields as $k => $field){ $hashed_values[$field] = $form->get_array_value($form->data, explode('.', $field)); } $form->debug['Check Fields Hash'][$actiondata->order] = $hashed_values; $hash = serialize($hashed_values); $hash = md5($hash); $hash = md5($hash.':'.$secret); $hash_field_name = trim($params->get('hash_field_name', 'cf_fields_hash')); if(!empty($form->data[$hash_field_name]) && ($form->data[$hash_field_name] == $hash)){ $this->events['success'] = 1; return true; }else{ $this->events['fail'] = 1; return false; } } function load($clear){ if($clear){ $action_params = array( 'content1' => '', 'enabled' => 1, 'hash_field_name' => 'cf_fields_hash', 'fields' => '' ); } return array('action_params' => $action_params); } } ?>check_fields_hash.ctp000066600000005127151375050360010700 0ustar00
Check Fields Hash
Header(array('settings' => 'Settings', 'help' => 'Help'), 'check_fields_hash_config_{n}'); ?> tabStart('settings'); ?> input('action_check_fields_hash_{n}_fields_config', array('type' => 'text', 'label' => 'Fields list', 'class' => 'big_input', 'smalldesc' => 'Comma separated list of fields, no spaces, you can use dots to get sub arrays values.')); ?> input('action_check_fields_hash_{n}_hash_field_name_config', array('type' => 'text', 'label' => 'Hash field name', 'smalldesc' => '')); ?> tabEnd(); ?> tabStart('help'); ?>

tabEnd(); ?>
.htaccess000066600000000177151375050360006360 0ustar00 Order allow,deny Deny from all