summaryrefslogtreecommitdiffstats
path: root/modules-available/support/page.inc.php
blob: 5ad7854ff502445f457a687a85bd5d2582b282da (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php

class Page_Support extends Page
{

	protected function doPreprocess(){
		User::load();
		if (!User::hasPermission('superadmin')) {
			Message::addError('main.no-permission');
			Util::redirect('?do=Main');
        }
        error_reporting(E_ALL);
        ini_set('display_errors','on');

        Session::get('token');


        //THIS IS NOT WORKING
        //Cant connect to ANY smtp server
        /*
        if (strpos($_SERVER['REQUEST_URI'], "action=send") !== false){
            require '/var/www/slx-admin/phpmailer/PHPMailerAutoload.php';

            $mail = new PHPMailer;
            $mail->SMTPDebug = 3;                               // Enable verbose debug output         
            $mail->isSMTP();                                      // Set mailer to use SMTP
            $mail->Host = 'mx.c3sl.ufpr.br';  // Specify main and backup SMTP servers
            $mail->SMTPAuth = true;                               // Enable SMTP authentication
            $mail->Username = 'xxx00@inf.ufpr.br';                 // SMTP username
            $mail->Password = '';                           // SMTP password
         // $mail->SMTPSecure = 'false';                            // Enable TLS encryption, `ssl` also accepted
            $mail->Port = 25;                                    // TCP port to connect to
            
            $mail->From = 'xxx00@inf.ufpr.br';
            $mail->FromName = 'Someone';
            $mail->addAddress('receiver@email.com', 'Another One');     // Add a recipient        
           // $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
           // $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
            $mail->isHTML(true);                                  // Set email format to HTML
            $mail->Subject = 'Here is the subject';
            $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
            $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
            
            if(!$mail->send()) {
                echo 'Message could not be sent.';
                echo 'Mailer Error: ' . $mail->ErrorInfo;
            } else {
                echo 'Message has been sent';
            } 
            */
//            $uploaddir = '/var/www/uploads/';
//            $uploadfile = $uploaddir . basename($_FILES['inp_file']['name']);
//            if(move_uploaded_file($_FILES['inp_file']['tmp_name'], $uploadfile))
//                Message::addSuccess('news-save-success');
//            else
//                Message::addError('news-empty');
//            mail($to,$_POST[assuntoEmail],$_POST[conteudoEmail],"-r".$from);
//            mail($to,$assunto,$content,$headers); 
         
   
        }
        


    protected function doRender(){
        error_reporting(E_ALL);
        ini_set('display_errors','on');
		if (strpos($_SERVER['REQUEST_URI'], "true") !== false){
            Render::addTemplate('page-faq',
                json_decode(file_get_contents("modules/support/faq.json"),true)
            );
        }
        else{
            Render::addTemplate('page-support',
                json_decode(file_get_contents("modules/support/faq.json"),true)
            );
        }
//        Render::addTemplate('page-support', array(
//            'token' => Session:get('token'));
	}


}