"Fossies" - the Fresh Open Source Software Archive 
Member "openmailadmin-1.0.1/addresses.php" (31 May 2007, 1894 Bytes) of package /linux/privat/old/openmailadmin-1.0.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "addresses.php" see the
Fossies "Dox" file reference documentation.
1 <?php
2 include('./inc/_prepend.php');
3 include('./inc/panel_filter.php');
4
5 $oma->current_user->domain_set = $oma->get_domain_set($oma->current_user->mbox, $oma->current_user->domains);
6 $oma->current_user->used_alias = $oma->user_get_used_alias($oma->current_user->mbox);
7
8 // PERFORM ACTION
9 if(isset($_POST['frm']) && $_POST['frm'] == 'virtual') {
10 if(!isset($_POST['action'])) {
11 error(txt('112'));
12 } else {
13 if($_POST['action'] == 'new' || $_POST['action'] == 'dest') {
14 // Set at least one valid destination.
15 if(isset($_POST['dest_is_mbox']) && $_POST['dest_is_mbox'] == '1') {
16 $destination = array($oma->current_user->mbox);
17 } else {
18 $destination = $oma->get_valid_destinations($_POST['dest']);
19 if(count($destination) < 1) {
20 $destination = array($oma->current_user->mbox);
21 error(txt('10'));
22 }
23 }
24 }
25 // We need addresses as parameters for every action except the creation of new addresses.
26 if($_POST['action'] != 'new' && (!isset($_POST['address']) || !is_array($_POST['address']))) {
27 error(txt('11'));
28 } else {
29 switch($_POST['action']) {
30 case 'new':
31 $oma->address_create(trim($_POST['alias']), $_POST['domain'], $destination);
32 break;
33 case 'delete':
34 $oma->address_delete($_POST['address']);
35 break;
36 case 'dest':
37 $oma->address_change_destination($_POST['address'], $destination);
38 break;
39 case 'active':
40 $oma->address_toggle_active($_POST['address']);
41 break;
42 }
43 unset($destination);
44
45 if($ErrorHandler->errors_occured()) {
46 error($ErrorHandler->errors_get());
47 }
48 if($ErrorHandler->info_occured()) {
49 info($ErrorHandler->info_get());
50 }
51 }
52 }
53 }
54
55 // DATA
56 $alias = $oma->get_addresses();
57
58 // DISPLAY
59 include('./templates/'.$cfg['theme'].'/addresses/list.tpl');
60
61 // ADMIN PANEL
62 include('./templates/'.$cfg['theme'].'/addresses/admin.tpl');
63
64 include('./inc/_append.php');
65 ?>