Is the path relative to the drupal root? Might be nice to add to the field description text.

Need some changes for private:// and public://

Comments

lee20’s picture

Status: Active » Postponed (maintainer needs more info)

path to which file? Please clarify your question :)

gg4’s picture

Sorry. Should have said "Path To Keyfile " in admin/settings/aes.

gg4’s picture

Status: Postponed (maintainer needs more info) » Active
dpovshed’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

You may use both relative and absolute path. To use absolute you need it to be enabled in PHP settings.

In Drupal 7 you may even use constructions like private://... or public://...

Module assumed moderate Drupal/OS admin skills so it is obvious for most users.

2ndmile’s picture

This is important to anyone using Pantheon or another cloud hosting solution. dpovshed, you should not assume the skill level of user installing this module as it is a recommended/required module for other modules such as Commerce UPS. Not criticizing, just FYI.

dpovshed’s picture

Thank you 2ndmile to pointing my attention to this, will keep this in mind!

ecj’s picture

Issue summary: View changes

To use private:// or public:// the following fixes are needed:

diff aes.admin.inc*
33c33
< if (file_exists(variable_get("aes_key_path", "")) && is_writable(drupal_realpath(variable_get("aes_key_path", ""))) == FALSE && variable_get("aes_key_storage_method", "Database") == "File") {
---
> if (file_exists(variable_get("aes_key_path", "")) && is_writable(variable_get("aes_key_path", "")) == FALSE && variable_get("aes_key_storage_method", "Database") == "File") {
182c182
< $fp = @fopen(drupal_realpath($form_state['values']['aes_key_path']), "a");
---
> $fp = @fopen($form_state['values']['aes_key_path'], "a");

and the .module:

diff aes.module*
344c344
< $key = file_get_contents(drupal_realpath(variable_get("aes_key_path", "")));
---
> $key = file_get_contents(variable_get("aes_key_path", ""));
376c376
< $fp = fopen(drupal_realpath(variable_get("aes_key_path", "")), "w");
---
> $fp = fopen(variable_get("aes_key_path", ""), "w");
378c378
< drupal_set_message(t("Couldn't write key to file '" . drupal_realpath(variable_get("aes_key_path", "")))."'", "error");
---
> drupal_set_message(t("Couldn't write key to file " . variable_get("aes_key_path", "")), "error");
397c397
< $result = unlink(drupal_realpath(variable_get("aes_key_path", "")));
---
> $result = unlink(variable_get("aes_key_path", ""));