Пример #1
0
        $newsletter->set_recipients(get_post_var('msg_recips'));
    }
    if (is_post_var('msg_subject')) {
        $newsletter->set_subject(get_post_var('msg_subject'));
    }
    if (is_post_var('msg_html')) {
        $newsletter->set_html(get_post_var('msg_html'));
    }
    if (is_post_var('msg_text')) {
        $newsletter->set_text(get_post_var('msg_text'));
    } else {
        $newsletter->generate_text();
    }
}
// Take recipient list from querystring if none specified thus far
if ($newsletter->get_recipients() == '' && is_get_var('list')) {
    foreach ($lists as $list) {
        $list_id = (int) get_get_var('list');
        if ($list->get_id() == $list_id) {
            $newsletter->set_recipients($list->get_name());
            break;
        }
    }
}
// Preview the newsletter
$preview_mode = is_post_var('preview_submit');
// Send the newsletter
if (is_post_var('send_submit')) {
    // Saves newsletter to outbox
    if ($newsletter->send_prepare()) {
        $mailer = new gu_mailer();
Пример #2
0
 * @copyright This source is distributed under the GPL
 * @file included login page
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
gu_theme_messages();
?>

<p>&nbsp;</p>
<div style="text-align: center">
	<form name="login_form" method="post" action="login.php?action=login<?php 
echo is_get_var('ref') ? '&amp;ref=' . urlencode(get_get_var('ref')) : '';
?>
" onsubmit="return loginSubmit(this);">
		<p><?php 
echo t('Username');
?>
<br/><input name="u" type="text" class="textfield" id="u" value="<?php 
echo $name;
?>
" /><br/>
		<?php 
echo t('Password');
?>
<br/><input type="hidden" id="p" name="p" /><input name="dummy_p" type="password" class="textfield" id="dummy_p" />
		</p>
		<p>
Пример #3
0
    } elseif (strpos($var, 'subscribe_list') !== FALSE) {
        $posted_lists = is_array($val) ? $val : ((int) $val != 0 ? array((int) $val) : array());
    } elseif (strpos($var, 'unsubscribe_submit') !== FALSE) {
        $posted_action = 'unsubscribe';
    } elseif (strpos($var, 'subscribe_submit') !== FALSE) {
        $posted_action = 'subscribe';
    }
}
// Check if we've got what we need to do a posted (un)subscription
if ($posted_action != '' && $posted_address != '' && count($posted_lists) > 0) {
    gu_subscription_process($posted_address, $posted_lists, $posted_action == 'subscribe');
}
// Get querystring variables
$list_id = is_get_var('list') ? (int) get_get_var('list') : 0;
$address = is_get_var('addr') ? get_get_var('addr') : '';
$action = is_get_var('action') ? get_get_var('action') : '';
// Check if we've got what we need to do a querystring (un)subscription
if ($list_id > 0 && $address != '' && $action != '') {
    $list_ids = array($list_id);
    gu_subscription_process($address, $list_ids, $subscribe == 'subscribe');
}
// Check to see if a single valid list was specified
if ($list_id > 0 || count($posted_lists) == 1) {
    if ($list_id == 0) {
        $list_id = $posted_lists[0];
    }
    $list = gu_list::get($list_id, FALSE);
} else {
    // Load all non-private lists
    $lists = gu_list::get_all(FALSE, FALSE);
}
Пример #4
0
        $name = '';
        gu_error(t('Incorrect username or password'));
    }
} elseif (is_get_var('action') && get_get_var('action') == 'login') {
    $username = is_post_var('u') ? get_post_var('u') : '';
    $password = is_post_var('p') ? get_post_var('p') : '';
    $remember = is_post_var('login_remember');
    if (gu_session_authenticate($username, $password, $remember)) {
        // Redirect to page that referred here - or to the home page
        $redirect = is_get_var('ref') ? urldecode(get_get_var('ref')) : absolute_url('index.php');
        header('Location: ' . $redirect);
        exit;
    } else {
        gu_error(t('Incorrect username or password'));
    }
} elseif (is_get_var('action') && get_get_var('action') == 'logout') {
    // Invalidate session flag
    gu_session_set_valid(FALSE);
}
gu_theme_start();
?>

