1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
SecretR
2014-11-18 21:39:10 +02:00
14 changed files with 172 additions and 49 deletions

View File

@@ -980,7 +980,7 @@ if(varset($pref['force_userupdate']) && USER && !isset($_E107['no_forceuserupdat
$sql->db_Mark_Time('Start: Signup/splash/admin'); $sql->db_Mark_Time('Start: Signup/splash/admin');
if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || $pref['maintainance_flag']) if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || ($pref['maintainance_flag'] && empty($_E107['cli'])))
{ {
//XXX move force_userupdate() also? //XXX move force_userupdate() also?
e107::getRedirect()->checkMaintenance(); e107::getRedirect()->checkMaintenance();

View File

@@ -4,35 +4,32 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
|| e107 website system || e107 website system
| |
| Copyright (C) 2008-2009 e107 Inc | Copyright (C) 2008-2014 e107 Inc
| http://e107.org | http://e107.org
| |
| |
| Released under the terms and conditions of the | Released under the terms and conditions of the
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/cron.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/ */
// Usage: [full path to this script]cron.php --u=admin --p=password // use your admin login. // Usage: [full path to this script]cron.php --u=admin --p=password // use your admin login.
// test // test
$_E107['cli'] = TRUE; $_E107['cli'] = true;
$_E107['debug'] = false; $_E107['debug'] = false;
$_E107['no_online'] = TRUE; $_E107['no_online'] = true;
$_E107['no_forceuserupdate'] = TRUE; $_E107['no_forceuserupdate'] = true;
$_E107['no_menus'] = TRUE; $_E107['no_menus'] = true;
$_E107['allow_guest'] = true; // allow crons to run while in members-only mode.
// we allow theme init as cron jobs might need to access current theme templates (e.g. custom email templates) // 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")); require_once(realpath(dirname(__FILE__)."/class2.php"));
$pwd = ($_E107['debug'] && $_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]); $pwd = ($_E107['debug'] && $_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]);
if(empty($pwd) && !empty($_GET['token'])) if(!empty($_GET['token']))
{ {
$pwd = $_GET['token']; $pwd = $_GET['token'];
} }
@@ -48,9 +45,12 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
You should regenerate the cron command in admin and enter it again in your server configuration. You should regenerate the cron command in admin and enter it again in your server configuration.
"; ";
$message .= "<h4>Debug Info</h4>"; $message .= "<h2>Debug Info</h2>";
$message .= "<h3>_SERVER</h3>";
$message .= print_a($_SERVER,true); $message .= print_a($_SERVER,true);
$message .= "<h3>_ENV</h3>";
$message .= print_a($_ENV,true); $message .= print_a($_ENV,true);
$message .= "<h3>_GET</h3>";
$message .= print_a($_GET,true); $message .= print_a($_GET,true);
sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);

View File

