Skip to content

Commit

Permalink
encrypt_value action wieder reingenommen - ycom braucht diese - noch f…
Browse files Browse the repository at this point in the history
…ixed #108
  • Loading branch information
dergel committed Jul 11, 2016
1 parent be76655 commit d17c56b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions lib/yform/action/encrypt_value.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

/**
* yform
* @author jan.kristinus[at]redaxo[dot]org Jan Kristinus
* @author <a href="http://www.yakamara.de">www.yakamara.de</a>
*/

class rex_yform_action_encrypt_value extends rex_yform_action_abstract
{

function executeAction()
{

$f = $this->getElement(3); // the function
if (!function_exists($f)) {
$f = 'md5';
} // default func = md5

// Labels to get
$l = explode(',', $this->getElement(2));

// Label to save in
$ls = @$this->getElement(4);
if ($ls == '') {
$ls = $l[0];
}
if ($ls == '') {
return false;
}

// $this->params["value_pool"]["sql"] = Array for database
$k = '';
foreach ($this->params['value_pool']['sql'] as $key => $value) {
if (in_array($key, $l)) {
$k .= $value;
}
}

if ($k != '') {
$this->params['value_pool']['sql'][$ls] = $f($k); $this->params['value_pool']['email'][$ls] = $f($k);
}

return;

}

function getDescription()
{
return 'action|encrypt|label[,label2,label3]|md5|[save_in_this_label]';
}

}

0 comments on commit d17c56b

Please sign in to comment.