1: <?php
2: /**
3: * Copyright 2012-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2012-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * Defines AJAX actions used for unblocking images in HTML messages.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2012-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Ajax_Application_Handler_ImageUnblock extends Horde_Core_Ajax_Application_Handler
24: {
25: /**
26: * AJAX action: Store e-mail sender of message in safe address list.
27: *
28: * Requires mailbox/indices form input.
29: *
30: * @return boolean True.
31: */
32: public function imageUnblockAdd()
33: {
34: global $injector, $notification;
35:
36: $address = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices_Mailbox($this->vars))->getHeader()->getOb('from')->bare_addresses[0];
37:
38: if ($injector->getInstance('IMP_Prefs_Special_ImageReplacement')->addSafeAddrList($address)) {
39: $notification->push(sprintf(_("Always showing images in messages sent by %s."), $address), 'horde.success');
40: }
41:
42: return true;
43: }
44:
45: }
46: