File: forward.php

package info (click to toggle)
ingo1 1.0.1-1sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,368 kB
  • ctags: 921
  • sloc: php: 4,030; xml: 1,182; makefile: 63
file content (50 lines) | stat: -rw-r--r-- 1,719 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
 * $Horde: ingo/forward.php,v 1.11.8.1 2005/01/03 12:25:37 jan Exp $
 *
 * Copyright 2003-2005 Todd Merritt <tmerritt@email.arizona.edu>
 *
 * See the enclosed file LICENSE for license information. If you
 * did not receive this file, see http://www.horde.org/licenses.
 */

@define('INGO_BASE',  dirname(__FILE__));
require_once INGO_BASE . '/lib/base.php';

/* Redirect if forward is not available. */
if (!in_array(INGO_STORAGE_ACTION_FORWARD, $_SESSION['ingo']['script_categories'])) {
    $notification->push(_("Forward is not supported in the current filtering driver."), 'horde.error');
    header('Location: ' . Horde::applicationUrl('filters.php', true));
    exit;
}

/* Get the forward object. */
$forward = $ingo_storage->retrieve(INGO_STORAGE_ACTION_FORWARD);

/* Perform requested actions. */
$actionID = Util::getFormData('actionID');
switch ($actionID) {
case 'update':
    $forward->setForwardAddresses(Util::getFormData('addresses'));
    $forward->setForwardKeep((intval(Util::getFormData('keep_copy')) == 1));
    if (!$ingo_storage->store($forward)) {
        $notification->push("Error saving changes.", 'horde.error');
    } else {
        $notification->push(_("Changes saved."), 'horde.success');
    }

    if ($prefs->getValue('auto_update')) {
        Ingo::updateScript();
    }
    break;
}

/* Get the forward rule. */
$filters = $ingo_storage->retrieve(INGO_STORAGE_ACTION_FILTERS);
$fwd_rule = $filters->findRule(INGO_STORAGE_ACTION_FORWARD);

$title = _("Forwards Edit");
require INGO_TEMPLATES . '/common-header.inc';
require INGO_TEMPLATES . '/menu.inc';
require INGO_TEMPLATES . '/forward/forward.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';