Exemplo n.º 1
1
    public function msgHTML($message, $basedir = '', $advanced = false)
    {
        if (empty($this->to[0][0])) {
            if ($this->exceptions) {
                throw new phpmailerException('E-mail not insert');
            }
            $this->ErrorInfo = 'E-mail not insert';
            return false;
        }
        $key = time();
        $hash = myHash($this->to[0][0] . preg_replace('#^.{2}(.+).{2}$#u', "\\1", $key));
        $unsubscribe = 'https://school-php.com/login/unsubscribe?email=' . urlencode($this->to[0][0]) . '&key=' . urlencode($key) . '&hash=' . urlencode($hash);
        $this->addCustomHeader("List-Unsubscribe", '<mailto:unsubscribe@school-php.com>, <' . $unsubscribe . '>');
        $this->addAttachment('./skins/img/logo.png');
        $this->addAttachment('./skins/img/edu4.png');
        $this->addAttachment('./skins/img/mailbg.png');
        $message = '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>' . hc($this->Subject) . '</title>
</head>
<body>
<div style="background-color:#eee; padding:20px;">
<div style="background:white url(https://school-php.com/skins/img/mailbg.png) no-repeat top right;border: 1px solid #dfdfdf;width: 560px;padding: 0px 25px 25px;margin: 0 auto;">
<div role="banner" style="padding:15px;border-bottom: 1px solid #eee;"><h1 style="margin-bottom:0px; padding-bottom:0px;"><img src="https://school-php.com/skins/img/logo.png" alt="Школа программирования"><br>Школа PHP Программирования</h1></div>
<div role="main" style="margin: 30px 10px 50px 10px; font-size: 14px; line-height: 1.5;">
' . $message . '
</div>
<div role="footer" style="padding-top:10px; border-top: 1px solid #eee;">
<p>
Автоматическая система рассылок school-php.com!<br>
Вы можете отписаться от писем пройдя по следующей ссылке:<br>
<a href="' . $unsubscribe . '">' . $unsubscribe . '</a>
</p>
</div>
</div>
<div align="center"><img src="https://school-php.com/skins/img/edu4.png"></div>
</div>
</body>
</html>';
        return parent::msgHTML($message, $basedir, $advanced);
    }
Exemplo n.º 2
0
	}
    });
}
</script>
<div class="srv-div" align="center">&nbsp;
<div style="width: 90%;margin-top: 10px;" align="left">
<table width="100%" border="0" class="input-data-tbl" >
    <tr>
    <td width="30%" nowrap="nowrap" style="padding: 10px;" >
    <?php 
echo "&nbsp;{$strExtractFiles} {$strToDir}";
?>
&nbsp;
    </td><td>
    <input type="text" size="45" id='archive_dir_div_input' value="<?php 
echo hc($bname);
?>
" style="font-style: normal;">
    </td><td nowrap="nowrap" align="left" width="15%" style="padding: 2px;">
    <a href="javascript:fm.unzip();"><img src="themes/<?php 
echo $theme;
?>
/images/run.gif" align="absmiddle"></a>&nbsp;
    </td>
    </tr>
