Ejemplo n.º 1
0
    $remember_find = (string) $_GET['remember_find'];
} else {
    $remember_find = '';
}
$external = $require_login && !is_a($GLOBALS['admin_auth'], 'phpListAdminAuthentication');
$start = isset($_GET['start']) ? sprintf('%d', $_GET['start']) : 0;
$listid = isset($_GET['id']) ? sprintf('%d', $_GET['id']) : 0;
$find = isset($_REQUEST['find']) ? $_REQUEST['find'] : '';
if (!empty($find)) {
    $remember_find = '&find=' . urlencode($find);
} else {
    $remember_find = '';
}
# with external admins we simply display information
if (!$external) {
    print PageLinkActionButton('admin', $GLOBALS['I18N']->get('Add new admin'), "start={$start}" . $remember_find);
    if (isset($_GET['delete']) && $_GET['delete']) {
        # delete the index in delete
        if ($_GET['delete'] == $_SESSION['logindetails']['id']) {
            print $GLOBALS['I18N']->get('You cannot delete yourself') . "\n";
        } else {
            print $GLOBALS['I18N']->get('Deleting') . " {$delete} ..\n";
            Sql_query(sprintf('delete from %s where id = %d', $GLOBALS['tables']['admin'], $_GET['delete']));
            Sql_query(sprintf('delete from %s where adminid = %d', $GLOBALS['tables']['admin_attribute'], $_GET['delete']));
            Sql_query(sprintf('delete from %s where adminid = %d', $GLOBALS['tables']['admin_task'], $_GET['delete']));
            print '..' . $GLOBALS['I18N']->get('Done') . "<br /><hr><br />\n";
            Redirect("admins&start={$start}");
        }
    }
    ob_end_flush();
    if (isset($add)) {
Ejemplo n.º 2
0
    $alldone = 0;
    $html .= $GLOBALS['img_cross'];
}
$html .= '</td></tr>';
$html .= '<tr><td>' . s('Create a subscribe page') . '</td>
<td>' . PageLink2('spage', s('Go there')) . '</td><td>';
$req = Sql_Query("select * from {$tables['subscribepage']}");
if (Sql_Affected_Rows()) {
    $html .= $GLOBALS['img_tick'];
} else {
    $alldone = 0;
    $html .= $GLOBALS['img_cross'];
}
$html .= '</td></tr>';
$html .= '<tr><td>' . s('Add some subscribers') . '</td>
<td>' . PageLink2('import', s('Go there')) . '</td><td>';
$req = Sql_Fetch_Row_Query("select count(*) from {$tables['user']}");
if ($req[0] > 2) {
    $html .= $GLOBALS['img_tick'];
} else {
    $alldone = 0;
    $html .= $GLOBALS['img_cross'];
}
$html .= '</td></tr>';
$html .= '</table>';
if ($alldone) {
    $html .= Info($GLOBALS['I18N']->get('Congratulations, phpList is set up, you are ready to start mailing'), 1) . '<br/>' . PageLinkActionButton('send', s('Start a message campaign'));
    unset($_SESSION['firstinstall']);
}
$panel = new UIPanel($GLOBALS['I18N']->get('configuration steps'), $html);
print $panel->display();
Ejemplo n.º 3
0
         while ($row = Sql_Fetch_Row($req)) {
             deleteMessage($row[0]);
         }
         $_SESSION['action_result'] = $GLOBALS['I18N']->get('All draft campaigns deleted');
         print Info($GLOBALS['I18N']->get('campaigns deleted'));
     } else {
         verifyCsrfGetToken();
         deleteMessage(sprintf('%d', $_GET['delete']));
         print Info($GLOBALS['I18N']->get('campaign deleted'));
         $_SESSION['action_result'] = $GLOBALS['I18N']->get('Campaign deleted');
     }
 }
 $req = Sql_Query(sprintf('select id,entered,subject,unix_timestamp(now()) - unix_timestamp(entered) as age from %s where status = "draft" %s order by entered desc', $GLOBALS['tables']['message'], $ownership));
 $numdraft = Sql_Num_Rows($req);
 if ($numdraft > 0 && !isset($_GET['id']) && !isset($_GET['new'])) {
     print '<p>' . PageLinkActionButton('send&amp;new=1', $I18N->get('start a new message'), '', '', s('Start a new campaign')) . '</p>';
     print '<p><h3>' . $I18N->get('Choose an existing draft message to work on') . '</h3></p><br/>';
     $ls = new WebblerListing($I18N->get('Draft messages'));
     $ls->noShader();
     while ($row = Sql_Fetch_Array($req)) {
         $element = '<!--' . $row['id'] . '-->' . $row['subject'];
         $ls->addElement($element, PageUrl2('send&amp;id=' . $row['id']));
         $ls->setClass($element, 'row1');
         #    $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&amp;id='.$row['id'],$I18N->get('edit')));
         $ls->addColumn($element, $I18N->get('entered'), $row['entered']);
         $ls->addColumn($element, $I18N->get('age'), secs2time($row['age']));
         $ls->addRow($element, '', '<a class="del" href="' . PageUrl2('send&amp;delete=' . $row['id']) . '" title="' . $I18N->get('del') . '">' . $I18N->get('del') . '</a>');
     }
     $ls->addButton($I18N->get('delete all'), PageUrl2('send&amp;delete=alldraft'));
     print $ls->display();
     return;
Ejemplo n.º 4
0
# remember last one listed
if (!isset($_GET['tab']) && !empty($_SESSION['lastmessagetype'])) {
    $_GET['tab'] = $_SESSION['lastmessagetype'];
} elseif (isset($_GET['tab'])) {
    $_SESSION['lastmessagetype'] = $_GET['tab'];
}
if (!isset($_SESSION['messagesortby'])) {
    $_SESSION['messagesortby'] = '';
}
if (isset($_POST['sortBy'])) {
    if (in_array($_POST['sortBy'], array_keys($messageSortOptions))) {
        $_SESSION['messagesortby'] = $_POST['sortBy'];
    }
}
print '<div class="actions"><div class="fright">';
print PageLinkActionButton('send&amp;new=1', $GLOBALS['I18N']->get('Start a new campaign'));
print '</div><div class="clear"></div></div>';
### Print tabs
$tabs = new WebblerTabs();
$tabs->addTab($GLOBALS['I18N']->get('sent'), PageUrl2('messages&amp;tab=sent'), 'sent');
$tabs->addTab($GLOBALS['I18N']->get('active'), PageUrl2('messages&amp;tab=active'), 'active');
$tabs->addTab($GLOBALS['I18N']->get('draft'), PageUrl2('messages&amp;tab=draft'), 'draft');
#$tabs->addTab($GLOBALS['I18N']->get("queued"),PageUrl2("messages&amp;tab=queued"));#
if (USE_PREPARE) {
    $tabs->addTab($GLOBALS['I18N']->get('static'), PageUrl2('messages&amp;tab=static'), 'static');
}
//obsolete, moved to rssmanager plugin
#if (ENABLE_RSS) {
#  $tabs->addTab("rss",PageUrl2("messages&amp;tab=rss"));
#}
if (!empty($_GET['tab'])) {
Ejemplo n.º 5
0
<?php

require_once dirname(__FILE__) . '/accesscheck.php';
$start = sprintf('%d', !empty($_GET['start']) ? $_GET['start'] : 0);
print PageLinkActionButton("admins", $GLOBALS['I18N']->get('List of Administrators'), "start={$start}");
require dirname(__FILE__) . "/structure.php";
$struct = $DBstruct["admin"];
$id = !empty($_REQUEST["id"]) ? sprintf('%d', $_REQUEST["id"]) : 0;
$find = isset($_REQUEST['find']) ? $_REQUEST['find'] : '';
$start = isset($_GET['start']) ? sprintf('%d', $_GET['start']) : 0;
echo "<hr /><br />";
$noaccess = 0;
$accesslevel = accessLevel("admin");
switch ($accesslevel) {
    case "owner":
        $id = $_SESSION["logindetails"]["id"];
        break;
    case "all":
        $subselect = "";
        break;
    case "none":
    default:
        $noaccess = 1;
}
if ($noaccess) {
    print Error($GLOBALS['I18N']->get('No Access'));
    return;
}
if (!empty($_POST["change"])) {
    if (!verifyToken()) {
        ## csrf check, should be added in more places