updates
This commit is contained in:
parent
8a04151bd2
commit
7e5ceae907
|
|
@ -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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ class email_config extends rcube_plugin
|
||||||
$rcmail = rcube::get_instance();
|
$rcmail = rcube::get_instance();
|
||||||
$email = $rcmail->user->get_username();
|
$email = $rcmail->user->get_username();
|
||||||
$secret_key = 'SHARED_SECRET_KEY_987654321';
|
$secret_key = 'SHARED_SECRET_KEY_987654321';
|
||||||
$config_url = 'http://localhost:3008';
|
$config_url = 'https://config.email-bayarea.com';
|
||||||
$expires = time() + 3600;
|
$expires = time() + 3600;
|
||||||
$data = $email . '|' . $expires;
|
$data = $email . '|' . $expires;
|
||||||
$signature = hash_hmac('sha256', $data, $secret_key);
|
$signature = hash_hmac('sha256', $data, $secret_key);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue