forked from extern/egroupware
encryption of InfoLog entries (EPL only)
This commit is contained in:
parent
876db7ca1e
commit
ddbe8ccec3
@ -260,7 +260,12 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
|
||||
{
|
||||
// apply the ratio
|
||||
_height = (this.options.resize_ratio != '')? _height * this.options.resize_ratio: _height;
|
||||
if (_height != 0) this.input.height(this.input.height() + _height);
|
||||
if (_height != 0)
|
||||
{
|
||||
this.input.height(this.input.height() + _height);
|
||||
// resize parent too, so mailvelope injected into parent inherits its height
|
||||
this.input.parent().height(this.input.parent().height()+_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -63,6 +63,13 @@ app.classes.infolog = AppJS.extend(
|
||||
case 'infolog.edit.print':
|
||||
// Trigger print command if the infolog oppend for printing porpuse
|
||||
this.infolog_print_preview_onload();
|
||||
break;
|
||||
case 'infolog.edit':
|
||||
if (this.et2.getArrayMgr('content').data.info_des.indexOf(this.begin_pgp_message) != -1)
|
||||
{
|
||||
this.mailvelopeAvailable(this.toggleEncrypt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@ -238,7 +245,7 @@ app.classes.infolog = AppJS.extend(
|
||||
nm.dataview.getColumnMgr().columns[i].set_width(colData[i].width);
|
||||
nm.dataview.getColumnMgr().columns[i].set_visibility(!colData[i].disabled);
|
||||
}
|
||||
nm.dataview.getColumnMgr().updated = true;
|
||||
nm.dataview.getColumnMgr().updated = true;
|
||||
// Update page
|
||||
nm.dataview.updateColumns();
|
||||
}
|
||||
@ -489,11 +496,11 @@ app.classes.infolog = AppJS.extend(
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper so add -> New actions in the context menu can pass current
|
||||
* Wrapper so add -> New actions in the context menu can pass current
|
||||
* filter values into new edit dialog
|
||||
*
|
||||
*
|
||||
* @see add_with_extras
|
||||
*
|
||||
*
|
||||
* @param {egwAction} action
|
||||
* @param {egwActionObject[]} selected
|
||||
*/
|
||||
@ -610,5 +617,36 @@ app.classes.infolog = AppJS.extend(
|
||||
submit_if_not_empty: function(_node, _widget)
|
||||
{
|
||||
if (_widget.get_value()) this.et2._inst.submit();
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle encryption
|
||||
*
|
||||
* @param {jQuery.Event} _event
|
||||
* @param {et2_button} _widget
|
||||
* @param {DOMNode} _node
|
||||
*/
|
||||
toggleEncrypt: function(_event, _widget, _node)
|
||||
{
|
||||
if (!this.egw.user('apps').stylite)
|
||||
{
|
||||
this.egw.message(this.egw.lang('InfoLog encryption requires EPL Subscription')+': <a href="http://www.egroupware.org/EPL">www.egroupware.org/EPL</a>');
|
||||
return;
|
||||
}
|
||||
if (!app.stylite)
|
||||
{
|
||||
var self = this;
|
||||
egw_LAB.script('stylite/js/infolog-encryption.js').wait(function()
|
||||
{
|
||||
app.stylite = new app.classes.stylite;
|
||||
app.stylite.et2 = self.et2;
|
||||
app.stylite.toggleEncrypt.call(app.stylite, _event, _widget, _node);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
app.stylite.et2 = this.et2;
|
||||
app.stylite.toggleEncrypt.call(app.stylite, _event, _widget, _node);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -62,4 +62,13 @@ tr.dialogOperators td,.dialogFooterToolbar {
|
||||
/* Put line break for the first column*/
|
||||
#infolog-index .egwGridView_grid .et2_hbox.et2_box_widget.infolog_CompletedClmn {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
td.infologEncrypt {
|
||||
position: relative;
|
||||
}
|
||||
button#infolog-edit_encrypt {
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
top: 3px;
|
||||
}
|
@ -213,6 +213,9 @@
|
||||
<date-time statustext="til when should the ToDo or Phonecall be finished" id="info_enddate" class="et2_fullWidth" span="4"/>
|
||||
<description/>
|
||||
</row>
|
||||
<row class="et2_toolbar">
|
||||
<buttononly label="Encrypt" id="encrypt" span="all" class="infologEncrypt" background_image="1" image="lock" onclick="app.infolog.toggleEncrypt"/>
|
||||
</row>
|
||||
<row>
|
||||
<tabbox id="tabs" class="et2_nowrap" span="all" width="100%" tab_height="250px">
|
||||
<tabs>
|
||||
|
@ -4392,12 +4392,7 @@ app.classes.mail = AppJS.extend(
|
||||
* - compose encrypted messages (mailvelopeCompose, compose_submitAction)
|
||||
* - fix autosave and save as draft to store encrypted content (saveAsDraft)
|
||||
* - fix inline reply to encrypted message to clientside decrypt message and add signature (mailvelopeCompose)
|
||||
* @todo check recipients for key available and warn user if not
|
||||
* @todo lookup missing keys in addressbook, DANE DNS recored, maybe keyserver
|
||||
* @todo offer user to store his public key in accounts addressbook (ask admin to make it user-editable) and DANE
|
||||
*/
|
||||
begin_pgp_message: '-----BEGIN PGP MESSAGE-----',
|
||||
end_pgp_message: '-----END PGP MESSAGE-----',
|
||||
|
||||
/**
|
||||
* Called on load of preview or display iframe, if mailvelope is available
|
||||
@ -4561,8 +4556,8 @@ app.classes.mail = AppJS.extend(
|
||||
{
|
||||
// collect all recipients
|
||||
var recipients = this.et2.getWidgetById('to').get_value();
|
||||
recipients.concat(this.et2.getWidgetById('cc').get_value());
|
||||
recipients.concat(this.et2.getWidgetById('bcc').get_value());
|
||||
recipients = recipients.concat(this.et2.getWidgetById('cc').get_value());
|
||||
recipients = recipients.concat(this.et2.getWidgetById('bcc').get_value());
|
||||
|
||||
return this._super.call(this, recipients);
|
||||
},
|
||||
|
@ -2363,6 +2363,30 @@ abstract class egw_framework
|
||||
egw_json_response::get()->data($list);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get certain account-data of given account-id(s)
|
||||
*
|
||||
* @param string|array $_account_ids
|
||||
* @param string $_field ='account_email'
|
||||
* @param boolean $_resolve_groups =false true: return attribute for all members, false return attribute for group itself
|
||||
* @return array account_id => data pairs
|
||||
*/
|
||||
public static function ajax_account_data($_account_ids, $_field, $_resolve_groups=false)
|
||||
{
|
||||
$list = array();
|
||||
foreach((array)$_account_ids as $account_id)
|
||||
{
|
||||
foreach($account_id < 0 && $_resolve_groups ?
|
||||
$GLOBALS['egw']->accounts->members($account_id, true) : array($account_id) as $account_id)
|
||||
{
|
||||
$list[$account_id] = $GLOBALS['egw']->accounts->id2name($account_id, $_field);
|
||||
}
|
||||
}
|
||||
|
||||
egw_json_response::get()->data($list);
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
// Init all static variables
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 872 B |
@ -870,6 +870,12 @@ var AppJS = Class.extend(
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* PGP begin and end tags
|
||||
*/
|
||||
begin_pgp_message: '-----BEGIN PGP MESSAGE-----',
|
||||
end_pgp_message: '-----END PGP MESSAGE-----',
|
||||
|
||||
/**
|
||||
* Mailvelope "egroupware" Keyring
|
||||
*/
|
||||
|
@ -36,6 +36,13 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
|
||||
//owngroups: {}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clientside cache for accountData calls
|
||||
*/
|
||||
var accountData = {
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
/**
|
||||
* Set data of current user
|
||||
@ -110,6 +117,62 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
|
||||
return list;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get account-infos for given numerical _account_ids
|
||||
*
|
||||
* @param {int|array} _account_ids
|
||||
* @param {string} _field default 'account_email'
|
||||
* @param {boolean} _resolve_groups true: return attribute for all members, false: return attribute of group
|
||||
* @param {function} _callback
|
||||
* @param {object} _context
|
||||
*/
|
||||
accountData: function(_account_ids, _field, _resolve_groups, _callback, _context)
|
||||
{
|
||||
if (!_field) _field = 'account_email';
|
||||
if (!jQuery.isArray(_account_ids)) _account_ids = [_account_ids];
|
||||
|
||||
// check our cache or current user first
|
||||
var data = {};
|
||||
for(var i=0; i < _account_ids.length; ++i)
|
||||
{
|
||||
var account_id = _account_ids[i];
|
||||
|
||||
if (account_id == userData.account_id)
|
||||
{
|
||||
data[account_id] = userData[_field];
|
||||
}
|
||||
else if (typeof accountData[account_id] != 'undefined' && typeof accountData[account_id][_field] != 'undefined' &&
|
||||
(!_resolve_groups || account_id > 0)) // groups are only resolved on server for now
|
||||
{
|
||||
data[account_id] = accountData[account_id][_field];
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
_account_ids.splice(i--, 1);
|
||||
}
|
||||
|
||||
// something not found in cache --> ask server
|
||||
if (_account_ids.length)
|
||||
{
|
||||
egw.json('home.egw_framework.ajax_account_data.template',[_account_ids, _field, _resolve_groups],
|
||||
function(_data) {
|
||||
for(var account_id in _data)
|
||||
{
|
||||
if (typeof accountData[account_id] == 'undefined') accountData[account_id] = {};
|
||||
data[account_id] = accountData[account_id][_field] = _data[account_id];
|
||||
}
|
||||
_callback.call(_context, data);
|
||||
}
|
||||
).sendRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
_callback.call(_context, data);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate client-side account cache
|
||||
*
|
||||
@ -120,6 +183,14 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
|
||||
*/
|
||||
invalidate_account: function(_id, _type)
|
||||
{
|
||||
if (_id)
|
||||
{
|
||||
delete accountData[_id];
|
||||
}
|
||||
else
|
||||
{
|
||||
accountData = {};
|
||||
}
|
||||
if (jQuery.isEmptyObject(accountStore)) return;
|
||||
|
||||
switch(_type)
|
||||
|
Loading…
Reference in New Issue
Block a user