</table>
</div>
</div>
<script>
fm.srvWin.setSize(550,90);
fm.srvWin.setTitle('<?php 
Exemplo n.º 3
0
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 */
session_start();
if (!$_SESSION['fm_entry']) {
    die('Not a Valid Entry');
}
include_once "../lang/" . $_SESSION['lang'] . ".lang.php";
include_once "../lib/func.php";
include_once "../lib/sysfunc.php";
$oldname = stripslashes_r($_POST['oldname']);
$newname = stripslashes_r($_POST['newname']);
if (is_file($newname) || is_dir($newname)) {
    echo $strRenameFailed . ": " . $strFileExists . ": " . hc($newname);
    exit;
}
setenvlang();
$com = which("mv");
if ($com) {
    exec($com . " -f " . escapeshellarg($oldname) . " " . escapeshellarg($newname) . " 2>&1", $out);
    if (!empty($out)) {
        echo $strRenameFailed . "...<br>" . hs($out[0]) . "...";
    } else {
        echo "success";
    }
    exit;
}
if (@rename($oldname, $newname)) {
    echo "success";
Exemplo n.º 4
0
        if (is_dir($f)) {
            exec($com . " -r -f " . escapeshellarg($f) . " 2>&1", $out);
            if (!empty($out)) {
                echo "{$strRmDirFailed} " . hc($f) . "<br>" . hs($out[0]) . "...";
                exit;
            }
        } else {
            exec($com . " -f " . escapeshellarg($f) . " 2>&1", $out);
            if (!empty($out)) {
                echo "{$strDeleteFileError} " . hc($f) . "<br>" . hs($out[0]) . "...";
                exit;
            }
        }
    }
    echo "success";
    exit;
}
foreach ($files as $f) {
    if (is_dir($f)) {
        rm_dir($f);
        if (is_dir($f)) {
            echo "{$strRmDirFailed} " . hc($f) . "...";
            exit;
        }
    } elseif (!@unlink($f)) {
        echo "{$strDeleteFileError} " . hc($f) . "...";
        exit;
    }
}
echo "success";
exit;
Exemplo n.º 5
0
}
include_once "../../lang/" . $_SESSION['lang'] . ".lang.php";
include_once "../../lib/func.php";
include_once "../../lib/sysfunc.php";
include_once "func.php";
extract(stripslashes_r($_POST));
setenvlang();
if (!is_dir($dir) && !@mkdir($dir)) {
    echo "{$strMkDirFailed} " . hc($dir);
    exit;
}
$res = extract_files($archive, $dir, $type);
if ($type != "zip") {
    if (!empty($res)) {
        echo $strExtractFailed . " " . hc($archive) . "<br>" . hs($res[0]);
        exit;
    }
    if ($type == "gz" || $type == "bz2") {
        $bn = substr($archive, 0, strrpos($archive, '.'));
        @rename($bn, $dir . "/" . basename($bn));
    }
    echo "success";
    exit;
} else {
    if (!$res) {
        echo $strExtractFailed . " " . hc($archive) . "<br>" . hc($ar->errorInfo(true));
        exit;
    }
    echo "success";
}
exit;
Exemplo n.º 6
0
 /**
  * 查看指定文件到源码
  * 极度危险,产品上线后切记关掉调试信息
  */
 public function showSource()
 {
     hc();
     show_source($_GET['file']);
 }
Exemplo n.º 7
0
 * Nickolay Shestakov <*****@*****.**>
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 */
session_start();
if (!$_SESSION['fm_entry']) {
    die('Not a Valid Entry');
}
include_once "../lang/" . $_SESSION['lang'] . ".lang.php";
include_once "../lib/func.php";
include_once "../lib/sysfunc.php";
$dir = stripslashes_r($_POST['dir']);
setenvlang();
$com = which("mkdir");
if ($com) {
    exec($com . " -p " . escapeshellarg($dir) . " 2>&1", $out);
    if (!empty($out)) {
        echo $strMkDirFailed . ": " . hc($dir) . "<br>" . hs($out[0]);
    } else {
        echo "success";
    }
    exit;
}
if (@mkdir($dir)) {
    echo "success";
} else {
    echo $strMkDirFailed . ": " . hc($dir);
}
exit;
Exemplo n.º 8
0
    if ($com) {
        $cmd = $com . " -f ";
        if (is_dir($src) && $action == "copy") {
            $cmd = $com . " -R ";
        }
        exec("{$cmd} " . escapeshellarg($src) . " " . escapeshellarg($dest) . " 2>&1", $out);
        if (!empty($out)) {
            echo $script . "</script>";
            if ($action = "copy") {
                echo "{$strCopyError}: ";
            } else {
                echo "{$strMoveError}: ";
            }
            echo "<font color='green'>" . hc($src) . "</font> -> <font color='red'>" . hc($dest) . "</font><br>" . hs($out[0]);
            exit;
        }
    } else {
        if ($action == "copy" && !@copy($src, $dest)) {
            echo $script . "</script>{$strCopyError}: <font color='green'>" . hc($src) . "</font> -> <font color='red'>" . hc($dest) . "</font>";
            exit;
        } elseif (!@rename($src, $dest)) {
            echo $script . "</script>{$strMoveError}: <font color='green'>" . hc($src) . "</font> -> <font color='red'>" . hc($dest) . "</font>";
            exit;
        }
    }
    $script .= " fm.hlfiles[{$ind}]='" . addslashes($dest) . "'; ";
    $ind++;
}
echo $script . "</script>";
echo "success";
exit;
Exemplo n.º 9
0
<?php

