This commit is contained in:
Andreas Knuth 2026-01-23 16:41:44 -06:00
parent 8a04151bd2
commit 7e5ceae907
3 changed files with 23 additions and 3 deletions

View File

@ -8,4 +8,4 @@
"php": ">=7.0.0",
"roundcube/plugin-installer": ">=0.1.3"
}
}
}

View File

@ -0,0 +1,20 @@
/**
* Email Configuration Plugin - Client Side
*/
if (window.rcmail) {
rcmail.addEventListener('init', function(evt) {
rcmail.register_command('email_config_open', function() {
rcmail.http_post('plugin.email_config_generate_url', {},
rcmail.set_busy(true, 'loading'));
}, true);
});
rcmail.addEventListener('responseafterplugin.email_config_generate_url', function(response) {
rcmail.set_busy(false);
if (response && response.url) {
window.open(response.url, '_blank');
} else {
rcmail.display_message('Failed to generate configuration URL', 'error');
}
});
}

View File

@ -34,7 +34,7 @@ class email_config extends rcube_plugin
$rcmail = rcube::get_instance();
$email = $rcmail->user->get_username();
$secret_key = 'SHARED_SECRET_KEY_987654321';
$config_url = 'http://localhost:3008';
$config_url = 'https://config.email-bayarea.com';
$expires = time() + 3600;
$data = $email . '|' . $expires;
$signature = hash_hmac('sha256', $data, $secret_key);
@ -72,4 +72,4 @@ class email_config extends rcube_plugin
return $out;
}
}
}