AAAAcustom_serverside_validation.ctp000066600000004426151401173420013243 0ustar00
Custom Server Side Validation
Header(array('settings' => 'Settings', 'help' => 'Help'), 'custom_serverside_validation_config_{n}'); ?> tabStart('settings'); ?> input('action_custom_serverside_validation_{n}_content1_config', array('type' => 'textarea', 'label' => "Code", 'rows' => 20, 'cols' => 70, 'smalldesc' => 'Returning "boolean" false will fail, anything else or no return at all will lead to success.')); ?> tabEnd(); ?> tabStart('help'); ?>

tabEnd(); ?>
.htaccess000066600000000177151401173420006351 0ustar00 Order allow,deny Deny from all custom_serverside_validation.php000066600000001747151401173420013247 0ustar00 0, 'fail' => 0); var $group = array('id' => '1_validation', 'title' => 'Validation'); var $details = array('title' => 'Custom Server Side Validation', 'tooltip' => 'Run PHP code and switch the execution path based on the result.'); function run($form, $actiondata){ $code = $actiondata->content1; $return = eval('?>'.$code); if($return === false){ $this->events['fail'] = 1; }else{ $this->events['success'] = 1; } } function load($clear){ if($clear){ $action_params = array( 'content1' => '' ); } return array('action_params' => $action_params); } } ?>index.html000066600000000035151401173420006541 0ustar00