Example #1
0
function addUserForm ($listid) {
  $html = formStart().'<input type=hidden name=listid value="'.$listid.'">
  Add a user: <input type=text name=new value="" size=40><input type=submit
 name=add value="Add">
  </form>';
  return $html;
}
Example #2
0
function prepareOutput() {
	global $outputdone;
	if (!$outputdone) {
		$outputdone = 1;
		return formStart('name="outputform"').'<textarea name="output" rows=20 cols=50></textarea></form>';
	}
}
Example #3
0
function prepareOutput()
{
    global $outputdone;
    if (!$outputdone) {
        $outputdone = 1;
        return formStart('name="outputform" class="readtestmailOutput" ') . '<textarea name="output" rows=10 cols=70></textarea></form>';
    }
}
Example #4
0
function addUserForm($listid)
{
    //nizar 'value'
    $html = formStart() . '<input type=hidden name=listid value="' . $listid . '">
  ' . $GLOBALS['I18N']->get("Add a user") . ': <input type=text name=new value="" size=40><input type=submit
 name=add value="' . $GLOBALS['I18N']->get('Add') . '">
  </form>';
    return $html;
}
Example #5
0
function addUserForm($listid)
{
    //nizar 'value'
    $html = formStart(' class="membersAdd" ') . '<input type="hidden" name="listid" value="' . $listid . '" />
  ' . $GLOBALS['I18N']->get("Add a user") . ': <input type="text" name="new" value="" size="40" id="emailsearch"/>
     <input class="submit" type="submit" name="add" value="' . $GLOBALS['I18N']->get('Add') . '" />
  </form>';
    return $html;
}
Example #6
0
function giveAlternative($table, $delete, $attributeid)
{
    print $GLOBALS['I18N']->get('ReplaceAllWith') . formStart();
    print '<select name=replace><option value="0">-- ' . $GLOBALS['I18N']->get('ReplaceWith') . '</option>';
    $req = Sql_Query("select * from {$table} order by listorder,name");
    while ($row = Sql_Fetch_array($req)) {
        if ($row["id"] != $delete) {
            printf('<option value="%d">%s</option>', $row["id"], $row["name"]);
        }
    }
    print "</select>";
    printf('<input type=hidden name="delete" value="%d">', $delete);
    printf('<input type=hidden name="id" value="%d">', $attributeid);
    printf('<input type=submit name="deleteandreplace" value="%s"></form>', $GLOBALS['I18N']->get('deleteandreplace'));
}
Example #7
0
function giveAlternative($table, $delete, $attributeid)
{
    print $GLOBALS['I18N']->get('Alternatively you can replace all values with another one:') . formStart(' class="editattributesAlternatives" ');
    print '<select name="replace"><option value="0">-- ' . $GLOBALS['I18N']->get('Replace with') . '</option>';
    $req = Sql_Query("select * from {$table} order by listorder,name");
    while ($row = Sql_Fetch_array($req)) {
        if ($row["id"] != $delete) {
            printf('<option value="%d">%s</option>', $row["id"], $row["name"]);
        }
    }
    print "</select>";
    printf('<input type="hidden" name="delete" value="%d" />', $delete);
    printf('<input type="hidden" name="id" value="%d" />', $attributeid);
    printf('<input class="submit" type="submit" name="deleteandreplace" value="%s" /><hr class="line" />', $GLOBALS['I18N']->get('Delete and replace'));
}
Example #8
0
function giveAlternative($table, $delete, $attributeid)
{
    print "Alternatively you can replace all values with another one:" . formStart();
    print '<select name=replace><option value="0">-- Replace with</option>';
    $req = Sql_Query("select * from {$table} order by listorder,name");
    while ($row = Sql_Fetch_array($req)) {
        if ($row[id] != $delete) {
            printf('<option value="%d">%s</option>', $row[id], $row[name]);
        }
    }
    print "</select>";
    printf('<input type=hidden name="delete" value="%d">', $delete);
    printf('<input type=hidden name="id" value="%d">', $attributeid);
    print '<input type=submit name="action" value="Delete and Replace"></form>';
}
Example #9
0
    Redirect('list');
}
if (!empty($id)) {
    $result = Sql_Query("SELECT * FROM " . $GLOBALS['tables']['list'] . " where id = {$id}");
    $list = Sql_Fetch_Array($result);
} else {
    $list = array('name' => '', 'active' => 0, 'listorder' => 0, 'description' => '');
}
if (empty($list['category'])) {
    $list['category'] = '';
}
@ob_end_flush();
?>

