public function __construct($content = NULL) { if ($content != NULL) { $this->data = $content; } Info(get_class() . ' Initialized'); }
/** * Konstruktor metódus * * Beolvassa a php://input -ot és feldolgozza az esetlegesen érkező hibákat * * @since: 2016.05.04 */ public function __construct($inputRaw = NULL) { if ($inputRaw != NULL) { $this->parse($inputRaw); } Info($inputRaw, get_class($this) . ' Initialized with'); }
public function __construct() { parent::__construct(); $this->load->library(['api/json_rpc/Request' => NULL, 'api/json_rpc/Response' => NULL]); $inputRaw = file_get_contents('php://input'); $this->request = new Request($inputRaw); $this->response = new Response($this->request, $this->errors); Info(get_class($this) . ' Initialized'); }
function userLogout() { global $user; $username = $user['Username']; Info("User \"{$username}\" logged out"); unset($_SESSION['user']); unset($user); session_destroy(); }
public function __construct($source = NULL, $parent = NULL) { if ($parent != NULL) { $this->parent = $parent; } if ($source != NULL) { $this->parse($source); } Info(get_class() . '#' . $this->name . ' Initialized'); }
public function __construct($attributes = NULL, $parent = NULL) { $ionize = \Ionize::getInstance(); Debug($ionize, '$ionize'); if (count($ionize->contents) > 0) { $this->output = TRUE; } foreach ($ionize->contents as $content) { $this->addItem(new Article($content)); } Info(get_class() . ' Initialized'); }
/** * Konstruktor metódus * * @since: 2016.05.04 */ public function __construct(Request $request = NULL, array $customErrors = []) { // Megnézem van-e átadva paraméter if ($request != NULL) { // Elmentem a kérés objektumot $this->request =& $request; // Ha voltak a kérésben hibák if (count($this->request->errors) > 0) { $this->errors = $this->request->errors; $this->id = NULL; } else { $this->id = $this->request->id; } // Saving the Custom Errors from the API $this->customErrors = $customErrors; Info($request, get_class($this) . ' Initialized width'); } }
/** * Partial constructor * * @param null|array $arguments */ public function __construct($arguments = NULL) { if ($arguments != NULL) { foreach ($arguments as $index => $argument) { if (is_numeric($index)) { $args = json_decode($argument); foreach ($args as $name => $value) { if (method_exists($this, $name)) { $this->output = $this->{$name}($value); } } } else { if (method_exists($this, $index)) { $this->output = $this->{$index}($argument); } } } Info($arguments, get_class() . ' Initialized with Arguments'); } else { Info(get_class() . ' Initialized'); } }
$countresult = Sql_query($countquery); $total = Sql_Num_Rows($countresult); if ($total == 0 && sizeof($aListCategories) && $current == '' && empty($_GET['tab'])) { ## reload to first category, if none found by default (ie all lists are categorised) if (!empty($aListCategories[0])) { Redirect('list&tab=' . $aListCategories[0]); } } print '<p class="total">' . $total . ' ' . $GLOBALS['I18N']->get('Lists') . '</p>'; $limit = ''; $query = ' select *' . ' from ' . $tables['list'] . $subselect . ' order by listorder ' . $limit; $result = Sql_query($query); $numlists = Sql_Affected_Rows($result); $ls = new WebblerListing(s('Lists')); if ($numlists > 15) { Info(s('You seem to have quite a lot of lists, do you want to organise them in categories? ') . ' ' . PageLinkButton('catlists', $GLOBALS['I18N']->get('Great idea!'))); /* @@TODO add paging when there are loads of lists, because otherwise the page is very slow $limit = ' limit 50'; $query = ' select *' . ' from ' . $tables['list'] . $subselect . ' order by listorder '.$limit; $result = Sql_query($query); */ } while ($row = Sql_fetch_array($result)) { ## we only consider confirmed and not blacklisted subscribers members of a list ## we assume "confirmed" to be 1 or 0, so that the sum gives the total confirmed ## could be incorrect, as 1000 is also "true" but will be ok (saves a few queries) ## same with blacklisted, but we're disregarding that for now, because blacklisted subscribers should not
ob_start(); print '<div id="autosave"></div>'; ### check for draft messages if (!$GLOBALS["commandline"]) { if (!empty($_GET['delete'])) { if ($_GET['delete'] == 'alldraft') { $req = Sql_Query(sprintf('select id from %s where status = "draft" %s', $GLOBALS['tables']['message'], $ownership)); 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&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&id=' . $row['id'])); $ls->setClass($element, 'row1'); # $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&id='.$row['id'],$I18N->get('edit')));
} if (ALLOW_ATTACHMENTS && WARN_ABOUT_PHP_SETTINGS && (!is_dir($GLOBALS["attachment_repository"]) || !is_writable($GLOBALS["attachment_repository"]))) { if (ini_get("open_basedir")) { Warn($GLOBALS['I18N']->get('open_basedir restrictions are in effect, which may be the cause of the next warning')); } Warn($GLOBALS['I18N']->get('The attachment repository does not exist or is not writable')); } if (MANUALLY_PROCESS_QUEUE && isSuperUser() && empty($_GET['pi']) && (!isset($_GET['page']) || $_GET['page'] != 'processqueue' && $_GET['page'] != 'messages' && $_GET['page'] != 'upgrade')) { ## avoid error on uninitialised DB if (Sql_Table_exists($tables['message'])) { $queued_count = Sql_Fetch_Row_Query(sprintf('select count(id) from %s where status in ("submitted","inprocess") and embargo < now()', $tables['message'])); if ($queued_count[0]) { $link = PageLinkButton('processqueue', s('Process the queue')); $link2 = PageLinkButton('messages&tab=active', s('View the queue')); if ($link || $link2) { print Info(sprintf(s('You have %s message(s) waiting to be sent'), $queued_count[0]) . '<br/>' . $link . ' ' . $link2); } } } } } # always allow access to the about page if (isset($_GET['page']) && $_GET['page'] == 'about') { $page = 'about'; $include = 'about.php'; } print $pageinfo->show(); if (!empty($_GET['action']) && $_GET['page'] != 'pageaction') { $action = basename($_GET['action']); if (is_file(dirname(__FILE__) . '/actions/' . $action . '.php')) { $status = '';
include 'actions/reconcileusers.php'; } elseif (isset($_GET['option']) && $_GET['option'] == 'markinvalidunconfirmed') { Info($GLOBALS['I18N']->get('Marking subscribers with an invalid email as unconfirmed')); flush(); $req = Sql_Query("select id,email from {$tables['user']}"); $c = 0; while ($row = Sql_Fetch_Array($req)) { set_time_limit(60); if (!is_email($row['email'])) { ++$c; Sql_Query("update {$tables['user']} set confirmed = 0 where id = {$row['id']}"); } } print $c . ' ' . $GLOBALS['I18N']->get('subscribers updated') . "<br/>\n"; } elseif (isset($_GET['option']) && $_GET['option'] == 'removestaleentries') { Info($GLOBALS['I18N']->get('Cleaning some user tables of invalid entries')); # some cleaning up of data: $req = Sql_Verbose_Query("select {$tables['usermessage']}.userid\n from {$tables['usermessage']} left join {$tables['user']} on {$tables['usermessage']}.userid = {$tables['user']}.id\n where {$tables['user']}.id IS NULL group by {$tables['usermessage']}.userid"); print Sql_Affected_Rows() . ' ' . $GLOBALS['I18N']->get('entries apply') . '<br/>'; while ($row = Sql_Fetch_Row($req)) { Sql_Query("delete from {$tables['usermessage']} where userid = {$row['0']}"); } $req = Sql_Verbose_Query("select {$tables['user_attribute']}.userid\n from {$tables['user_attribute']} left join {$tables['user']} on {$tables['user_attribute']}.userid = {$tables['user']}.id\n where {$tables['user']}.id IS NULL group by {$tables['user_attribute']}.userid"); print Sql_Affected_Rows() . ' ' . $GLOBALS['I18N']->get('entries apply') . '<br/>'; while ($row = Sql_Fetch_Row($req)) { Sql_Query("delete from {$tables['user_attribute']} where userid = {$row['0']}"); } $req = Sql_Verbose_Query("select {$tables['listuser']}.userid\n from {$tables['listuser']} left join {$tables['user']} on {$tables['listuser']}.userid = {$tables['user']}.id\n where {$tables['user']}.id IS NULL group by {$tables['listuser']}.userid"); print Sql_Affected_Rows() . ' ' . $GLOBALS['I18N']->get('entries apply') . '<br/>'; while ($row = Sql_Fetch_Row($req)) { Sql_Query("delete from {$tables['listuser']} where userid = {$row['0']}");
} } if (!empty($_POST['category']) && is_array($_POST['category'])) { foreach ($_POST['category'] as $key => $val) { Sql_Query(sprintf('update %s set category = "%s" %s and id = %d ', $tables['list'], sql_escape($val), $subselect, $key)); } if (isset($_GET['show']) && $_GET['show'] == 'all') { $_SESSION['action_result'] = s('Category assignments saved'); Redirect('list'); } else { Info(s('Categories saved'), true); } } $req = Sql_Query(sprintf('select * from %s %s', $tables['list'], $subselect)); if (!Sql_Affected_Rows()) { Info(s('All lists have already been assigned a category') . '<br/>' . PageLinkButton('list', s('Back')), true); } print '<div class="fright">' . PageLinkButton('catlists&show=all', s('Re-edit all lists')) . '</div>'; print '<div class="fright">' . PageLinkButton('configure&id=list_categories&ret=catlists', $I18N->get('Configure Categories')) . '</div>'; $ls = new WebblerListing(s('Categorise lists')); $aListCategories = listCategories(); if (count($aListCategories)) { while ($row = Sql_Fetch_Assoc($req)) { $ls->addELement($row['id']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('Name'), stripslashes($row['name'])); $catselect = '<select name="category[' . $row['id'] . ']">'; $catselect .= '<option value="">-- ' . s('choose category') . '</option>'; $catselect .= '<option value="">-- ' . s('none') . '</option>'; foreach ($aListCategories as $category) { $category = trim($category); $catselect .= sprintf('<option value="%s" %s>%s</option>', $category, $category == $row['category'] ? 'selected="selected"' : '', $category);
if (is_dir(dirname(__FILE__) . '/lan/' . $iso)) { $ls .= sprintf('<option value="%s" %s>%s</option>', $iso, $_SESSION['adminlanguage']['iso'] == $iso ? 'selected' : '', $rec[0]); $lancount++; } } $ls .= '</select></form></div>'; if ($lancount > 1) { print $ls; } } if ($page != "login") { if (ereg("dev", VERSION) && !TEST) { if ($GLOBALS["developer_email"]) { print Info("Running CVS version. All emails will be sent to " . $GLOBALS["developer_email"]); } else { print Info("Running CVS version, but developer email is not set"); } } #if (!ini_get("register_globals") && WARN_ABOUT_PHP_SETTINGS) # Error("Register Globals in your php.ini needs to be <b>on</b> instead of ".ini_get("register_globals") ); if (ini_get("safe_mode") && WARN_ABOUT_PHP_SETTINGS) { Warn($GLOBALS['I18N']->get('safemodewarning')); } if (!ini_get("magic_quotes_gpc") && WARN_ABOUT_PHP_SETTINGS) { Warn($GLOBALS['I18N']->get('magicquoteswarning')); } if (ini_get("magic_quotes_runtime") && WARN_ABOUT_PHP_SETTINGS) { Warn($GLOBALS['I18N']->get('magicruntimewarning')); } if (defined("ENABLE_RSS") && ENABLE_RSS && !function_exists("xml_parse") && WARN_ABOUT_PHP_SETTINGS) { Warn($GLOBALS['I18N']->get('noxml'));
print '<p>' . PageLinkButton('configure&id=list_categories', $I18N->get('Configure Categories')) . '</p>'; print '<br/>'; return; } else { saveConfig('list_categories', join(',', $categories)); } } if (!empty($_POST['category']) && is_array($_POST['category'])) { foreach ($_POST['category'] as $key => $val) { Sql_Query(sprintf('update %s set category = "%s" %s and id = %d ', $tables['list'], sql_escape($val), $subselect, $key)); } print Info($I18N->get('Categories saved')); } $req = Sql_Query(sprintf('select * from %s %s', $tables['list'], $subselect)); if (!Sql_Affected_Rows()) { print Info(s('All lists have already been assigned a category'), true); } else { print '<div class="fright">' . PageLinkButton('configure&id=list_categories', $I18N->get('Configure Categories')) . '</div>'; } $ls = new WebblerListing(s('Categorise lists')); $aListCategories = listCategories(); if (sizeof($aListCategories)) { while ($row = Sql_Fetch_Assoc($req)) { $ls->addELement($row['id']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('Name'), stripslashes($row['name'])); $catselect = '<select name="category[' . $row['id'] . ']">'; $catselect .= '<option value="">-- ' . s('choose category') . '</option>'; foreach ($aListCategories as $category) { $category = trim($category); $catselect .= sprintf('<option value="%s" %s>%s</option>', $category, $category == $row['category'] ? 'selected="selected"' : '', $category); }
$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();
return; } if (!MANUALLY_PROCESS_QUEUE) { print "This page can only be called from the commandline"; return; } } else { @ob_end_clean(); print ClineSignature(); ob_start(); include dirname(__FILE__) . '/actions/processqueue.php'; return; } # once and for all get rid of those questions why they do not receive any emails :-) if (TEST) { print Info('<strong>' . $GLOBALS['I18N']->get('Running in testmode, no emails will be sent. Check your config file.'), 1) . '</strong>'; } print '<noscript> <div class="error">' . s('This page requires Javascript to be enabled.') . '</div> </noscript>'; if (isset($_GET['pqchoice'])) { if ($_GET['pqchoice'] == 'local') { SaveConfig('pqchoice', 'local', 0); } elseif ($_GET['pqchoice'] == 'reset') { SaveConfig('pqchoice', '', 0); } } if (SHOW_PQCHOICE) { $pqChoice = getConfig('pqchoice'); } else { $pqChoice = 'local';
print $GLOBALS['I18N']->get('success'); } print '<br/>'; } else { print "<font color=red>" . $GLOBALS['I18N']->get("emailnotfound") . ": {$address}</font><br>"; } } echo "<HR>"; } } elseif (isset($_POST["deleteattachments"]) && is_array($_POST["deleteattachments"]) && $id) { if (ALLOW_ATTACHMENTS) { // Delete Attachment button hit... $deleteattachments = $_POST["deleteattachments"]; foreach ($deleteattachments as $attid) { $result = Sql_Query(sprintf("Delete from %s where id = %d and messageid = %d", $tables["message_attachment"], $attid, $id)); print Info($GLOBALS['I18N']->get("removedattachment") . " " . $att_cnt); // NOTE THAT THIS DOESN'T ACTUALLY DELETE THE ATTACHMENT FROM THE DATABASE, OR // FROM THE FILE SYSTEM - IT ONLY REMOVES THE MESSAGE / ATTACHMENT LINK. THIS // SHOULD PROBABLY BE CORRECTED, BUT I (Pete Ness) AM NOT SURE WHAT OTHER IMPACTS // THIS MAY HAVE. // (My thoughts on this are to check for any orphaned attachment records and if // there are any, to remove it from the disk and then delete it from the database). } } } # load all message data $messagedata = loadMessageData($id); #0013076: different content when forwarding 'to a friend' if (FORWARD_ALTERNATIVE_CONTENT) { foreach (array('forwardsubject', 'forwardmessage', 'forwardfooter') as $var) { if (isset($_REQUEST[$var])) {
$filterpanel .= '>' . $GLOBALS['I18N']->get('Email') . '</option>'; $filterpanel .= '<option value="foreignkey" '; $filterpanel .= $findby == 'foreignkey' ? 'selected="selected"' : ''; $filterpanel .= '>' . $GLOBALS['I18N']->get('Foreign Key') . '</option>'; $filterpanel .= '<option value="uniqid" '; $filterpanel .= $findby == 'uniqid' ? 'selected="selected"' : ''; $filterpanel .= '>' . $GLOBALS['I18N']->get('Unique ID') . '</option>'; $att_req = Sql_Query('select id,name from ' . $tables['attribute'] . ' where type = "hidden" or type = "textline" or type = "select"'); while ($row = Sql_Fetch_Array($att_req)) { $filterpanel .= sprintf('<option value="%d" %s>%s</option>', $row['id'], $row['id'] == $findby ? 'selected="selected"' : '', substr($row['name'], 0, 20)); } $filterpanel .= '</select><input class="submit" type="submit" value="' . s('Go') . '" /> <a href="./?page=users&find=NULL" class="reset">' . s('reset') . '</a>'; $filterpanel .= '</form></div>'; //$filterpanel .= '<tr><td colspan="4"></td></tr> //</table>'; print Info($countpanel); $panel = new UIPanel($GLOBALS['I18N']->get('Find subscribers'), $filterpanel); print $panel->display(); #if (($require_login && isSuperUser()) || !$require_login) print '<div class="actions">'; print '<div id="add-csv-button">' . PageLinkButton('dlusers', $GLOBALS['I18N']->get('Download all users as CSV file'), 'nocache=' . uniqid('')) . '</div>'; print '<div id="add-user-button">' . PageLinkButton('adduser', $GLOBALS['I18N']->get('Add a User')) . '</div>'; print '</div>'; $some = 0; $ls = new WebblerListing(s('users')); $ls->usePanel($paging); if ($result) { while ($user = Sql_fetch_array($result)) { $some = 1; $ls->addElement($user['email'], PageURL2("user&start={$start}&id=" . $user['id'] . $find_url)); $ls->setClass($user['email'], 'row1');
$sendtestresult .= '<script type="text/javascript">this.location.hash="sendTest";</script>'; } } elseif (isset($_POST["deleteattachments"]) && is_array($_POST["deleteattachments"]) && $id) { if (ALLOW_ATTACHMENTS) { // Delete Attachment button hit... $deleteattachments = $_POST["deleteattachments"]; foreach ($deleteattachments as $attid) { $attDetails = Sql_fetch_assoc_query(sprintf('select filename from %s where id = %d', $tables["attachment"], $attid)); $phys_file = $GLOBALS["attachment_repository"] . "/" . $attDetails["filename"]; $fileParts = pathinfo($phys_file); $phys_file2 = $GLOBALS["attachment_repository"] . "/" . $fileParts['filename']; ## to remove the file created by tempnam @unlink($phys_file); @unlink($phys_file2); $result = Sql_Query(sprintf("delete from %s where id = %d and messageid = %d", $tables["message_attachment"], $attid, $id)); print Info($GLOBALS['I18N']->get("Removed Attachment ")); } } } ############################## # Stacked attributes, processing and calculation ############################## ## moved to plugin ############################## # Stacked attributes, end ############################## echo $errormsg; if (!$done) { #$baseurl = sprintf('./?page=%s&id=%d',$_GET["page"],$id); if ($id) { $tabs = new WebblerTabs();
private function runTask($task) { Info('Running task "' . implode('::', $task['callback']) . '" (id: ' . $task['unique_id'] . ').'); $taskStart = microtime(true); $instance = new $task['callback'][0](TaskEnvironment::GetInstance(), $task); call_user_func(array($instance, $task['callback'][1])); Info('Ran task "' . implode('::', $task['callback']) . ' in ' . sprintf('%.2f', (microtime(true) - $taskStart) * 1000) . 'ms.'); ServiceState::UpdateTaskLastExecutionTime($task); }
} } ## #17328 - remove list categories with quotes Sql_Query(sprintf("update %s set category = replace(category,\"\\\\'\",\" \")", $tables['list'])); ## longblobs are better at mixing character encoding. We don't know the encoding of anything we may want to store in cache ## before converting, it's quickest to clear the cache clearPageCache(); Sql_Query(sprintf('alter table %s change column content content longblob', $tables['urlcache'])); # mark the database to be our current version if ($success) { SaveConfig('version', VERSION, 0); # mark now to be the last time we checked for an update SaveConfig('updatelastcheck', date('Y-m-d H:i:s', time()), 0, true); ## also clear any possible value for "updateavailable" Sql_Query(sprintf('delete from %s where item = "updateavailable"', $tables['config'])); Info(s('Success'), 1); upgradePlugins(array_keys($GLOBALS['plugins'])); print subscribeToAnnouncementsForm(); ## check for old click track data $num = Sql_Fetch_Row_Query(sprintf('select count(*) from %s', $GLOBALS['tables']['linktrack'])); if ($num[0] > 0) { print '<p class="information">' . $GLOBALS['I18N']->get('The clicktracking system has changed') . '</p>'; printf($GLOBALS['I18N']->get('You have %s entries in the old statistics table'), $num[0]) . ' '; print ' ' . PageLinkButton('convertstats', $GLOBALS['I18N']->get('Convert Old data to new')); } if ($GLOBALS['commandline']) { output($GLOBALS['I18N']->get('Upgrade successful')); } } else { Error('An error occurred while upgrading your database'); if ($GLOBALS['commandline']) {
$(".big").click(function(){$("#textarea").css('font-size','14px');}); }); </script> </head> <body> <!-- header--> <?php require_once 'header.php'; ?> <!-- /header--> <!-- banner--> <div class="subBanner"> <img src="templates/default/images/banner-ir.png" /> </div> <!-- /banner--> <!-- notice--> <div class="subnotice"><strong>网站公告:</strong> <?php echo Info(1); ?> </div> <!-- /notice--> <!-- mainbody--> <div class="subBody"> <div class="subTitle"> <span class="catname"><?php echo GetCatName($cid); ?> </span> <a href="javascript:history.go(-1);" class="goback">>> 返回</a> <span class="fr">您当前所在位置:<?php echo GetPosStr($cid, $id); ?> </span> <div class="cl"></div> </div> <div class="OneOfTwo">
} if (empty($_REQUEST['id'])) { $id = ''; } else { $id = $_REQUEST['id']; if (!isset($default_config[$id])) { print $GLOBALS['I18N']->get('invalid request'); return; } } #print '<div class="actions">'.PageLinkButton('configure&resetdefault=yes',s('Reset to default')).'</div>'; if (empty($_GET['id'])) { ## @@TODO might be an idea to allow reset on an "id" as well $button = new ConfirmButton(s('Are you sure you want to reset the configuration to the default?'), PageURL2('configure&resetdefault=yes', 'reset', ''), s('Reset to default')); print '<div class="fright">' . $button->show() . '</div>'; print Info(s('You can edit all of the values in this page, and click the "save changes" button once to save all the changes you made.'), 1); } $configCategories = array(); $configTypes = array(); foreach ($default_config as $item => $details) { if (empty($details['category'])) { $details['category'] = 'other'; } 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();
} # fix the new powered by image for the templates Sql_Query(sprintf('update %s set data = "%s",width=70,height=30 where filename = "powerphplist.png"', $tables["templateimage"], $newpoweredimage)); print '<script language="Javascript" type="text/javascript"> finish(); </script>'; # update the system pages while (list($type, $pages) = each($system_pages)) { foreach ($pages as $page) { Sql_Query(sprintf('replace into %s (page,type) values("%s","%s")', $tables["task"], $page, $type)); } } # mark the database to be our current version if ($success) { SaveConfig("version", VERSION, 0); # mark now to be the last time we checked for an update Sql_Query(sprintf('replace into %s (item,value,editable) values("updatelastcheck",now(),0)', $tables["config"])); Info("Success"); } else { Error("An error occurred while upgrading your database"); } } else { ?> <p>Your database requires upgrading, please make sure to create a backup of your database first.</p> <p>When you're ready click <?php echo PageLink2("upgrade", "Here", "doit=yes"); ?> . Depending on the size of your database, this may take quite a while. Please make sure not to interrupt the process, once you've started it.</p> <?php } } ?>
return; } } else { Error(s('Plugin directory is not writable')); } } else { Error(s('Invalid plugin package')); } print s('Plugin installation failed'); print '<hr/>' . PageLinkButton('plugins', s('Continue')); return; } if (defined('PLUGIN_ROOTDIR') && !is_writable(PLUGIN_ROOTDIR)) { Info(s('The plugin root directory is not writable, please install plugins manually')); } elseif (!class_exists('ZipArchive')) { Info(s('PHP has no <a href="http://php.net/zip">Zip capability</a>. This is required to allow installation from a remote URL')); } else { print '<h3>' . s('Install a new plugin') . '</h3>'; print '<p><a class="resourceslink" href="http://resources.phplist.com/plugins/" title="' . s('Find plugins') . '" target="_blank">' . s('Find plugins') . '</a></p>'; print formStart(); print '<fieldset> <label for="pluginurl">' . s('Plugin package URL') . '</label> <div type="field"><input type="text" id="pluginurl" name="pluginurl" /></div> <button type="submit" name="download">' . s('Install plugin') . '</button> </fieldset></form>'; } $ls = new WebblerListing(s('Installed plugins')); if (empty($GLOBALS['allplugins'])) { return; } ksort($GLOBALS['allplugins'], SORT_FLAG_CASE | SORT_STRING);
$sendtestresult .= '<script type="text/javascript">this.location.hash="sendTest";</script>'; } } elseif (isset($_POST['deleteattachments']) && is_array($_POST['deleteattachments']) && $id) { if (ALLOW_ATTACHMENTS) { // Delete Attachment button hit... $deleteattachments = $_POST['deleteattachments']; foreach ($deleteattachments as $attid) { $attDetails = Sql_fetch_assoc_query(sprintf('select filename from %s where id = %d', $tables['attachment'], $attid)); $phys_file = $GLOBALS['attachment_repository'] . '/' . $attDetails['filename']; $fileParts = pathinfo($phys_file); $phys_file2 = $GLOBALS['attachment_repository'] . '/' . $fileParts['filename']; ## to remove the file created by tempnam @unlink($phys_file); @unlink($phys_file2); $result = Sql_Query(sprintf('delete from %s where id = %d and messageid = %d', $tables['message_attachment'], $attid, $id)); print Info($GLOBALS['I18N']->get('Removed Attachment ')); } } } ############################## # Stacked attributes, processing and calculation ############################## ## moved to plugin ############################## # Stacked attributes, end ############################## echo $errormsg; if (!$done) { #$baseurl = sprintf('./?page=%s&id=%d',$_GET["page"],$id); if ($id) { $tabs = new WebblerTabs();
break; case "none": 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 {
<?php require_once dirname(__FILE__) . '/accesscheck.php'; if (TEST && strpos($_SERVER['HTTP_HOST'], 'phplist.org') !== false) { print Info($GLOBALS['I18N']->get('default login is') . ' admin, ' . $GLOBALS['I18N']->get('with password') . ' phplist') . '.'; } $page = ''; if (isset($_GET['page']) && $_GET['page']) { $page = $_GET['page']; if (!is_file($page . '.php') || $page == 'logout') { $page = $GLOBALS['homepage']; } } else { $page = $GLOBALS['homepage']; } if (!isset($GLOBALS['msg'])) { $GLOBALS['msg'] = ''; $msg_class = ''; } else { $msg_class = " class='result' "; } echo '<div ' . $msg_class . '>' . $GLOBALS['msg'] . '</div>'; ?> <script language="Javascript" type="text/javascript"> //<![CDATA[ if (!navigator.cookieEnabled) { document.writeln('<div class="error"><?php echo $GLOBALS['I18N']->get('In order to login, you need to enable cookies in your browser'); ?>
} } } Info($GLOBALS['I18N']->get('Changes saved')); } else { Info($GLOBALS['I18N']->get('Error adding new admin')); } } if ($_POST["setdefault"]) { Sql_Query("delete from {$tables["admin_task"]} where adminid = 0"); if (is_array($_POST["access"])) { while (list($key, $val) = each($_POST["access"])) { Sql_Query("insert into {$tables["admin_task"]} (adminid,taskid,level) values(0,{$key},{$val})"); } } Info($GLOBALS['I18N']->get('Current set of permissions made default')); } if ($_POST["resetaccess"]) { $reverse_accesscodes = array_flip($access_levels); $req = Sql_Query("select * from {$tables["task"]} order by type"); while ($row = Sql_Fetch_Array($req)) { $level = $system_pages[$row["type"]][$row["page"]]; Sql_Query(sprintf('replace into %s (adminid,taskid,level) values(%d,%d,%d)', $tables["admin_task"], $id, $row["id"], $reverse_accesscodes[$level])); } } if (isset($_GET["delete"]) && $_GET["delete"]) { # delete the index in delete 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"]));