Esempio n. 1
0
	$data['chunks'] = array_chunk(explode(',', $data['users']), $data['batch']);

	$cache = new CacheItem('newsletter_'.$nid);
	$cache->set($data);
	$cache->export();

	echo head();
	ok('admin.php?action=members&job=newsletter3&id='.$nid, $lang->phrase('admin_member_mail_will_be_sent'));
}
elseif ($job == 'newsletter3') {
	$page = $gpc->get('page', int, 1);
	$id = $gpc->get('id', int);

	$cache = new CacheItem('newsletter_'.$id);
	$cache->import();
	$data = $cache->get();

	require_once("classes/mail/class.phpmailer.php");
	$mail = new PHPMailer();
	$mail->From = $data['from_mail'];
	$mail->FromName = $data['from_name'];
	$mail->Subject = $data['title'];
	if ($config['smtp'] == 1) {
		$mail->Mailer = "smtp";
		$mail->IsSMTP();
		$mail->Host = $config['smtp_host'];
		if ($config['smtp_auth'] == 1) {
			$mail->SMTPAuth = true;
			$mail->Username = $config['smtp_username'];
			$mail->Password = $config['smtp_password'];
		}
Esempio n. 2
0
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
($code = $plugins->load('popup_start')) ? eval($code) : null;
if ($_GET['action'] == "hlcode") {
    if (strlen($_GET['fid']) != 32) {
        echo $tpl->parse("popup/header");
        error($lang->phrase('query_string_error'), 'javascript:parent.close();');
    }
    $codeObj = new CacheItem($_GET['fid'], 'cache/geshicode/');
    if (!$codeObj->import()) {
        echo $tpl->parse("popup/header");
        error($lang->phrase('query_string_error'), 'javascript:parent.close();');
    }
    $sourcecode = $codeObj->get();
    $sourcecode['source'] = html_entity_decode($sourcecode['source'], ENT_QUOTES);
    ($code = $plugins->load('popup_hlcode_start')) ? eval($code) : null;
    if ($_GET['temp'] == 1) {
        viscacha_header('Content-Type: text/plain');
        viscacha_header('Content-Length: ' . strlen($sourcecode['source']));
        viscacha_header('Content-Disposition: attachment; filename="' . date('d-m-Y_H-i') . '.txt"');
        echo $sourcecode['source'];
        $slog->updatelogged();
        $db->close();
        exit;
    } else {
        require_once 'classes/class.geshi.php';
        $geshi = new GeSHi($sourcecode['source'], strtolower($sourcecode['language']), 'classes/geshi');
        $geshi->set_encoding($lang->phrase('charset'));
        // Use classes for colouring
function import_error_data($fid)
{
    $cache = new CacheItem($fid, 'temp/errordata/');
    $cache->import();
    $data = $cache->get();
    return $data;
}
Esempio n. 4
0
        ?>
</a></td>
		  </tr>
		 </table>
		<?php 
        echo foot();
    } else {
        error('admin.php?action=db&job=backup', $lang->phrase('admin_db_backup_missing_permissions'));
        $filesystem->unlink($tfile);
        $x->delete();
    }
} elseif ($job == 'backup4') {
    $name = $gpc->get('name', none);
    $x = new CacheItem('backup_' . $name);
    $x->import();
    $temp = $x->get();
    $x->delete();
    // Speichern der Backup-Datei
    $tfile = "admin/backup/{$name}.sql.tmp";
    $file = "admin/backup/{$name}.sql";
    $filesystem->rename($tfile, $file);
    $ok = $lang->phrase('admin_db_backup_successfully_created');
    if (!empty($temp['zip'])) {
        $zipfile = "admin/backup/{$name}.zip";
        require_once 'classes/class.zip.php';
        $archive = new PclZip($zipfile);
        $v_list = $archive->create($file, PCLZIP_OPT_REMOVE_PATH, dirname($file));
        if ($v_list == 0) {
            $ok = $lang->phrase('admin_db_zip_error_saved_txt') . '<br />' . $lang->phrase('admin_db_error') . ' ' . $archive->errorInfo(true);
        } else {
            $filesystem->unlink($file);
Esempio n. 5
0
 <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr> 
   <td class="obox"><b>Step 1 of <?php 
    echo $steps + 1;
    ?>
</b></td>
  </tr>
  <tr> 
   <td class="mbox">The datas have been saved<br>Now the mails will be sent in echelons.</td>
  </tr>
 </table>	
<?php 
    echo foot();
} elseif ($job == 'newsletter3') {
    $cache = new CacheItem('newsletter_session');
    $emails = $cache->get();
    $int2 = $gpc->get('int2', int, 100);
    $page = $gpc->get('page', int, 1);
    $anz = count($emails);
    $steps = ceil($anz / $int2);
    $result = $db->query('SELECT * FROM ' . $db->pre . 'newsletter WHERE id = ' . $gpc->get('id', int));
    $row = $db->fetch_assoc($result);
    $split = array_chunk($emails, $int2);
    $minus = $page - 1;
    $plus = $page + 1;
    $i = 0;
    if (!isset($split[$minus]) || !is_array($split[$minus])) {
        echo head();
        error('admin.php?action=members&job=newsletter', 'No e-mail address found for this echelon!');
    }
    foreach ($split[$minus] as $mail) {
Esempio n. 6
0
 /**
  * @covers Phossa\Cache\CacheItem::get
  */
 public function testGet()
 {
     $this->assertEquals(null, $this->object->get());
 }