<?php 
echo formStart(' class="editlistSave" ');
?>
<input type="hidden" name="id" value="<?php 
echo $id;
?>
" />
<div class="label"><label for="listname"><?php 
echo $GLOBALS['I18N']->get('List name');
?>
:</label></div>
<div class="field"><input type="text" name="listname" value="<?php 
echo htmlspecialchars(stripslashes($list["name"]));
?>
" /></div>

<div class="field"><input type="checkbox" name="active" value="1"
Example #10
0
        $query = sprintf('insert into %s (email,entered,confirmed) values("testuser%s",now(),1)', $tables['user'], $prefix . '-' . $i . '@' . $domain);
        $result = Sql_query($query, 0);
        $userid = Sql_insert_id();
        if ($userid) {
            $result = Sql_query("replace into {$tables['listuser']} (userid,listid,entered) values({$userid},{$listid},now())");
            reset($data);
            while (list($key, $val) = each($data)) {
                if ($key && $val) {
                    Sql_query("replace into {$tables['user_attribute']} (attributeid,userid,value) values(" . $key . ",{$userid}," . $val . ')');
                }
            }
        }
    }
    return 1;
}
print formStart(' class="testOutput" ') . '<input type="text" name="output" size=45></form>';
print '<p class="button">' . PageLink2('stresstest', 'Erase Test information', 'eraseall=yes') . ' (may take a while)';
ob_end_flush();
flush();
$testlists = array();
$res = Sql_Query("select id from {$tables['list']} where name like \"%test%\"");
while ($row = Sql_Fetch_Row($res)) {
    array_push($testlists, $row[0]);
}
if (!ini_get('safe_mode')) {
    if (!count($testlists)) {
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Error: cannot find any test lists to use";</script>' . "\n";
    } elseif (!isset($eraseall)) {
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Filling ";</script>' . "\n";
        for ($i = 0; $i <= 100; ++$i) {
            set_time_limit(60);
Example #11
0
#}
if (!empty($_GET['tab'])) {
    $tabs->setCurrent($_GET['tab']);
} else {
    $_GET['tab'] = 'sent';
    $tabs->setCurrent('sent');
}
print '<div class="minitabs">';
print $tabs->display();
print '</div>';
$filterDisplay = $_SESSION['messagefilter'];
if ($filterDisplay == '') {
    $filterDisplay = ' --- filter --- ';
}
print '<div id="messagefilter" class="filterdiv fright">';
print formStart(' id="messagefilterform" ');
print '<div><input type="text" name="filter" value="' . htmlspecialchars($filterDisplay) . '" id="filtertext" />';
print '<select name="numPP" class="numppOptions">';
foreach (array(5, 10, 15, 20, 50, 100) as $numppOption) {
    if ($numppOption == $_SESSION['messagenumpp']) {
        print '<option selected="selected">' . $numppOption . '</option>';
    } else {
        print '<option>' . $numppOption . '</option>';
    }
}
print '</select>';
print '<select name="sortBy" class="sortby">';
foreach ($messageSortOptions as $sortOption => $sortOptionLabel) {
    if ($sortOption == $_SESSION['messagesortby']) {
        print '<option selected="selected" value="' . $sortOption . '">' . $sortOptionLabel . '</option>';
    } else {
Example #12
0
    $data = array();
    $data["title"] = '';
    $data["template"] = '';
}
?>

<p class="information"><?php 
echo $msg;
?>
</p>
<?php 
echo '<p class="button">' . PageLink2("templates", $GLOBALS['I18N']->get('List of Templates')) . '</p>';
?>

<?php 
echo formStart(' enctype="multipart/form-data" class="template2" ');
?>
<input type="hidden" name="id" value="<?php 
echo $id;
?>
" />
<div class="panel">
<table class="templateForm">
<tr>

  <td><?php 
echo $GLOBALS['I18N']->get('Title of this template');
?>
</td>
  <td><input type="text" name="title" value="<?php 
echo stripslashes(htmlspecialchars($data["title"]));
Example #13
0
require_once dirname(__FILE__) . '/accesscheck.php';
$access = accessLevel('list');
switch ($access) {
    case 'owner':
        $subselect = ' where owner = ' . $_SESSION['logindetails']['id'];
        break;
    case 'all':
        $subselect = '';
        break;
    case 'none':
    default:
        $subselect = ' where id = 0';
        break;
}
print formStart('name="categoryedit"');
if (!isset($_GET['show']) || $_GET['show'] != 'all') {
    if (!empty($subselect)) {
        $subselect .= ' and ';
    } else {
        $subselect .= ' where ';
    }
    $subselect .= '(category is null or category = "")';
} else {
    $subselect = 'where true ';
}
$categories = listCategories();
if (!count($categories)) {
    ## try to fetch them from existing lists
    $req = Sql_Query(sprintf('select distinct category from %s where category != "" ', $tables['list']));
    while ($row = Sql_Fetch_Row($req)) {
Example #14
0
    }
    if (empty($details['type'])) {
        $details['type'] = 'undefined';
    }
    if (!isset($configCategories[strtolower($details['category'])])) {
        $configCategories[strtolower($details['category'])] = array();
    }
    if (!isset($configTypes[$details['type']])) {
        $configTypes[$details['type']] = array();
    }
    $configTypes[$details['type']][] = $item;
    $configCategories[strtolower($details['category'])][] = $item;
}
#var_dump($configCategories);
#var_dump($configTypes);
print formStart(' class="configForm" enctype="multipart/form-data" ');
# configure options
reset($default_config);
if (!empty($_REQUEST['save'])) {
    if (!verifyToken()) {
        print Error(s('Invalid security token, please reload the page and try again'));
        return;
    }
    $info = $default_config[$id];
    $haserror = 0;
    if (is_array($_POST['values'])) {
        foreach ($_POST['values'] as $id => $value) {
            if (isset($default_config[$id])) {
                $info = $default_config[$id];
                if ($id == 'website' || $id == 'domain') {
                    $value = str_replace('[DOMAIN]', '', $value);
Example #15
0
function subscribePage($id)
{
    #  return subscribePage2($id);
    list($attributes, $attributedata) = PageAttributes($GLOBALS['pagedata']);
    $selected_lists = explode(',', $GLOBALS['pagedata']['lists']);
    $html = '<title>' . $GLOBALS['strSubscribeTitle'] . '</title>';
    $html .= $GLOBALS['pagedata']['header'];
    $html .= $GLOBALS['pagedata']['intro'];
    $html .= '

<div class="error"><span class="required">' . $GLOBALS['strRequired'] . '</span></div>
' . $GLOBALS['msg'] . '

<script language="Javascript" type="text/javascript">

function checkform()
{
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].type") == "checkbox") {
      if (document.subscribeform.elements[fieldstocheck[i]].checked) {
      } else {
        alert("' . $GLOBALS['strPleaseEnter'] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");

        return false;
      }
    } else {
      if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].value") == "") {
        alert("' . $GLOBALS['strPleaseEnter'] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");

        return false;
      }
    }
  }
  for (i=0;i<groupstocheck.length;i++) {
    if (!checkGroup(groupstocheck[i],groupnames[i])) {
      return false;
    }
  }
  ';
    if ($GLOBALS['pagedata']['emaildoubleentry'] == 'yes') {
        $html .= '
  if (! compareEmail()) {
    alert("' . str_replace('"', '\\"', $GLOBALS['strEmailsNoMatch']) . '");

    return false;
  }';
    }
    $html .= '
  if (! checkEmail()) {
    alert("' . str_replace('"', '\\"', $GLOBALS['strEmailNotValid']) . '");

    return false;
  }';
    $html .= '

  return true;
}

var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name)
{
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}
var groupstocheck = new Array();
var groupnames = new Array();
function addGroupToCheck(value,name)
{
  groupstocheck[groupstocheck.length] = value;
  groupnames[groupnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

function checkEmail()
{
  var re = /^(([^<>()[\\]\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;
    return re.test(document.subscribeform.elements["email"].value);
}

function checkGroup(name,value)
{
  option = -1;
  for (i=0;i<document.subscribeform.elements[name].length;i++) {
    if (document.subscribeform.elements[name][i].checked) {
      option = i;
    }
  }
  if (option == -1) {
    alert ("' . $GLOBALS['strPleaseEnter'] . ' "+value);

    return false;
  }

  return true;
}

</script>';
    $html .= formStart('name="subscribeform"');
    # @@@ update
    if (isset($_SESSION['adminloggedin']) && $_SESSION['adminloggedin']) {
        $html .= '<div class="adminmessage"><p><b>' . s('You are logged in as administrator (%s) of this phpList system', $_SESSION['logindetails']['adminname']) . '</b></p>';
        $html .= '<p>' . s('You are therefore offered the following choice, which your subscribers will not see when they load this page.') . '</p>';
        $html .= '<p><a href="' . $GLOBALS['adminpages'] . '" class="button">' . s('Go back to admin area') . '</a></p>';
        $html .= '<p><b>' . s('Please choose') . '</b>: <br/><input type=radio name="makeconfirmed" value="1"> ' . s('Make this subscriber confirmed immediately') . '
      <br/><input type=radio name="makeconfirmed" value="0" checked> ' . s('Send this subscriber a request for confirmation email') . ' </p></div>';
    }
    $html .= '<table border=0>';
    $html .= ListAttributes($attributes, $attributedata, $GLOBALS['pagedata']['htmlchoice'], 0, $GLOBALS['pagedata']['emaildoubleentry']);
    $html .= '</table>';
    //obsolete, moved to rssmanager plugin
    //  if (ENABLE_RSS) { // replaced bij display
    //    $html .= rssOptions($data);
    //   }
    foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
        #  dbg($plugin->name);
        if ($plugin->enabled) {
            $html .= $plugin->displaySubscriptionChoice($GLOBALS['pagedata']);
        }
    }
    $html .= ListAvailableLists('', $GLOBALS['pagedata']['lists']);
    if (empty($GLOBALS['pagedata']['button'])) {
        $GLOBALS['pagedata']['button'] = $GLOBALS['strSubmit'];
    }
    if (USE_SPAM_BLOCK) {
        $html .= '<div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div>';
    }
    $html .= '<p><input type=submit name="subscribe" value="' . $GLOBALS['pagedata']['button'] . '" onClick="return checkform();"></p></form>';
    $html .= '<br/><br/>';
    if (SHOW_UNSUBSCRIBELINK) {
        $html .= '<p><a href="' . getConfig('unsubscribeurl') . '&id=' . $id . '">' . $GLOBALS['strUnsubscribe'] . '</a></p>';
    }
    $html .= $GLOBALS['PoweredBy'];
    $html .= $GLOBALS['pagedata']['footer'];
    unset($_SESSION['subscriberConfirmed']);
    return $html;
}
Example #16
0
<?php

require_once dirname(__FILE__) . '/accesscheck.php';
print formStart('class="listListing"');
$some = 0;
if (isset($_GET['s'])) {
    $s = sprintf('%d', $_GET['s']);
} else {
    $s = 0;
}
$baseurl = './?page=list';
$actionresult = '';
if (isset($_POST['listorder']) && is_array($_POST['listorder'])) {
    while (list($key, $val) = each($_POST['listorder'])) {
        $active = empty($_POST['active'][$key]) ? '0' : '1';
        $active = $active || listUsedInSubscribePage($key);
        $query = ' update %s' . ' set listorder = ?, active = ?' . ' where id = ?';
        $query = sprintf($query, $tables['list']);
        Sql_Query_Params($query, array($val, $active, $key));
    }
}
$access = accessLevel('list');
switch ($access) {
    case 'owner':
        $subselect = ' where owner = ' . $_SESSION['logindetails']['id'];
        $subselect_and = ' and owner = ' . $_SESSION['logindetails']['id'];
        break;
    case 'all':
        $subselect = '';
        $subselect_and = '';
        break;
Example #17
0
      if (!ereg("#",$buffer)) {
        if (!$header)
          $header = $buffer;
        else if (trim($buffer) != "")
          Sql_Query(sprintf('insert into %slistattr_%s (name) values("%s")',$table_prefix,$lc_name,trim($buffer)));
      }
    }
    fclose ($fp);
  }
  print "Done<br/><br/>";
  print '<p>'.PageLink2("attributes","Continue").'</p>';

} else {

?>


<?php 
echo formStart();
?>
<?
reset($attributes);
while (list($key,$attribute) = each ($attributes)) {
  list($name,$desc) = explode(":",$key);
  printf('<input type=checkbox name="selected[]" value="%s">%s<br>', $attribute,$desc);
}
print "<input type=submit value=Add></form>";

}
?>
Example #18
0
    return true;
  }

  // detection of unsaved changes,
  var browser = navigator.appName.substring ( 0, 9 );
  var changed = 0; function haschanged() {changed = 1; }
  function savechanges() { if (changed) { if (confirm("<?php 
    echo str_replace('"', '&quot', reverse_htmlentities($GLOBALS['I18N']->get("unsavedchanges")));
    ?>
")) return true; else return false; return false;}}
  //'
  var event_number = 0;if (browser=="Microsoft") {  document.onkeydown=haschanged;  document.onchange=haschanged;} else if (browser=="Netscape") {  document.captureEvents(Event.KEYDOWN);  document.captureEvents(Event.CHANGE); document.onkeydown=haschanged;document.onchange=haschanged;}
  function submitform() { document.sendmessageform.submit() }
  </script>
  <?php 
    print formStart($enctype . ' name="sendmessageform"');
    #print '<form method="post" enctype="multipart/form-data" name="sendmessageform" onSubmit="return checkForm()">';
    print '<input type=hidden name="workaround_fck_bug" value="1">';
    if ($_GET["page"] == "preparemessage") {
        print Help("preparemessage", $GLOBALS['I18N']->get("whatisprepare"));
    }
    if (!defined("IN_WEBBLER")) {
        if (!$from && is_object($GLOBALS["admin_auth"]) && $GLOBALS['require_login']) {
            $adminemail = $GLOBALS["admin_auth"]->adminEmail($_SESSION["logindetails"]["id"]);
            if ($adminemail && USE_ADMIN_DETAILS_FOR_MESSAGES) {
                $from = $GLOBALS["admin_auth"]->adminName($_SESSION["logindetails"]["id"]) . ' ' . $adminemail;
            } else {
                $from = getConfig("message_from_name") . ' ' . getConfig("message_from_address");
            }
        }
    }
Example #19
0
        $limit = "limit {$start}," . MAX_USER_PP;
    } else {
        $limit = 'limit 0,50';
        $start = 0;
    }
}
if ($find) {
    $result = Sql_query('SELECT id,loginname,email FROM ' . $tables['admin'] . ' where loginname like "%' . sql_escape($find) . '%" or email like "%' . sql_escape($find) . "%\" order by loginname {$limit}");
} else {
    $result = Sql_query('SELECT id,loginname,email FROM ' . $tables['admin'] . " order by loginname {$limit}");
}
?>
<table>
    <tr>
        <td colspan=4><?php 
echo formStart('action=""');
?>
<input type="hidden" name="id" value="<?php 
echo $listid;
?>
">
            <?php 
echo $GLOBALS['I18N']->get('Find an admin');
?>
: <input type=text name="find"
                                                                         value="<?php 
echo htmlspecialchars($find);
?>
"
                                                                         size="40"><input type="submit"
                                                                                          value="<?php 
Example #20
0
    if (pluginCanEnable($pluginname)) {
        $ls->addColumn($pluginname, s('enabled'), $plugin->enabled ? PageLinkAjax('plugins&disable=' . $pluginname, $GLOBALS['img_tick']) : PageLinkAjax('plugins&enable=' . $pluginname, $GLOBALS['img_cross']));
    }
    if (DEVVERSION) {
        //$ls->addColumn($pluginname,s('initialise'),$plugin->enabled ?
        //PageLinkAjax('plugins&initialise='.$pluginname,s('Initialise')) : '');
        if ($plugin->enabled) {
            $details .= '<div class="detail"><span class="label">' . s('initialise') . '</span>';
            $details .= '<span class="value">';
            $details .= PageLinkAjax('plugins&initialise=' . $pluginname, s('Initialise'));
            $details .= '</span></div>';
        }
    }
    if (!empty($pluginDetails['installUrl']) && is_writable($pluginDestination . '/' . $pluginname)) {
        ## we can only delete the ones that were installed from the interface
        $ls->addColumn($pluginname, s('delete'), '<span class="delete"><a href="javascript:deleteRec(\'./?page=plugins&delete=' . $pluginname . '\');" class="button" title="' . s('delete this plugin') . '">' . s('delete') . '</a></span>');
    }
    if (!pluginCanEnable($pluginname)) {
        $details .= '<div class="detail"><span class="label">' . s('Dependency check') . '</span>';
        $details .= '<span class="value">' . s('Plugin can not be enabled, because it fails a dependency check - ') . $plugin->dependencyFailure . '</span></div>';
    }
    if (!empty($pluginDetails['installUrl']) && class_exists('ZipArchive')) {
        $updateForm = formStart();
        $updateForm .= '<input type="hidden" name="pluginurl" value="' . $pluginDetails['installUrl'] . '"/>
        <button type="submit" name="update" title="' . s('update this plugin') . '">' . s('update') . '</button></form>';
        $ls->addColumn($pluginname, s('update'), $updateForm);
    }
    $details .= '</div>';
    $ls->addRow($pluginname, s('details'), $details);
}
print $ls->display();
Example #21
0
            }
        }
        if ($c > 50) {
            break;
        }
    }
    printf($GLOBALS['I18N']->get('Test output<br/>If the output looks ok, click %s to submit for real') . '<br/><br/>', PageLink2($_GET["page"] . '&amp;confirm=yes', $GLOBALS['I18N']->get('Confirm Import')));
    print '<p>' . PageLink2($_GET["page"], $GLOBALS['I18N']->get('Import some more emails')) . '</p>';
    return;
}
?>


<ul>
<?php 
print formStart('enctype="multipart/form-data" name="import"');
/*
if (Sql_Table_Exists($tables["list"])) {
*/
if (isset($_GET['list'])) {
    $subselect .= sprintf(' and id= %d', $_GET['list']);
}
$result = Sql_query("SELECT id,name FROM " . $tables["list"] . " {$subselect} ORDER BY listorder");
$c = 0;
$some = Sql_Affected_Rows();
if ($some == 1) {
    $row = Sql_fetch_array($result);
    printf('<input type="hidden" name="listname[%d]" value="%s"><input type="hidden" name="lists[%d]" value="%d">%s <b>%s</b>', $c, stripslashes($row["name"]), $c, $row["id"], $GLOBALS['I18N']->get('Adding users to list'), stripslashes($row["name"]));
} else {
    print '<h3>' . $GLOBALS['I18N']->get('Select the lists to add the emails to') . '</h3>';
    /*
Example #22
0
            $row = Sql_Fetch_Row($res);
            if ($row[1] != "hidden" && $row[1] != "textline") {
                Sql_Query("drop table {$table_prefix}" . "adminattr_{$row['0']}");
            }
            Sql_Query("delete from {$tables['adminattribute']} where id = {$id}");
            # delete all admin attributes as well
            Sql_Query("delete from {$tables['admin_attribute']} where adminattributeid = {$id}");
        }
    }
}
?>



<?php 
print formStart();
$res = Sql_Query("select * from {$tables['adminattribute']} order by listorder");
if (Sql_Num_Rows()) {
    print $GLOBALS['I18N']->get('ExistingAttr');
} else {
    print $GLOBALS['I18N']->get('NoAttrYet');
}
while ($row = Sql_Fetch_array($res)) {
    ?>
  <table border=1>
  <tr><td colspan=2><?php 
    echo $GLOBALS['I18N']->get('Attribute') . $row["id"];
    ?>
</td><td colspan=2><?php 
    echo $GLOBALS['I18N']->get('Delete');
    ?>
Example #23
0
    button('Drop Districts', 'dropDistricts', 'danger');
    formFinish();
    formStart();
    button('Populate Districts', 'syncDistricts', 'success');
    valuesetTextbox("Districts", $fhir_valueset_districts);
    formFinish();
    echo '</li><br>';
    echo '<li><div class="alert alert-warning" role="alert">Counties</div>';
    formFinish();
    formStart();
    button('Browse iHRIS Counties', 'browseCounties', 'primary');
    formFinish();
    formStart();
    button('Drop Counties', 'dropCounties', 'danger');
    formFinish();
    formStart();
    button('Populate Counties', 'syncCounties', 'success');
    valuesetTextbox("Counties", $fhir_valueset_counties);
    formFinish();
    echo '</li><br>';
    echo '</ul>';
} else {
    if (isset($_POST['action'])) {
        $action = $_POST['action'];
        if (isset($_POST['valueset'])) {
            if ($_POST['valueset'] != "") {
                $valueset = $_POST['valueset'];
            } else {
                $valueset = $_POST['defaultValueset'];
            }
            alert('ValueSet: "' . $valueset . '"<br>');
    $recently_sent = Sql_Fetch_Row_Query(sprintf('select count(*) from %s where date_add(entered,interval %d second) > now() and status = "sent"', $tables["usermessage"], $batch_period));
    $num_per_batch -= $recently_sent[0];
    # if this ends up being 0 or less, don't send anything at all
    if ($num_per_batch == 0) {
        $num_per_batch = -1;
    }
}
# output some stuff to make sure it's not buffered in the browser
for ($i = 0; $i < 10000; $i++) {
    print '  ' . "\n";
}
flush();
print '<script language="Javascript" src="js/progressbar.js" type="text/javascript"></script>';
print '<script language="Javascript" type="text/javascript"> yposition = 10;document.write(progressmeter); start();</script>';
flush();
print formStart('name="outputform"') . '<textarea name="output" rows=22 cols=75></textarea></form>';
# report keeps track of what is going on
$report = "";
$nothingtodo = 0;
$cached = array();
# cache the message from the database to avoid reloading it every time
require_once dirname(__FILE__) . '/sendemaillib.php';
if (ENABLE_RSS) {
    require_once dirname(__FILE__) . '/rsslib.php';
}
function my_shutdown()
{
    global $script_stage, $reload;
    #  output( "Script status: ".connection_status(),0); # with PHP 4.2.1 buggy. http://bugs.php.net/bug.php?id=17774
    output($GLOBALS['I18N']->get('Script stage') . ': ' . $script_stage, 0);
    global $report, $send_process_id, $tables, $nothingtodo, $invalid, $processed, $failed_sent, $notsent, $sent, $unconfirmed, $num_per_batch, $batch_period, $num_users;
Example #25
0
        default:
            $subselect = " where id = 0";
            break;
    }
}
if (isset($_REQUEST['delete'])) {
    $delete = sprintf('%d', $_REQUEST['delete']);
} else {
    $delete = 0;
}
if ($delete) {
    Sql_Query(sprintf('delete from %s where id = %d', $tables["subscribepage"], $delete));
    Sql_Query(sprintf('delete from %s where id = %d', $tables["subscribepage_data"], $delete));
    Info($GLOBALS['I18N']->get('Deleted') . " {$delete}");
}
print formStart('name="pagelist" class="spageEdit" ');
print '<input type="hidden" name="active[-1]" value="1" />';
## to force the active array to exist
$ls = new WebblerListing($GLOBALS['I18N']->get('subscribe pages'));
$req = Sql_Query(sprintf('select * from %s %s order by title', $tables["subscribepage"], $subselect));
while ($p = Sql_Fetch_Array($req)) {
    $ls->addElement($p["id"]);
    $ls->setClass($p["id"], 'row1');
    $ls->addColumn($p["id"], $GLOBALS['I18N']->get('title'), stripslashes($p["title"]));
    if ($require_login && isSuperUser() || !$require_login) {
        $ls->addColumn($p["id"], $GLOBALS['I18N']->get('owner'), adminName($p["owner"]));
        if ($p["id"] == $default) {
            $checked = 'checked="checked"';
        } else {
            $checked = "";
        }
Example #26
0
    #echo $num
    ?>
 <!--users apply (at the moment, independent of list membership)<p class="x">-->
<?php 
} elseif ($send && !$message) {
    ?>
  Please select a message<br/>
  <?php 
} elseif ($send && !$list) {
    ?>
 Please select a list to send to<br/>
  <?php 
}
if (!$done) {
    print "To send a prepared message, check the radio button next to the message you want to send and click \"Send\"";
    print formStart('name="sendpreparedform" class="sendpreparedSend" ');
    $req = Sql_Query("select * from {$tables["message"]} where status = 'prepared'");
    if (!Sql_Affected_Rows()) {
        Error("No prepared messages found. You need to " . PageLink2("preparesend", "Prepare") . " one first");
    }
    while ($message = Sql_Fetch_Array($req)) {
        print "<hr/>Subject: <b>" . $message["subject"] . "</b>, ";
        print "From: <b>" . $message["fromfield"] . "</b> <br/>";
        print 'Send this message <input type="radio" name="message" value="' . $message["id"] . '" /><br/><br/>';
        print '<p class="information">[start of message]</p>';
        print '<iframe src="?page=viewmessage&embed=yes&omitall=yes&amp;id=' . $message["id"] . '"
    scrolling="auto" width=100% height=450 margin=0 frameborder=0>
  </iframe>';
        print '<p class="information">[end of message]</p>';
    }
    $html = '<hr/><p class="information">Please select the lists you want to send it to:
Example #27
0
#print '<h3>'.$messagedata['status'].'</h3>';
if (!empty($_GET['deletecriterion'])) {
    include dirname(__FILE__) . '/actions/deletecriterion.php';
    Redirect($_GET['page'] . '&id=' . $id . '&tab=' . $_GET['tab']);
}
ob_end_flush();
#load database data###########################
if ($id) {
    // Load message attributes / values
    $result = Sql_query("SELECT * FROM {$tables['message']} where id = {$id} {$ownership}");
    if (!Sql_Affected_Rows()) {
        print $GLOBALS['I18N']->get('Access Denied');
        $done = 1;
        return;
    }
    print formStart($enctype . ' name="sendmessageform" class="sendSend" id="sendmessageform" ');
    if (empty($send)) {
        $placeinqueue = '<div id="addtoqueue"><button class="submit" type="submit" name="send" id="addtoqueuebutton">' . $GLOBALS['I18N']->get('Send Campaign') . '</button></div>';
    } else {
        ## hide the div in the final "message added to queue" page
        #  print '<div id="addtoqueue"></div>';
    }
    require dirname(__FILE__) . '/structure.php';
    // This gets the database structures into DBStruct
    include dirname(__FILE__) . '/actions/storemessage.php';
}
$htmlformatted = strip_tags($messagedata['message']) != $messagedata['message'];
# sanitise the header fields, what else do we need to check on?
if (preg_match("/\n|\r/", $messagedata['fromfield'])) {
    $messagedata['fromfield'] = '';
}
Example #28
0
                if (!$header) {
                    $header = $buffer;
                } else {
                    if (trim($buffer) != "") {
                        Sql_Query(sprintf('insert into %slistattr_%s (name) values("%s")', $table_prefix, $lc_name, trim($buffer)));
                    }
                }
            }
        }
        fclose($fp);
    }
    print $GLOBALS['I18N']->get('done') . "<br/><br/>";
    print PageLinkButton("attributes", $GLOBALS['I18N']->get('return to editing attributes'));
    #@@@@ not sure about this one:  print '<p class="button">'.PageLink2("attributes",$GLOBALS['I18N']->get('continue')).'</p>';
} else {
    ?>


<?php 
    echo formStart(' class="defaultsAdd"');
    reset($attributes);
    while (list($key, $attribute) = each($attributes)) {
        if (strstr($key, ':')) {
            list($name, $desc) = explode(":", $key);
            if ($name && $desc) {
                printf('<input type="checkbox" name="selected[]" value="%s" />%s<br/>', $attribute, $desc);
            }
        }
    }
    print '<input class="submit" type="submit" value="' . $GLOBALS['I18N']->get('Add') . '" /></form>';
}
if (!$id) {
    while (list($key, $val) = each($default_config)) {
        if (is_array($val)) {
            $dbval = getConfig($key);
            if (isset($dbval)) {
                $value = $dbval;
            } else {
                $value = $val[0];
            }
            printf('<p><a href="%s">%s</a> <b>%s</b><br/>', PageURL2("configure", "", "id={$key}"), $GLOBALS['I18N']->get('edit'), $GLOBALS['I18N']->get($val[1]));
            print nl2br(htmlspecialchars(stripslashes($value))) . "<br/><hr/>";
        }
    }
} else {
    $val = $default_config[$id];
    printf('%s<p>' . $GLOBALS['I18N']->get('editing') . ' <b>%s</b><br/>', formStart(), $GLOBALS['I18N']->get($val[1]));
    printf('<input type=hidden name="id" value="%s">', $id);
    $dbval = getConfig($id);
    #  print $dbval.'<br/>';
    if (isset($dbval)) {
        $value = $dbval;
    } else {
        $value = $val[0];
    }
    #  print $value . " ".$website . " ".$domain.'<br/>';
    if ($id != "website" && $id != "domain") {
        $value = preg_replace('/' . $domain . '/i', '[DOMAIN]', $value);
        $value = preg_replace('/' . $website . '/i', '[WEBSITE]', $value);
    }
    #  print $value . '<br/>';
    if ($val[2] == "textarea") {
Example #30
0
    Sql_query(sprintf('delete from %s where adminid = %d', $GLOBALS["tables"]["admin_task"], $_GET["delete"]));
    print '..' . $GLOBALS['I18N']->get('Done') . "<br /><hr><br />\n";
}
if ($id) {
    print $GLOBALS['I18N']->get('Edit Administrator') . ': ';
    $result = Sql_query("SELECT * FROM {$tables["admin"]} where id = {$id}");
    $data = sql_fetch_array($result);
    print $data["loginname"];
    if ($data["loginname"] != "admin" && $accesslevel == "all") {
        printf("<br /><li><a href=\"javascript:deleteRec('%s');\">Delete</a> %s\n", PageURL2("admin", "", "delete={$id}"), $admin["loginname"]);
    }
} else {
    print $GLOBALS['I18N']->get('Add a new Administrator');
}
print "<br/>";
print '<p>' . $GLOBALS['I18N']->get('Admin Details') . ':' . formStart() . '<table border=1>';
printf('<input type=hidden name="id" value="%d">', $id);
reset($struct);
while (list($key, $val) = each($struct)) {
    list($a, $b) = explode(":", $val[1]);
    if ($a == "sys") {
        printf('<tr><td>%s</td><td>%s</td></tr>', $GLOBALS['I18N']->get($b), $data[$key]);
    } elseif ($key == "loginname" && $data[$key] == "admin") {
        printf('<tr><td>' . $GLOBALS['I18N']->get('Login Name') . '</td><td>admin</td></tr>');
        print '<input type=hidden name="loginname" value="admin">';
    } elseif ($key == "superuser" || $key == "disabled") {
        if ($accesslevel == "all") {
            printf('<tr><td>%s</td><td><input type="text" name="%s" value="%s" size=30></td></tr>' . "\n", $GLOBALS['I18N']->get($val[1]), $key, $data[$key]);
        }
    } elseif ($val[1]) {
        printf('<tr><td>%s</td><td><input type="text" name="%s" value="%s" size=30></td></tr>' . "\n", $GLOBALS['I18N']->get($val[1]), $key, $data[$key]);