@@ -848,6 +848,28 @@ class mailout_main_ui extends e_admin_ui
</td> </td>
</tr> </tr>
<tr>
<td>".LAN_MAILOUT_77."</td>
<td> ";
$mail_enable = explode(',',vartrue($pref['mailout_enabled'],'core'));
$coreCheck = (in_array('core',$mail_enable)) ? "checked='checked'" : "";
$text .= $frm->checkbox('mail_mailer_enabled[]','core', $coreCheck, 'users');
if(!empty($pref['e_mailout_list']))
{
foreach ($pref['e_mailout_list'] as $mailer => $v)
{
$check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : "";
$text .= $frm->checkbox('mail_mailer_enabled[]',$mailer,$check,$mailer);
// $text .= "&nbsp;<input type='checkbox' name='mail_mailer_enabled[]' value='{$mailer}' {$check} /> {$mailer}<br />";
}
}
$text .= "</td></tr>
<tr> <tr>
<td style='vertical-align:top'>".LAN_MAILOUT_115."<br /></td> <td style='vertical-align:top'>".LAN_MAILOUT_115."<br /></td>
<td> <td>
@@ -965,29 +987,10 @@ class mailout_main_ui extends e_admin_ui
<td>".LAN_MAILOUT_156."</td> <td>".LAN_MAILOUT_156."</td>
<td>".$frm->number('mail_workpertick',varset($pref['mail_workpertick'],5))."<span class='field-help'>".LAN_MAILOUT_157."</span> <td>".$frm->number('mail_workpertick',varset($pref['mail_workpertick'],5))."<span class='field-help'>".LAN_MAILOUT_157."</span>
</td> </td>
</tr>\n"; </tr>
if (isset($pref['e_mailout_list'])) // Allow selection of email address sources
{
$text .= "
<tr>
<td>".LAN_MAILOUT_77."</td>
<td> ";
$mail_enable = explode(',',$pref['mailout_enabled']); ";
$coreCheck = (in_array('core',$mail_enable)) ? "checked='checked'" : "";
$text .= $frm->checkbox('mail_mailer_enabled[]','core', $coreCheck, 'users');
foreach ($pref['e_mailout_list'] as $mailer => $v)
{
$check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : "";
$text .= $frm->checkbox('mail_mailer_enabled[]',$mailer,$check,$mailer);
// $text .= "&nbsp;<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')); list($mail_log_option,$mail_log_email) = explode(',',varset($pref['mail_log_options'],'0,0'));

View File

@@ -2318,9 +2318,17 @@ TEMPLATE;
switch ($type) switch ($type)
{ {
case 'date':
case 'datetime':
$array = array(
'text' => "Text Box",
"hidden" => "Hidden"
);
break;
case 'int': case 'int':
case 'tinyint': case 'tinyint':
case 'bigint':
case 'smallint': case 'smallint':
$array = array( $array = array(
"boolean" => "True/False", "boolean" => "True/False",
@@ -2399,10 +2407,14 @@ TEMPLATE;
{ {
$name = $tmp[2]; $name = $tmp[2];
} }
else // Link_description elseif(count($tmp) == 2) // Link_description
{ {
$name = $tmp[1]; $name = $tmp[1];
} }
elseif(count($tmp) === 1)
{
$name = $data;
}
$ret['title'] = ucfirst($name); $ret['title'] = ucfirst($name);
$ret['width'] = 'auto'; $ret['width'] = 'auto';

View File

@@ -3822,7 +3822,7 @@ class e_admin_controller_ui extends e_admin_controller
} }
// Debug Filter Query. // Debug Filter Query.
e107::getMessage()->addDebug('QRY='.$qry); e107::getMessage()->addDebug('QRY='.str_replace('#', MPREFIX, $qry));
// echo $qry.'<br />'; // echo $qry.'<br />';
// print_a($this->fields); // print_a($this->fields);
// print_a($_GET); // print_a($_GET);

View File

@@ -224,7 +224,7 @@ class e_chart
* @param array $data * @param array $data
* @param string $id of canvas element * @param string $id of canvas element
*/ */
public function setData($data,$id) public function setData($data)
{ {
$this->id = $id; $this->id = $id;
if($data == 'demo') if($data == 'demo')

View File

@@ -1450,6 +1450,11 @@ class e107
*/ */
public static function serialize($ArrayData, $AddSlashes = false) public static function serialize($ArrayData, $AddSlashes = false)
{ {
if(empty($ArrayData))
{
return array();
}
return self::getArrayStorage()->serialize($ArrayData, $AddSlashes); return self::getArrayStorage()->serialize($ArrayData, $AddSlashes);
} }
@@ -1461,6 +1466,11 @@ class e107
*/ */
public static function unserialize($ArrayData) public static function unserialize($ArrayData)
{ {
if(empty($ArrayData))
{
return array();
}
return self::getArrayStorage()->unserialize($ArrayData); return self::getArrayStorage()->unserialize($ArrayData);
} }

View File

@@ -1618,7 +1618,7 @@ class e_parse extends e_parser
// Convert URL's to clickable links, unless modifiers or prefs override // Convert URL's to clickable links, unless modifiers or prefs override
if ($opts['link_click']) if ($opts['link_click'])
{ {
if ($opts['link_replace']) if ($opts['link_replace'] && ADMIN_AREA !== true)
{ {
$_ext = ($pref['links_new_window'] ? " rel=\"external\"" : ""); $_ext = ($pref['links_new_window'] ? " rel=\"external\"" : "");
$link_text = $pref['link_text']; $link_text = $pref['link_text'];

View File

@@ -3291,6 +3291,19 @@ class e_form
case 'boolean': case 'boolean':
$false = vartrue($parms['trueonly']) ? "" : ADMIN_FALSE_ICON; $false = vartrue($parms['trueonly']) ? "" : ADMIN_FALSE_ICON;
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
{
$false = ($value === '') ? "&square;" : "&cross;";
$value = intval($value);
$wparms = (vartrue($parms['reverse'])) ? array(0=>'&check;', 1=>$false) : array(0=>$false, 1=>'&check;'); //TODO LAN
$dispValue = $wparms[$value];
return $this->renderInline($field, $id, $attributes['title'], $value, $dispValue, 'select', $wparms);
}
if(vartrue($parms['reverse'])) if(vartrue($parms['reverse']))
{ {
$value = ($value) ? $false : ADMIN_TRUE_ICON; $value = ($value) ? $false : ADMIN_TRUE_ICON;
@@ -3299,6 +3312,7 @@ class e_form
{ {
$value = $value ? ADMIN_TRUE_ICON : $false; $value = $value ? ADMIN_TRUE_ICON : $false;
} }
break; break;
case 'url': case 'url':
@@ -3378,7 +3392,23 @@ class e_form
return (vartrue($parms['show']) ? ($value ? $value : vartrue($parms['empty'])) : ''); return (vartrue($parms['show']) ? ($value ? $value : vartrue($parms['empty'])) : '');
break; break;
case 'lanlist': case 'language': // All Known Languages.
if(!empty($value))
{
if(strlen($value) === 2)
{
return e107::getLanguage()->convert($value);
}
else
{
return $value;
}
}
break;
case 'lanlist': // installed languages.
$options = e107::getLanguage()->getLanSelectArray(); $options = e107::getLanguage()->getLanSelectArray();
if($options) // FIXME - add support for multi-level arrays (option groups) if($options) // FIXME - add support for multi-level arrays (option groups)
@@ -3773,9 +3803,10 @@ class e_form
$ret = $ret.$this->hidden($key, $value); $ret = $ret.$this->hidden($key, $value);
break; break;
case 'lanlist': case 'lanlist': // installed languages
case 'language': case 'language': // all languages
$options = e107::getLanguage()->getLanSelectArray();
$options = ($attributes['type'] === 'language') ? e107::getLanguage()->getList() : e107::getLanguage()->getLanSelectArray();
$eloptions = vartrue($parms['__options'], array()); $eloptions = vartrue($parms['__options'], array());
if(!is_array($eloptions)) parse_str($eloptions, $eloptions); if(!is_array($eloptions)) parse_str($eloptions, $eloptions);

View File

@@ -616,4 +616,13 @@ class language{
} }
return $this->_select_array; return $this->_select_array;
} }
/**
* Return an array of all language types.
*/
public function getList()
{
return $this->list;
}
} }

View File

@@ -218,6 +218,18 @@ class e107MailManager
{ {
$this->e107 = e107::getInstance(); $this->e107 = e107::getInstance();
$this->mailOverrides = $overrides; $this->mailOverrides = $overrides;
if(deftrue('e_DEBUG'))
{
$this->debugMode = true;
}
if($this->debugMode === true)
{
e107::getMessage()->addWarning('Debug Mode is active. Emailing will only be simulated!');
}
} }
@@ -712,6 +724,29 @@ class e107MailManager
// return; // ************************************************** Temporarily stop DB being updated when line active ***************************** // return; // ************************************************** Temporarily stop DB being updated when line active *****************************
$addons = array_keys($email['mail_selectors']); // trigger e_mailout.php addons. 'sent' method.
foreach($addons as $plug)
{
if($plug === 'core')
{
continue;
}
if($cls = e107::getAddon($plug,'e_mailout'))
{
$email['status'] = $result;
if(e107::callMethod($cls, 'sent', $email) === false)
{
e107::getAdminLog()->add($plug.' sent process failed', $email, E_LOG_FATAL, 'SENT');
}
}
}
// --------------------------
$this->checkDB(2); // Make sure DB object created $this->checkDB(2); // Make sure DB object created
// Now update email status in DB. We just create new arrays of changed data // Now update email status in DB. We just create new arrays of changed data

View File

@@ -556,6 +556,12 @@ class mailoutAdminClass extends e107MailManager
$ret++; $ret++;
} }
if(empty($pref['e_mailout_list']))
{
return $ret;
}
// Load additional configured handlers e_mailout.php from plugins. // Load additional configured handlers e_mailout.php from plugins.
foreach($pref['e_mailout_list'] as $mailer => $v) foreach($pref['e_mailout_list'] as $mailer => $v)
{ {

View File

@@ -87,7 +87,7 @@ define("LAN_MAILOUT_73", "No logging");
define("LAN_MAILOUT_74", "Logging only (no send)"); define("LAN_MAILOUT_74", "Logging only (no send)");
define("LAN_MAILOUT_75", "Log and send"); define("LAN_MAILOUT_75", "Log and send");
define("LAN_MAILOUT_76", "Include email info in log"); define("LAN_MAILOUT_76", "Include email info in log");
define("LAN_MAILOUT_77", "Supplementary email address sources"); define("LAN_MAILOUT_77", "Email address sources");
define("LAN_MAILOUT_78", "Mailshot Status"); define("LAN_MAILOUT_78", "Mailshot Status");
define("LAN_MAILOUT_79", "No mailshots to display"); define("LAN_MAILOUT_79", "No mailshots to display");
define("LAN_MAILOUT_80", "Date"); define("LAN_MAILOUT_80", "Date");

View File

@@ -238,6 +238,23 @@ class newsletter_mailout
e107::getLog()->add('Newsletter Bounce', $data, E_LOG_INFORMATIVE, 'BOUNCE'); e107::getLog()->add('Newsletter Bounce', $data, E_LOG_INFORMATIVE, 'BOUNCE');
} }
/**
* Manage Sent.
*/
public function sent($data) // trigerred when email sent from queue.
{
if($data['status'] == 1) // Successfully sent
{
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_INFORMATIVE, 'SENT');
}
else // Failed
{
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_FATAL, 'SENT');
}
}
} }