Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
webform_encrypt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
webform_encrypt
Commits
7f770565
Commit
7f770565
authored
Jul 28, 2012
by
Jake Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding uninstall hook to decrypt data.
parent
07c03a11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
webform_encrypt.install
webform_encrypt.install
+24
-0
No files found.
webform_encrypt.install
View file @
7f770565
...
...
@@ -6,9 +6,33 @@
* module.
*/
/**
* Implementation of hook_disable().
*/
function
webform_encrypt_disable
()
{
drupal_set_message
(
t
(
'Webform Encrypt has been disabled. However, all submitted data is still encrypted. Please !link to decrypt all data.'
,
array
(
'!link'
=>
l
(
t
(
'uninstall the module'
),
'admin/modules/uninstall'
),
)));
}
/**
* Implementation of hook_uninstall().
*/
function
webform_encrypt_uninstall
()
{
variable_del
(
'webform_encrypt_match_user'
);
// Decrypt all encrypted form values.
$components
=
array
();
$query
=
db_query
(
'SELECT nid, cid, extra FROM {webform_component}'
);
while
(
$row
=
db_fetch_object
(
$query
))
{
$components
[
$row
->
nid
.
':'
.
$row
->
cid
]
=
unserialize
(
$row
->
extra
);
}
$query
=
db_query
(
'SELECT nid, sid, cid, no, data FROM {webform_submitted_data}'
);
while
(
$row
=
db_fetch_object
(
$query
))
{
$key
=
$row
->
nid
.
':'
.
$row
->
cid
;
if
(
!
empty
(
$components
[
$key
][
'encrypt'
])
&&
is_array
(
@
unserialize
(
$row
->
data
)))
{
$row
->
data
=
decrypt
(
$row
->
data
,
array
(
'base64'
=>
TRUE
));
drupal_write_record
(
'webform_submitted_data'
,
$row
,
array
(
'nid'
,
'sid'
,
'cid'
,
'no'
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment