1 | <?php
|
---|
2 |
|
---|
3 | class PageNetworkAdministration extends Page
|
---|
4 | {
|
---|
5 | function __construct()
|
---|
6 | {
|
---|
7 | parent::__construct();
|
---|
8 | $this->FullTitle = 'Administrace sítě';
|
---|
9 | $this->ShortTitle = 'Administrace sítě';
|
---|
10 | $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'sprava');
|
---|
11 | }
|
---|
12 |
|
---|
13 | function Show()
|
---|
14 | {
|
---|
15 | if(!$this->System->Modules['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění');
|
---|
16 | $Output = '';
|
---|
17 | if(array_key_exists('Action', $_GET))
|
---|
18 | {
|
---|
19 | if($_GET['Action'] == 'SendEmail')
|
---|
20 | {
|
---|
21 | $Form = new Form('Email');
|
---|
22 | $Form->OnSubmit = '?Action=SendEmail2';
|
---|
23 | $Output = $Form->ShowEditForm();
|
---|
24 | } else
|
---|
25 | if($_GET['Action'] == 'SendEmail2')
|
---|
26 | {
|
---|
27 | $Form = new Form('Email');
|
---|
28 | $Form->LoadValuesFromForm();
|
---|
29 | $Result = $this->System->AddEmailToQueue($Form->Values['Address'],
|
---|
30 | $Form->Values['Subject'], $Form->Values['Content'],
|
---|
31 | $this->System->Config['Web']['Admin'].' <'.$this->System->Config['Web']['AdminEmail'].'>');
|
---|
32 | $Output = $this->SystemMessage('Vložení emailu', 'Nový email byl vložen do fronty');
|
---|
33 | }
|
---|
34 | if($_GET['Action'] == 'ProcessEmailQueue')
|
---|
35 | {
|
---|
36 | $Output = $this->System->ProcessEmailQueue();
|
---|
37 | $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output;
|
---|
38 | }
|
---|
39 | } else
|
---|
40 | $Output =
|
---|
41 | //'<a href="'.$this->System->Config['Web']['RootFolder'].'/network/dostupnost.php">Dostupnost sítě</a><br />'.
|
---|
42 | '<a href="?Action=SendEmail">Zaslat email</a><br />'.
|
---|
43 | '<a href="?Action=ProcessEmailQueue">Zpracovat frontu emailů</a><br />';
|
---|
44 | return($Output);
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | ?>
|
---|