-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encrypt_value action wieder reingenommen - ycom braucht diese - noch f…
…ixed #108
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 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 |
---|---|---|
@@ -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]'; | ||
} | ||
|
||
} |