예제 #1
0
 public function mail()
 {
     if (jet_Post('action') == 'do_mailer') {
         error_reporting(0);
         $mail = new \PHPMailer();
         apply_config($mail, 'smtp');
         $mail->isSMTP();
         // Set mailer to use SMTP
         $mail->addAddress(jet_Post('to'), 'HELLO');
         // Add a recipient
         $mail->isHTML(true);
         // Set email format to HTML
         $mail->Subject = '这是一架邮件轰炸机!';
         $content = jet_Post('content');
         if (!$content) {
             $content = '这是一架邮件轰炸机!';
         }
         $mail->Body = $content;
         $mail->AltBody = strip_tags($content);
         if (!$mail->send()) {
             echo jet_JSON(array('message' => '错误: ' . $mail->ErrorInfo, 'has' => false));
         } else {
             echo jet_JSON(array('message' => "你的邮件已经发送给" . jet_Post('to') . ",内容是{$content}" . $mail->Username, 'has' => true));
         }
     } else {
         $this->render();
     }
 }
예제 #2
0
파일: MailAgent.php 프로젝트: Jaggle/JetPHP
 public static function send($receiver_mail, $receiver_name, $subject, $content, $from)
 {
     $mail = new PHPMailer();
     apply_config($mail, 'smtp');
     $mail->isSMTP();
     $mail->isHTML(true);
     $mail->Subject = $subject;
     $mail->Body = $content;
     $mail->addAddress($receiver_mail, $receiver_name);
     // Add a recipient
     if ($mail->send()) {
         return true;
     } else {
         return $mail->ErrorInfo;
     }
 }
예제 #3
0
function apply_iptables_hostapd()
{
    shell_exec("sudo sh /var/www/iptables_hostapd.sh");
}
function apply_iptables_tor()
{
    shell_exec("sudo sh /var/www/iptables_tor.sh");
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //only do this after post/after submit
    if ($update_status == "1") {
        //installation via git, does not touch /var/www at all, since working system should not be touched
        shell_exec("sudo sh /var/www/web-update.sh");
        $apply_nachricht = "F&uuml;hre Update durch.<br />Bitte in ein paar Minuten den zwiebel durch Stromunterbrechung neu starten";
    } elseif ($update_status != null) {
        $apply_status = apply_config();
        //is stripping input fiels!
    } else {
        $apply_nachricht = "Problem mit Update-Variable";
    }
}
//status message check
if ($apply_status != null) {
    //apply_status is only null if there was no post/submit
    if ($apply_status) {
        //apply was successful completely, shows the return value of apply_config
        $apply_nachricht = "Ihre Konfiguration ist &uuml;bernommen worden. Bitte starten Sie den zwiebel dann durch Stromunterbrechung neu.";
    }
    if (!$apply_status) {
        //apply unsuccesful
        $apply_nachricht = "Problem beim Anwenden Ihrer Konfiguration.";
예제 #4
0
파일: klms.php 프로젝트: BillTheBest/1.6.x
    exit;
}
if (isset($_POST["accept-eula"])) {
    accept_eula();
    exit;
}
if (isset($_GET["pattern-status"])) {
    pattern_status();
    exit;
}
if (isset($_POST["klms-reset-password"])) {
    reset_web_password();
    exit;
}
if (isset($_POST["apply-config"])) {
    apply_config();
    exit;
}
tabs();
function tabs()
{
    $sock = new sockets();
    $klmsReadLicense = $sock->GET_INFO("klmsReadLicense");
    if (!is_numeric($klmsReadLicense)) {
        $klmsReadLicense = 0;
    }
    if ($klmsReadLicense == 0) {
        start_license();
        exit;
    }
    $page = CurrentPageName();
예제 #5
0
파일: init.php 프로젝트: Jaggle/JetPHP
require_once JET . '/common/functions.php';
require_once CONFIG . '/const.config.php';
require JET . '/vendor/autoload.php';
//自动加载第三方类库
switch (jet_Config('template_engine')) {
    case 'twig':
        $loader = new Twig_Loader_Filesystem(VIEW);
        $TE = new Twig_Environment($loader);
        break;
    case 'smarty':
        $TE = new Smarty();
        apply_config($TE, 'smarty');
        break;
    default:
        $TE = new Smarty();
        apply_config($TE, 'smarty');
}
function autoload($class)
{
    $_list = explode('\\', $class);
    //当前类的组织有
    //  Jet/Core
    //  Jet/Agent
    //  Jet/Controller
    //在此版本中,$_list[0] == 'Jet;
    switch ($_list[1]) {
        case 'Agent':
            file_exists(JET . "/agent/" . $_list[2] . '.php') && (require_once JET . "/agent/" . $_list[2] . '.php');
            break;
        case 'Core':
            file_exists(JET . "/core/" . $_list[2] . '.class.php') && (require_once JET . "/core/" . $_list[2] . '.class.php');