本文整理汇总了PHP中e107::getCache方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getCache方法的具体用法?PHP e107::getCache怎么用?PHP e107::getCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getCache方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process($source = '')
{
global $_E107, $pref;
e107::getCache()->CachePageMD5 = '_';
e107::getCache()->set('emailLastBounce', time(), TRUE, FALSE, TRUE);
$strEmail = !$source ? $this->mailRead(-1) : file_get_contents(e_HANDLER . "eml/" . $source);
if (!$strEmail) {
return;
}
$multiArray = Bouncehandler::get_the_facts($strEmail);
$head = BounceHandler::parse_head($strEmail);
$e107_userid = isset($head['X-e107-id']) ? intval($head['X-e107-id']) : $this->getHeader($strEmail, 'X-e107-id');
if ($_E107['debug']) {
require_once e_HANDLER . "mail.php";
$message = "Your Bounce Handler is working. The data of the email you sent is displayed below.<br />";
if ($e107_userid) {
$message .= "A user-id was detected in the email you sent: <b>" . $e107_userid . "</b><br />";
}
$message .= "<br />";
$message .= "<pre>" . print_r($multiArray, TRUE) . "</pre>";
$message .= "<pre>" . $strEmail . "</pre>";
sendemail($pref['siteadminemail'], SITENAME . " :: Bounce-Handler.", $message, $pref['siteadmin'], $pref['siteadminemail'], $pref['siteadmin']);
}
if ($e107_userid && $this->setUser_Bounced($e107_userid) == TRUE) {
return;
}
/* echo "<pre>";
print_r($multiArray);
echo "</pre>";
*/
foreach ($multiArray as $the) {
$the['user_id'] = $head['X-e107-id'];
$the['user_email'] = $the['recipient'];
unset($the['recipient']);
switch ($the['action']) {
case 'failed':
e107::getEvent()->trigger('email-bounce-failed', $the);
$this->setUser_Bounced($the['user_email']);
break;
case 'transient':
// $num_attempts = delivery_attempts($the['user_email']);
e107::getEvent()->trigger('email-bounce-transient', $the);
if ($num_attempts > 10) {
$this->setUser_Bounced($the['user_email'], $the['user_id']);
} else {
// insert_into_queue($the['user_email'], ($num_attempts+1));
}
break;
case 'autoreply':
e107::getEvent()->trigger('email-bounce-autoreply', $the);
// postpone($the['user_email'], '7 days');
break;
default:
//don't do anything
break;
}
}
}
示例2: init
/**
* Retrieve menus, check visibility against
* current user classes and current page url
*
*/
public function init()
{
global $_E107;
if (vartrue($_E107['cli'])) {
return;
}
$menu_layout_field = THEME_LAYOUT != e107::getPref('sitetheme_deflayout') ? THEME_LAYOUT : "";
e107::getCache()->CachePageMD5 = md5(e_LANGUAGE . $menu_layout_field);
//FIXME add a function to the cache class for this.
// $menu_data = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE.$menu_layout_field));
$menu_data = e107::getCache()->retrieve_sys("menus_" . USERCLASS_LIST);
$menu_data = e107::getArrayStorage()->ReadArray($menu_data);
$eMenuArea = array();
// $eMenuList = array();
// $eMenuActive = array(); // DEPRECATED
if (!is_array($menu_data)) {
$menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN (' . USERCLASS_LIST . ') AND menu_layout = "' . $menu_layout_field . '" ORDER BY menu_location,menu_order';
if (e107::getDb()->db_Select_gen($menu_qry)) {
while ($row = e107::getDb()->db_Fetch()) {
$eMenuArea[$row['menu_location']][] = $row;
}
}
$menu_data['menu_area'] = $eMenuArea;
$menuData = e107::getArrayStorage()->WriteArray($menu_data, false);
e107::getCache()->set_sys('menus_' . USERCLASS_LIST, $menuData);
// e107::getCache()->set_sys('menus_'.USERCLASS_LIST.'_'.md5(e_LANGUAGE.$menu_layout_field), $menuData);
} else {
$eMenuArea = $menu_data['menu_area'];
}
$total = array();
foreach ($eMenuArea as $area => $val) {
foreach ($val as $row) {
if ($this->isVisible($row)) {
$path = str_replace("/", "", $row['menu_path']);
if (!isset($total[$area])) {
$total[$area] = 0;
}
$this->eMenuActive[$area][] = $row;
$total[$area]++;
}
}
}
e107::getRender()->eMenuTotal = $total;
}
示例3: sc_admin_coreupdate
function sc_admin_coreupdate($parm = '')
{
$che = e107::getCache();
$mes = e107::getMessage();
$che->setMD5(e_LANGUAGE);
$cacheData = $che->retrieve("releasecheck", 3600, TRUE);
// 2.0.1 | 'up-to-date' | false ;
$cacheData = 2.1;
// XXX Remove to test for real.
return false;
// XXX Remove to test for real.
if ($cacheData) {
return $this->cronUpdateRender($parm, $cacheData);
}
require_once e_HANDLER . "cron_class.php";
$cron = new _system_cron();
if ($result = $cron->checkCoreUpdate()) {
return $this->cronUpdateRender($parm, $cacheData);
}
}
示例4: getGlyphs
/**
* Get all Glyphs
*/
function getGlyphs($type = 'fa4', $prefix = '')
{
$icons = array();
if ($type == 'bs2') {
$matches = array('glass', 'music', 'search', 'envelope', 'heart', 'star', 'star-empty', 'user', 'film', 'th-large', 'th', 'th-list', 'ok', 'remove', 'zoom-in', 'zoom-out', 'off', 'signal', 'cog', 'trash', 'home', 'file', 'time', 'road', 'download-alt', 'download', 'upload', 'inbox', 'play-circle', 'repeat', 'refresh', 'list-alt', 'lock', 'flag', 'headphones', 'volume-off', 'volume-down', 'volume-up', 'qrcode', 'barcode', 'tag', 'tags', 'book', 'bookmark', 'print', 'camera', 'font', 'bold', 'italic', 'text-height', 'text-width', 'align-left', 'align-center', 'align-right', 'align-justify', 'list', 'indent-left', 'indent-right', 'facetime-video', 'picture', 'pencil', 'map-marker', 'adjust', 'tint', 'edit', 'share', 'check', 'move', 'step-backward', 'fast-backward', 'backward', 'play', 'pause', 'stop', 'forward', 'fast-forward', 'step-forward', 'eject', 'chevron-left', 'chevron-right', 'plus-sign', 'minus-sign', 'remove-sign', 'ok-sign', 'question-sign', 'info-sign', 'screenshot', 'remove-circle', 'ok-circle', 'ban-circle', 'arrow-left', 'arrow-right', 'arrow-up', 'arrow-down', 'share-alt', 'resize-full', 'resize-small', 'plus', 'minus', 'asterisk', 'exclamation-sign', 'gift', 'leaf', 'fire', 'eye-open', 'eye-close', 'warning-sign', 'plane', 'calendar', 'random', 'comment', 'magnet', 'chevron-up', 'chevron-down', 'retweet', 'shopping-cart', 'folder-close', 'folder-open', 'resize-vertical', 'resize-horizontal', 'hdd', 'bullhorn', 'bell', 'certificate', 'thumbs-up', 'thumbs-down', 'hand-right', 'hand-left', 'hand-up', 'hand-down', 'circle-arrow-right', 'circle-arrow-left', 'circle-arrow-up', 'circle-arrow-down', 'globe', 'wrench', 'tasks', 'filter', 'briefcase', 'fullscreen');
foreach ($matches as $match) {
$icons[] = $prefix . $match;
}
return $icons;
}
if ($type == 'bs3') {
$matches = array('adjust', 'align-center', 'align-justify', 'align-left', 'align-right', 'arrow-down', 'arrow-left', 'arrow-right', 'arrow-up', 'asterisk', 'backward', 'ban-circle', 'barcode', 'bell', 'bold', 'book
', 'bookmark', 'briefcase', 'bullhorn', 'calendar', 'camera', 'certificate', 'check', 'chevron-down', 'chevron-left', 'chevron-right', 'chevron-up', 'circle-arrow-down', 'circle-arrow-left', 'circle-arrow-right
', 'circle-arrow-up', 'cloud', 'cloud-download', 'cloud-upload', 'cog', 'collapse-down', 'collapse-up', 'comment', 'compressed', 'copyright-mark', 'credit-card', 'cutlery', 'dashboard', 'download', 'download-alt
', 'earphone', 'edit', 'eject', 'envelope', 'euro', 'exclamation-sign', 'expand', 'export', 'eye-close', 'eye-open', 'facetime-video', 'fast-backward', 'fast-forward', 'file', 'film', 'filter', 'fire', 'flag
', 'flash', 'floppy-disk', 'floppy-open', 'floppy-remove', 'floppy-save', 'floppy-saved', 'folder-close', 'folder-open', 'font', 'forward', 'fullscreen', 'gbp', 'gift
', 'glass', 'globe', 'hand-down', 'hand-left', 'hand-right', 'hand-up', 'hd-video', 'hdd', 'header', 'headphones', 'heart', 'heart-empty', 'home', 'import', 'inbox', 'indent-left', 'indent-right', 'info-sign', 'italic', 'leaf', 'link', 'list
', 'list-alt', 'lock', 'log-in', 'log-out', 'magnet', 'map-marker', 'minus', 'minus-sign', 'move', 'music', 'new-window', 'off', 'ok', 'ok-circle', 'ok-sign', 'open', 'paperclip', 'pause', 'pencil', 'phone', 'phone-alt', 'picture
', 'plane', 'play', 'play-circle', 'plus', 'plus-sign', 'print', 'pushpin', 'qrcode', 'question-sign', 'random', 'record', 'refresh', 'registration-mark', 'remove', 'remove-circle', 'remove-sign', 'repeat', 'resize-full', 'resize-horizontal
', 'resize-small', 'resize-vertical', 'retweet', 'road', 'save', 'saved', 'screenshot', 'sd-video', 'search', 'send', 'share', 'share-alt', 'shopping-cart', 'signal', 'sort', 'sort-by-alphabet', 'sort-by-alphabet-alt
', 'sort-by-attributes', 'sort-by-attributes-alt', 'sort-by-order', 'sort-by-order-alt', 'sound-5-1', 'sound-6-1', 'sound-7-1', 'sound-dolby', 'sound-stereo', 'star', 'stats', 'step-backward', 'step-forward', 'stop
', 'subtitles', 'tag', 'tags', 'tasks', 'text-height', 'text-width', 'th', 'th-large', 'th-list', 'thumbs-down', 'thumbs-up', 'time', 'tint', 'tower', 'transfer', 'trash', 'tree-conifer', 'tree-deciduous', 'unchecked', 'upload
', 'usd', 'user', 'volume-down', 'volume-off', 'volume-up', 'warning-sign', 'wrench', 'zoom-in', 'zoom-out');
foreach ($matches as $match) {
$icons[] = $prefix . $match;
}
return $icons;
}
$cache = e107::getCache();
$cache->setMD5('_' . $prefix . $type);
if ($data = $cache->retrieve($type, 360, true)) {
return e107::unserialize($data);
}
if ($type == 'fa4') {
$pattern = '/\\.(fa-(?:\\w+(?:-)?)+):before/';
$subject = e107::getFile()->getRemoteContent('http://netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css');
// print_a($subject);
} elseif ($type == 'fa3') {
$pattern = '/\\.(icon-(?:\\w+(?:-)?)+):before/';
$subject = file_get_contents(e_WEB_JS . 'font-awesome/css/font-awesome.css');
}
preg_match_all($pattern, $subject, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$icons[] = $prefix . substr($match[1], 3);
}
$data = e107::serialize($icons);
$cache->set($type, $data, true);
return $icons;
}
示例5: elseif
if ($sql->insert('newsfeed', $feed)) {
$admin_log->logArrayAll('NEWSFD_01', $feed);
$mes->addSuccess(LAN_CREATED);
} else {
$mes->addError(LAN_CREATED_FAILED . ': ' . $sql->mySQLerror);
}
} elseif (isset($_POST['updateFeed'])) {
$feed['WHERE'] = "newsfeed_id=" . intval($_POST['newsfeed_id']);
if ($sql->update('newsfeed', $feed)) {
$admin_log->logArrayAll('NEWSFD_02', $feed);
$mes->addSuccess(LAN_UPDATED);
} else {
$mes->addInfo(LAN_NO_CHANGE . ': ' . $sql->mySQLerror);
}
}
e107::getCache()->clear(NEWSFEED_LIST_CACHE_TAG);
// This should actually clear all the newsfeed data in one go
} else {
$mes->addError(LAN_REQUIRED_BLANK);
}
}
$ns->tablerender($caption, $mes->render() . $text);
if ($action == "delete") {
$sql->db_Delete('newsfeed', 'newsfeed_id=' . $id);
e107::getLog()->add('NEWSFD_03', 'ID: ' . $id, E_LOG_INFORMATIVE, '');
$mes->addSuccess(LAN_DELETED);
}
$ns->tablerender($caption, $mes->render() . $text);
if ($headline_total = $sql->db_Select("newsfeed")) {
$nfArray = $sql->rows();
$text = "\n\t<table class='table table-striped'>\n\t<colgroup>\n\t\t<col style='width: 5%; text-align: center;' />\n\t\t<col style='width: 40%;' />\n\t\t<col style='width: 10%; text-align: center;' />\n\t\t<col style='width: 25%; text-align: center;' />\n\t\t<col style='width: 10%; text-align: center;' />\n\t</colgroup>\n\t<thead>\n\t<tr>\n\t\t<th>" . LAN_ID . "</th>\n\t\t<th>" . LAN_NAME . "</th>\n\t\t<th>" . NFLAN_26 . "</th>\n\t\t<th>" . NFLAN_12 . "</th>\n\t\t<th class='center options'>" . LAN_OPTIONS . "</th>\n\t</tr>\n\t</thead>\n";
示例6: update_706_to_800
function update_706_to_800($type = '')
{
global $pref, $e107info;
global $sysprefs, $eArrayStorage;
//$mes = new messageLog; // Combined logging and message displaying handler
//$mes = e107::getMessage();
$log = e107::getAdminLog();
// Used for combined logging and message displaying
$sql = e107::getDb();
$sql2 = e107::getDb('sql2');
$tp = e107::getParser();
$ns = e107::getRender();
e107::getCache()->clearAll('db');
e107::getCache()->clearAll('system');
// List of unwanted $pref values which can go
$obs_prefs = array('frontpage_type', 'rss_feeds', 'log_lvcount', 'zone', 'upload_allowedfiletype', 'real', 'forum_user_customtitle', 'utf-compatmode', 'frontpage_method', 'standards_mode', 'image_owner', 'im_quality', 'signup_option_timezone', 'modules', 'plug_sc', 'plug_bb', 'plug_status', 'plug_latest', 'subnews_hide_news', 'upload_storagetype');
// List of DB tables not required (includes a few from 0.6xx)
$obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce');
// List of DB tables newly required (defined in core_sql.php) (The existing dblog table gets renamed)
// No Longer required. - automatically checked against core_sql.php.
// $new_tables = array('audit_log', 'dblog', 'news_rewrite', 'core_media', 'core_media_cat','cron', 'mail_recipients', 'mail_content');
// List of core prefs that need to be converted from serialized to e107ArrayStorage.
$serialized_prefs = array("'emote'", "'menu_pref'", "'search_prefs'", "'emote_default'", "'pm_prefs'");
$create_dir = array(e_MEDIA, e_SYSTEM, e_CACHE, e_CACHE_CONTENT, e_CACHE_IMAGE, e_CACHE_DB, e_LOG, e_BACKUP, e_CACHE_URL, e_TEMP, e_IMPORT);
foreach ($create_dir as $dr) {
if (!is_dir($dr)) {
mkdir($dr, 0755);
}
}
// List of changed DB tables (defined in core_sql.php)
// No Longer required. - automatically checked against core_sql.php.
// (primarily those which have changed significantly; for the odd field write some explicit code - it'll run faster)
// $changed_tables = array('user', 'dblog', 'admin_log', 'userclass_classes', 'banlist', 'menus',
// 'plugin', 'news', 'news_category', 'online', 'page', 'links', 'comments');
// List of changed DB tables from core plugins (defined in pluginname_sql.php file)
// key = plugin directory name. Data = comma-separated list of tables to check
// (primarily those which have changed significantly; for the odd field write some explicit code - it'll run faster)
// No Longer required. - automatically checked by db-verify
/* $pluginChangedTables = array('linkwords' => 'linkwords',
'featurebox' => 'featurebox',
'links_page' => 'links_page',
'poll' => 'polls',
'content' => 'pcontent'
);
*/
/*
$setCorePrefs = array( //modified prefs during upgrade.
'adminstyle' => 'infopanel',
'admintheme' => 'bootstrap',
'admincss' => 'admin_style.css',
'resize_dimensions' => array(
'news-image' => array('w' => 250, 'h' => 250),
'news-bbcode' => array('w' => 250, 'h' => 250),
'page-bbcode' => array('w' => 250, 'h' => 250)
)
);
*/
$do_save = TRUE;
// List of changed menu locations.
$changeMenuPaths = array(array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'compliance_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'powered_by_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'counter_menu'), array('oldpath' => 'siteinfo_menu', 'newpath' => 'siteinfo', 'menu' => 'latestnews_menu'), array('oldpath' => 'compliance_menu', 'newpath' => 'siteinfo', 'menu' => 'compliance_menu'), array('oldpath' => 'powered_by_menu', 'newpath' => 'siteinfo', 'menu' => 'powered_by_menu'), array('oldpath' => 'sitebutton_menu', 'newpath' => 'siteinfo', 'menu' => 'sitebutton_menu'), array('oldpath' => 'counter_menu', 'newpath' => 'siteinfo', 'menu' => 'counter_menu'), array('oldpath' => 'usertheme_menu', 'newpath' => 'user', 'menu' => 'usertheme_menu'), array('oldpath' => 'userlanguage_menu', 'newpath' => 'user', 'menu' => 'userlanguage_menu'), array('oldpath' => 'lastseen_menu', 'newpath' => 'online', 'menu' => 'lastseen_menu'), array('oldpath' => 'other_news_menu', 'newpath' => 'news', 'menu' => 'other_news_menu'), array('oldpath' => 'other_news_menu', 'newpath' => 'news', 'menu' => 'other_news2_menu'), array('oldpath' => 'user_menu', 'newpath' => 'user', 'menu' => 'usertheme_menu'), array('oldpath' => 'user_menu', 'newpath' => 'user', 'menu' => 'userlanguage_menu'), array('oldpath' => 'poll_menu', 'newpath' => 'poll', 'menu' => 'poll_menu'), array('oldpath' => 'banner_menu', 'newpath' => 'banner', 'menu' => 'banner_menu'), array('oldpath' => 'online_menu', 'newpath' => 'online', 'menu' => 'online_menu'));
// List of DB tables (key) and field (value) which need changing to accommodate IPV6 addresses
$ip_upgrade = array('download_requests' => 'download_request_ip', 'submitnews' => 'submitnews_ip', 'tmp' => 'tmp_ip', 'chatbox' => 'cb_ip');
$db_parser = new db_table_admin();
// Class to read table defs and process them
$do_save = FALSE;
// Set TRUE to update prefs when update complete
$updateMessages = array();
// Used to log actions for the admin log - TODO: will go once all converted to new class
$just_check = $type == 'do' ? FALSE : TRUE;
// TRUE if we're just seeing whether an update is needed
// if (!$just_check)
// {
// foreach(vartrue($setCorePrefs) as $k=>$v)
// {
// $pref[$k] = $v;
// }
// }
if (!$just_check) {
$log->logMessage(LAN_UPDATE_14 . $e107info['e107_version'], E_MESSAGE_NODISPLAY);
}
$statusTexts = array(E_MESSAGE_SUCCESS => 'Success', E_MESSAGE_ERROR => 'Fail', E_MESSAGE_INFO => 'Info');
if (isset($pref['forum_user_customtitle']) && !isset($pref['signup_option_customtitle'])) {
if ($just_check) {
return update_needed('pref: forum_user_customtitle needs to be renamed');
}
$pref['signup_option_customtitle'] = $pref['forum_user_customtitle'];
unset($pref['forum_user_customtitle']);
$log->logMessage(LAN_UPDATE_20 . 'customtitle', E_MESSAGE_SUCCESS);
$do_save = TRUE;
}
// convert all serialized core prefs to e107 ArrayStorage;
$serialz_qry = "SUBSTRING( e107_value,1,5)!='array' AND e107_value !='' ";
$serialz_qry .= "AND e107_name IN (" . implode(",", $serialized_prefs) . ") ";
if (e107::getDb()->select("core", "*", $serialz_qry)) {
if ($just_check) {
return update_needed('Convert serialized core prefs');
}
while ($row = e107::getDb()->fetch(MYSQL_ASSOC)) {
$status = e107::getDb('sql2')->update('core', "e107_value=\"" . convert_serialized($row['e107_value']) . "\" WHERE e107_name='" . $row['e107_name'] . "'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
//.........这里部分代码省略.........
示例7: delete_extended
function delete_extended($_name)
{
$ue = e107::getUserExt();
$log = e107::getAdminLog();
$mes = e107::getMessage();
if ($ue->user_extended_remove($_name, $_name)) {
$log->add('EUF_07', $_name, E_LOG_INFORMATIVE);
$mes->addSuccess(LAN_DELETED . " [" . $_name . "]");
e107::getCache()->clear_sys('user_extended_struct', true);
} else {
$mes->addError(LAN_ERROR . " [" . $_name . "]");
}
}
示例8: afterDelete
public function afterDelete($del_data, $id)
{
e107::getCache()->clear_sys('forum_perms');
}
示例9: afterUpdate
public function afterUpdate($new_data, $old_data, $id)
{
e107::getCache()->clear("wmessage");
}
示例10: show_prefs
function show_prefs($mailAdmin)
{
global $pref;
$e107 = e107::getInstance();
$frm = e107::getForm();
$mes = e107::getMessage();
e107::getCache()->CachePageMD5 = '_';
$lastload = e107::getCache()->retrieve('emailLastBounce', FALSE, TRUE, TRUE);
$lastBounce = round((time() - $lastload) / 60);
$lastBounceText = $lastBounce > 1256474 ? "<b>Never</b>" : "<b>" . $lastBounce . " minutes </b>ago.";
$text = "\n\t\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='mailsettingsform'>\n\t\t<fieldset id='mail'>\n\t\t<legend>" . LAN_MAILOUT_110 . "</legend>\n\t\t<table class='table adminform'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td>" . LAN_MAILOUT_110 . "<br /></td>\n\t\t\t<td>" . $frm->admin_button('testemail', LAN_MAILOUT_112, 'other') . " \n\t\t\t<input name='testaddress' class='tbox' type='text' size='40' maxlength='80' value=\"" . (varset($_POST['testaddress']) ? $_POST['testaddress'] : USEREMAIL) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td style='vertical-align:top'>" . LAN_MAILOUT_115 . "<br /></td>\n\t\t<td>\n\t\t<select class='tbox' name='mailer' onchange='disp(this.value)'>\n";
$mailers = array('php', 'smtp', 'sendmail');
foreach ($mailers as $opt) {
$sel = $pref['mailer'] == $opt ? "selected='selected'" : '';
$text .= "<option value='{$opt}' {$sel}>{$opt}</option>\n";
}
$text .= "</select> <span class='field-help'>" . LAN_MAILOUT_116 . "</span><br />";
// SMTP. -------------->
$smtp_opts = explode(',', varset($pref['smtp_options'], ''));
$smtpdisp = $pref['mailer'] != 'smtp' ? "style='display:none;'" : '';
$text .= "<div id='smtp' {$smtpdisp}>\n\t\t<table class='table adminlist' style='margin-right:auto;margin-left:0px;border:0px'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t";
$text .= "\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_87 . ": </td>\n\t\t<td>\n\t\t<input class='tbox' type='text' name='smtp_server' size='40' value='" . $pref['smtp_server'] . "' maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_88 . ": (" . LAN_OPTIONAL . ") </td>\n\t\t<td style='width:50%;' >\n\t\t<input class='tbox' type='text' name='smtp_username' size='40' value=\"" . $pref['smtp_username'] . "\" maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_89 . ": (" . LAN_OPTIONAL . ") </td>\n\t\t<td>\n\t\t<input class='tbox' type='password' name='smtp_password' size='40' value='" . $pref['smtp_password'] . "' maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_90 . "</td><td>\n\t\t<select class='tbox' name='smtp_options'>\n\n\t\t<option value=''>" . LAN_MAILOUT_96 . "</option>\n";
$selected = in_array('secure=SSL', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_ssl'{$selected}>" . LAN_MAILOUT_92 . "</option>\n";
$selected = in_array('secure=TLS', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_tls'{$selected}>" . LAN_MAILOUT_93 . "</option>\n";
$selected = in_array('pop3auth', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_pop3auth'{$selected}>" . LAN_MAILOUT_91 . "</option>\n";
$text .= "</select>\n<br />" . LAN_MAILOUT_94 . "</td></tr>";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_57 . "</td><td>\n\t\t";
$checked = varsettrue($pref['smtp_keepalive']) ? "checked='checked'" : '';
$text .= "<input type='checkbox' name='smtp_keepalive' value='1' {$checked} />\n\t\t</td>\n\t\t</tr>";
$checked = in_array('useVERP', $smtp_opts) ? "checked='checked'" : "";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_95 . "</td><td>\n\t\t<input type='checkbox' name='smtp_useVERP' value='1' {$checked} />\n\t\t</td>\n\t\t</tr>\n\t\t</table></div>";
/* FIXME - posting SENDMAIL path triggers Mod-Security rules.
// Sendmail. -------------->
$senddisp = ($pref['mailer'] != 'sendmail') ? "style='display:none;'" : '';
$text .= "<div id='sendmail' {$senddisp}><table style='margin-right:0px;margin-left:auto;border:0px'>";
$text .= "
<tr>
<td>".LAN_MAILOUT_20.": </td>
<td>
<input class='tbox' type='text' name='sendmail' size='60' value=\"".(!$pref['sendmail'] ? "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'] : $pref['sendmail'])."\" maxlength='80' />
</td>
</tr>
</table></div>";
*/
$text .= "</td>\n\t</tr>\n\n\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_222 . "</td>\n\t\t<td>";
$text .= $mailAdmin->sendStyleSelect(varset($pref['mail_sendstyle'], 'textonly'), 'mail_sendstyle');
$text .= "<span class='field-help'>" . LAN_MAILOUT_223 . "</span>\n\t\t</td>\n\t</tr>\n\n\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_25 . "</td>\n\t\t<td> " . LAN_MAILOUT_26 . "\n\t\t<input class='tbox e-spinner' size='3' type='text' name='mail_pause' value='" . $pref['mail_pause'] . "' /> " . LAN_MAILOUT_27 . "<input class='tbox e-spinner' size='3' type='text' name='mail_pausetime' value='" . $pref['mail_pausetime'] . "' /> " . LAN_MAILOUT_29 . ".<br />\n\t\t<span class='field-help'>" . LAN_MAILOUT_30 . "</span>\n\t\t</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_156 . "</td>\n\t\t<td><input class='tbox e-spinner' size='3' type='text' name='mail_workpertick' value='" . varset($pref['mail_workpertick'], 5) . "' />\n\t\t<span class='field-help'>" . LAN_MAILOUT_157 . "</span>\n\t\t</td>\n\t</tr>\n";
if (isset($pref['e_mailout_list'])) {
// Allow selection of email address sources
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_77 . "</td>\n\t\t<td> \n\t ";
$mail_enable = explode(',', $pref['mailout_enabled']);
foreach ($pref['e_mailout_list'] as $mailer => $v) {
$check = in_array($mailer, $mail_enable) ? "checked='checked'" : "";
$text .= " <input type='checkbox' name='mail_mailer_enabled[]' value='{$mailer}' {$check} /> {$mailer}<br />";
}
$text .= "</td></tr>\n";
}
list($mail_log_option, $mail_log_email) = explode(',', varset($pref['mail_log_options'], '0,0'));
$check = $mail_log_email == 1 ? " checked='checked'" : "";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_72 . "</td>\n\t\t<td> \n\t\t<select class='tbox' name='mail_log_option'>\n\n\t\t<option value='0'" . ($mail_log_option == 0 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_73 . "</option>\n\n\t\t<option value='1'" . ($mail_log_option == 1 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_74 . "</option>\n\n\t\t<option value='2'" . ($mail_log_option == 2 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_75 . "</option>\n\n\t\t<option value='3'" . ($mail_log_option == 3 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_119 . "</option>\n\n\t\t</select>\n\n\t\t<input type='checkbox' name='mail_log_email' value='1' {$check} />" . LAN_MAILOUT_76 . "</td>\n\t</tr>\n";
$text .= "</table></fieldset>\n\t<fieldset id='core-mail-prefs-bounce'>\n\t\t<legend>" . LAN_MAILOUT_31 . "</legend>\n\t\t<table class='table adminform'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_231 . "</td><td>";
// bounce divs = mail_bounce_none, mail_bounce_auto, mail_bounce_mail
$autoDisp = $pref['mail_bounce'] != 'auto' ? "style='display:none;'" : '';
$autoMail = $pref['mail_bounce'] != 'mail' ? "style='display:none;'" : '';
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
$text .= "<select name='mail_bounce' class='tbox' onchange='bouncedisp(this.value)'>\n<option value=''> </option>\n";
foreach ($bounceOpts as $k => $v) {
$selected = $pref['mail_bounce'] == $k ? " selected='selected'" : '';
$text .= "<option value='{$k}'{$selected}>{$v}</option>\n";
}
$text .= "</select>\n</td>\n\t</tr></tbody></table>\n\n\n\t\t<table class='adminform' id='mail_bounce_auto' {$autoDisp}>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr><td>" . LAN_MAILOUT_32 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email2' value=\"" . $pref['mail_bounce_email'] . "\" /></td></tr>\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_233 . "</td><td><b>" . e_DOCROOT . e107::getFolder('handlers') . "bounce_handler.php</b>";
if (!is_readable(e_HANDLER . 'bounce_handler.php')) {
$text .= "<br /><span class='required'>" . LAN_MAILOUT_161 . '</span>';
} elseif (!is_executable(e_HANDLER . 'bounce_handler.php')) {
$text .= "<br /><span class='required'>" . LAN_MAILOUT_162 . '</span>';
}
$text .= "<br /><span class='field-help'>" . LAN_MAILOUT_235 . "</span></td></tr>\n\t<tr><td>" . LAN_MAILOUT_236 . "</td><td>" . $lastBounceText . "</td></tr>\n\t</tbody></table>";
// Parameters for mail-account based bounce processing
$text .= "\n\t\t<table class='table adminform' id='mail_bounce_mail' {$autoMail}>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr><td>" . LAN_MAILOUT_32 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"" . $pref['mail_bounce_email'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_33 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"" . $pref['mail_bounce_pop3'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_34 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"" . $pref['mail_bounce_user'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_35 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_pass' value=\"" . $pref['mail_bounce_pass'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_120 . "</td><td><select class='tbox' name='mail_bounce_type'>\n\n\t\t\t<option value=''> </option>\n\n\t\t\t<option value='pop3'" . ($pref['mail_bounce_type'] == 'pop3' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_121 . "</option>\n\n\t\t\t<option value='pop3/notls'" . ($pref['mail_bounce_type'] == 'pop3/notls' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_122 . "</option>\n\n\t\t\t<option value='pop3/tls'" . ($pref['mail_bounce_type'] == 'pop3/tls' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_123 . "</option>\n\n\t\t\t<option value='imap'" . ($pref['mail_bounce_type'] == 'imap' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_124 . "</option>\n\n\t\t</select></td></tr>\n\n\t\t";
$check = $pref['mail_bounce_delete'] == 1 ? " checked='checked'" : "";
$text .= "<tr><td>" . LAN_MAILOUT_36 . "</td><td><input type='checkbox' name='mail_bounce_delete' value='1' {$check} /></td></tr>";
$check = $pref['mail_bounce_auto'] == 1 ? " checked='checked'" : "";
$text .= "<tr><td>" . LAN_MAILOUT_245 . "</td><td><input type='checkbox' name='mail_bounce_auto' value='1' {$check} /><span class='field-help'> " . LAN_MAILOUT_246 . "</span></td></tr>\n\n\t</tbody>\n\t</table></fieldset>\n\n\t<div class='buttons-bar center'>" . $frm->admin_button('updateprefs', LAN_MAILOUT_28, 'update') . "</div>\n\n\t</form>";
$caption = ADLAN_136 . ' :: ' . LAN_PREFS;
$e107->ns->tablerender($caption, $mes->render() . $text);
}
示例11: realpath
$_E107['cli'] = TRUE;
$_E107['debug'] = false;
$_E107['no_online'] = TRUE;
$_E107['no_forceuserupdate'] = TRUE;
$_E107['no_menus'] = TRUE;
// we allow theme init as cron jobs might need to access current theme templates (e.g. custom email templates)
require_once realpath(dirname(__FILE__) . "/class2.php");
$pwd = $_E107['debug'] && $_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]);
if ($pref['e_cron_pwd'] != $pwd) {
require_once e_HANDLER . "mail.php";
$message = "Your Cron Schedule is not configured correctly. Your passwords do not match.\n\t\t<br /><br /> \n\t\tSent from cron: " . $pwd . "<br />\n\t\tStored in e107: " . $pref['e_cron_pwd'] . "<br /><br />\n\t\tYou should regenerate the cron command in admin and enter it again in your server configuration. \n\t\t";
sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'], $pref['siteadminemail'], $pref['siteadmin']);
exit;
}
e107::getCache()->CachePageMD5 = '_';
e107::getCache()->set('cronLastLoad', time(), TRUE, FALSE, TRUE);
// from the plugin directory:
// realpath(dirname(__FILE__)."/../../")."/";
$list = array();
$sql = e107::getDb();
if ($sql->db_Select("cron", 'cron_function,cron_tab', 'cron_active =1')) {
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) {
list($class, $function) = explode("::", $row['cron_function'], 2);
$key = $class . "__" . $function;
$list[$key] = array('path' => $class, 'active' => 1, 'tab' => $row['cron_tab'], 'function' => $function, 'class' => $class);
}
}
// foreach($pref['e_cron_pref'] as $func=>$cron)
// {
// if($cron['active']==1)
// {
示例12: md5
<?php
/**
* Copyright (C) 2008-2011 e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id$
*
* News categories menu
*/
if (!defined('e107_INIT')) {
exit;
}
$cacheString = 'nq_news_categories_menu_' . md5(serialize($parm));
$cached = e107::getCache()->retrieve($cacheString);
if (false === $cached) {
e107::plugLan('news');
if (is_string($parm)) {
parse_str($parm, $parms);
} else {
$parms = $parm;
}
$ctree = e107::getObject('e_news_category_tree', null, e_HANDLER . 'news_class.php');
$template = e107::getTemplate('news', 'news_menu', 'category');
$cached = $ctree->loadActive()->render($template, $parms, true);
e107::getCache()->set($cacheString, $cached);
}
echo $cached;
示例13: updateReply
/**
* @param $id of the post
*/
function updateReply()
{
$mes = e107::getMessage();
$ns = e107::getRender();
if (empty($_POST['post'])) {
$mes->addError(LAN_FORUM_3007);
return;
}
if ($this->isAuthor() == false) {
$mes->addError(LAN_FORUM_3009);
return;
}
$postVals['post_edit_datestamp'] = time();
$postVals['post_edit_user'] = USERID;
$postVals['post_entry'] = $_POST['post'];
$this->forumObj->postUpdate($this->data['post_id'], $postVals);
e107::getCache()->clear('newforumposts');
// $url = e107::getUrl()->create('forum/thread/post', "id={$this->data['post_id']}", 'encode=0&full=1'); // XXX what data is available, find thread name
$url = e107::url('forum', 'topic', $this->data);
// ."&f=post";
$this->redirect($url);
exit;
}
示例14: processActivationLink
private function processActivationLink()
{
global $userMethods;
$sql = e107::getDb();
$tp = e107::getParser();
$ns = e107::getRender();
$log = e107::getLog();
$pref = e107::pref('core');
$qs = explode('.', e_QUERY);
if ($qs[0] == 'activate' && (count($qs) == 3 || count($qs) == 4) && $qs[2]) {
// FIXME TODO use generic multilanguage selection => e107::coreLan();
// return the message in the correct language.
if (isset($qs[3]) && strlen($qs[3]) == 2) {
require_once e_HANDLER . 'language_class.php';
$slng = new language();
$the_language = $slng->convert($qs[3]);
if (is_readable(e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE)) {
include e_LANGUAGEDIR . $the_language . '/lan_' . e_PAGE;
} else {
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
}
} else {
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
}
e107::getCache()->clear("online_menu_totals");
if ($sql->select("user", "*", "user_sess='" . $tp->toDB($qs[2], true) . "' ")) {
if ($row = $sql->fetch()) {
$dbData = array();
$dbData['WHERE'] = " user_sess='" . $tp->toDB($qs[2], true) . "' ";
$dbData['data'] = array('user_ban' => '0', 'user_sess' => '');
// Set initial classes, and any which the user can opt to join
if ($init_class = $userMethods->userClassUpdate($row, 'userfull')) {
//print_a($init_class); exit;
$dbData['data']['user_class'] = $init_class;
}
$userMethods->addNonDefaulted($dbData);
validatorClass::addFieldTypes($userMethods->userVettingInfo, $dbData);
$newID = $sql->update('user', $dbData);
if ($newID === false) {
$log->e_log_event(10, debug_backtrace(), 'USER', 'Verification Fail', print_r($row, true), false, LOG_TO_ROLLING);
$ns->tablerender(LAN_SIGNUP_75, LAN_SIGNUP_101);
return false;
}
// Log to user audit log if enabled
$log->user_audit(USER_AUDIT_EMAILACK, $row);
e107::getEvent()->trigger('userveri', $row);
// Legacy event
e107::getEvent()->trigger('user_signup_activated', $row);
e107::getEvent()->trigger('userfull', $row);
// 'New' event
if (varset($pref['autologinpostsignup'])) {
require_once e_HANDLER . 'login.php';
$usr = new userlogin();
$usr->login($row['user_loginname'], md5($row['user_name'] . $row['user_password'] . $row['user_join']), 'signup', '');
}
$text = "<div class='alert alert-success'>" . LAN_SIGNUP_74 . " <a href='index.php'>" . LAN_SIGNUP_22 . "</a> " . LAN_SIGNUP_23 . "<br />" . LAN_SIGNUP_24 . " " . SITENAME . "</div>";
$ns->tablerender(LAN_SIGNUP_75, $text);
}
} else {
// Invalid activation code
$log->e_log_event(10, debug_backtrace(), 'USER', 'Invalid Verification URL', print_r($qs, true), false, LOG_TO_ROLLING);
echo e107::getMessage()->addError("Invalid URL")->render();
// header("location: ".e_BASE."index.php");
return false;
}
}
}
示例15: afterDelete
public function afterDelete($deleted_data, $id, $deleted_check)
{
e107::getCache()->clear_sys(LW_CACHE_TAG);
}