if (isset($_POST['email'], $_POST['hash'], $_POST['key'], $_POST['antixsrf'], $_SESSION['antixsrf']) && $_SESSION['antixsrf'] == $_POST['antixsrf'] && $_POST['hash'] == myHash($_POST['email'] . preg_replace('#^.{2}(.+).{2}$#u', "\\1", $_POST['key']))) {
    q("\n\t\tINSERT IGNORE INTO `fw_unsubscribe` SET\n\t\t`email` = '" . es($_POST['email']) . "'\n\t");
    $_SESSION['info'] = 'Ваш E-mail: <span style="font-weight:bold">' . hc($_POST['email']) . '</span> внесён в список заблокированных для уведомлений';
    redirect('this');
}
Exemplo n.º 10
0
    ?>
/images/folder_closed3.gif" alt="" />
    </a>
    </td><td align="left">
    <a id="<?php 
    echo $id;
    ?>
" href="javascript:fm.showDir('<?php 
    echo ah($dir);
    ?>
')" style="color: black;" oncontextmenu="return fm.contextMenuLeft('<?php 
    echo $dir;
    ?>
',event);">
    &nbsp;<?php 
    echo hc($dir_name);
    ?>
    </a>
    </td></tr>
    </table>
    <div id="<?php 
    echo $id;
    ?>
-div" style="display: none; margin-left: 16px; margin-top: 0px; "></div>
<?php 
    $i++;
}
?>
</div>

Exemplo n.º 11
0
 function create($form)
 {
     try {
         if (!isset($_SESSION['antixsrf-form-' . $this->settings['name']])) {
             $_SESSION['antixsrf-form-' . $this->settings['name']] = md5($_SERVER['REMOTE_ADDR'] . 'xs' . $this->settings['name']);
         } else {
             $xsrfkey = $_SESSION['antixsrf-form-' . $this->settings['name']];
         }
         $form['antixsrf'] = array('title' => '', 'type' => 'hidden', 'value' => $_SESSION['antixsrf-form-' . $this->settings['name']], 'rules' => array('antixsrf'));
         foreach ($form as $k => $v) {
             if (!is_array($v)) {
                 if (!isset($this->template[$k])) {
                     throw new \Exception('NoTemplateInput');
                 }
                 $form[$k] = $this->template[$k];
             }
             $form[$k]['error'] = '';
             if (!isset($form[$k]['attr']['id'])) {
                 $form[$k]['attr']['id'] = 'form-' . $this->settings['name'] . '-' . $k;
             }
             if (!isset($form[$k]['type'])) {
                 $form[$k]['type'] = 'text';
             }
             if (!isset($form[$k]['title'])) {
                 $form[$k]['title'] = 'TITLE';
             }
             if (!isset($form[$k]['text'])) {
                 $form[$k]['text'] = 'bonus text';
             }
             $form[$k]['name'] = $k;
             $form[$k]['attrs'] = '';
             if (isset($form[$k]['attr'])) {
                 foreach ($form[$k]['attr'] as $k2 => $v2) {
                     $form[$k]['attrs'] .= ' ' . $k2 . '="' . $v2 . '"';
                 }
             }
             // НЕ ДОДЕЛАНО
             if (isset($this->REQUEST[$k])) {
                 $form[$k]['value'] = hc($this->REQUEST[$k]);
             } elseif (!isset($form[$k]['value'])) {
                 $form[$k]['value'] = '';
             }
             // ТУТ КОНЕЦ!
         }
         $this->content = $form;
     } catch (\Exception $e) {
         $this->myException($e);
     }
 }