<script type="text/javascript">
/* <![CDATA[ */
function loginSubmit(form)
{
	// MD5 encrypt the password and store in hidden field
    form.p.value = hex_md5(form.dummy_p.value);
	
	// Replace the visible password field with Xs
	var mask = 'X';
Пример #5
0
 * @project Gutuma Newsletter Managment
 * @author Rowan Seymour
 * @copyright This source is distributed under the GPL
 * @file Default theme main stylesheet
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include_once '../inc/gutuma.php';
// Initialize Gutuma without validation or housekeeping
gu_init(FALSE, FALSE, FALSE);
header('Content-Type: application/x-javascript');
if (!is_get_var('noajax')) {
    ?>
/** 
 * This file is a server-side merge of tw-sack.js and gadgets.js.php
 * 
 * ------------------------------ tw-sack.js -------------------------------
 */
 
<?php 
    echo file_get_contents('tw-sack.js');
    ?>

/** 
 * ----------------------------- gadgets.js.php ------------------------------
 */
<?php 
Пример #6
0
 * @copyright This source is distributed under the GPL
 * @file The list editing page
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include_once 'inc/gutuma.php';
gu_init();
gu_theme_start();
// Get id of list to edit from querystring
$list_id = is_get_var('list') ? (int) get_get_var('list') : 0;
$start = is_get_var('start') ? (int) get_get_var('start') : 0;
$filter = is_get_var('filter') ? get_get_var('filter') : '';
// Load list data
$list = gu_list::get($list_id, TRUE);
// Make updates
if (is_post_var('list_update')) {
    $list->set_name(get_post_var('list_name'));
    $list->set_private(is_post_var('list_private'));
    if ($list->update()) {
        gu_success(t('List updated'));
    }
} elseif (is_post_var('new_address')) {
    $address = trim(get_post_var('new_address'));
    if ($list->add($address, TRUE)) {
        gu_success(t('Address <b><i>%</i></b> added to list', array($address)));
    }
}
Пример #7
0
 * @file The settings page
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include_once 'inc/gutuma.php';
include_once 'inc/mailer.php';
if ($_SESSION['profil'] != PROFIL_ADMIN) {
    header('Location:compose.php');
    exit;
}
gu_init();
$section = is_get_var('section') ? get_get_var('section') : 'general';
$section_titles['general'] = t("General settings");
$section_titles['transport'] = t("Transport settings");
$section_titles['messages'] = t("Message settings");
// Save settings
if (is_post_var('save_settings')) {
    if ($section == 'general') {
        gu_config::set('collective_name', get_post_var('collective_name'));
        gu_config::set('application_name', get_post_var('application_name'));
        gu_config::set('admin_name', get_post_var('admin_name'));
        gu_config::set('admin_email', get_post_var('admin_email'));
        gu_config::set('theme_name', get_post_var('theme_name'));
        /*gu_config::set('admin_username', get_post_var('admin_username'));
        		$pass1 = get_post_var('admin_password');
        		$pass2 = get_post_var('admin_password_retype');
        		if ($pass1 != '') {
Пример #8
0
 * @author	Cyril MAGUIRE
*/
include_once 'inc/gutuma.php';
include_once 'inc/newsletter.php';
include_once 'inc/mailer.php';
gu_init();
if (is_get_var('send')) {
    $newsletter = gu_newsletter::get((int) get_get_var('send'));
    if ($newsletter !== FALSE) {
        $mailer = new gu_mailer();
        if ($mailer->init()) {
            $newsletter->send_batch($mailer);
        }
    }
}
$box = is_get_var('box') ? get_get_var('box') : 'drafts';
$mailbox = gu_newsletter::get_mailbox();
$newsletters = $mailbox[$box];
gu_theme_start();
?>
<script type="text/javascript">
/* <![CDATA[ */
	function gu_newsletter_draft_menu(id)
	{
		return '<a href="compose.php?msg=' + id + '" class="imglink" title="<?php 
echo t('Edit and send');
?>
"><img src="themes/<?php 
echo gu_config::get('theme_name');
?>
/images/icon_mail.png" /></a>&nbsp;&nbsp;'  
Пример #9
0
/**
 * Checks to see if Gutuma is running in debugging mode
 * @return bool TRUE if Gutuma is running in demo mode, else FALSE
 */
function gu_is_debugging()
{
    return is_get_var('DEBUG') && gu_session_is_valid();
}