1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-08 20:21:13 +02:00

Final LAN fixes on cron for now

This commit is contained in:
Tijn Kuyper 2012-11-24 20:19:51 +01:00
parent 0a8ec03ab4
commit b6f31cadf9
2 changed files with 1309 additions and 1310 deletions

View File

@ -326,15 +326,15 @@ class cron_admin_ui extends e_admin_ui
$srch = array("[x]","[y]"); $srch = array("[x]","[y]");
$repl = array($mins,$secs); $repl = array($mins,$secs);
$lastRun = ($mins) ? str_replace($srch,$repl,LAN_CRON_10) : str_replace($srch,$repl,LAN_CRON_11); // FIX: check syntax $lastRun = ($mins) ? str_replace($srch,$repl,LAN_CRON_9) : str_replace($srch,$repl,LAN_CRON_10); // FIX: check syntax
$lastRefresh = ($ago < 10000) ? $lastRun : LAN_NEVER; $lastRefresh = ($ago < 10000) ? $lastRun : LAN_NEVER;
$mes->add(LAN_STATUS.": <b>".$status."</b>", E_MESSAGE_INFO); $mes->add(LAN_STATUS.": <b>".$status."</b>", E_MESSAGE_INFO);
$mes->add(LAN_CRON_12.": <b>".$this->activeCrons."</b>", E_MESSAGE_INFO); $mes->add(LAN_CRON_11.": <b>".$this->activeCrons."</b>", E_MESSAGE_INFO);
$mes->add(LAN_CRON_13.": ".$lastRefresh, E_MESSAGE_INFO); $mes->add(LAN_CRON_12.": ".$lastRefresh, E_MESSAGE_INFO);
//FIXME: for Windows, the is_executable() function only checks the file //FIXME: for Windows, the is_executable() function only checks the file
// extensions of exe, com, bat and cmd. // extensions of exe, com, bat and cmd.
@ -343,15 +343,15 @@ class cron_admin_ui extends e_admin_ui
$actualPerm = substr(decoct(fileperms(e_BASE."cron.php")),3); $actualPerm = substr(decoct(fileperms(e_BASE."cron.php")),3);
if($isWin) if($isWin)
{ {
$mes->add(LAN_CRON_14, E_MESSAGE_WARNING); $mes->add(LAN_CRON_13, E_MESSAGE_WARNING);
} }
if (!$isWin && $actualPerm != 755) // is_executable() is not reliable. if (!$isWin && $actualPerm != 755) // is_executable() is not reliable.
{ {
$mes->add(LAN_CRON_15, E_MESSAGE_WARNING); $mes->add(LAN_CRON_14, E_MESSAGE_WARNING);
} }
elseif (!$active) // show instructions elseif (!$active) // show instructions
{ {
$setpwd_message = LAN_CRON_16.": <b style='color:black'>".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php ".$pref['e_cron_pwd']."</b><br />". LAN_CRON_17; $setpwd_message = LAN_CRON_15.": <b style='color:black'>".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php ".$pref['e_cron_pwd']."</b><br />". LAN_CRON_16;
$mes->add($setpwd_message, E_MESSAGE_INFO); $mes->add($setpwd_message, E_MESSAGE_INFO);
} }
@ -461,15 +461,15 @@ class cron_admin_form_ui extends e_admin_form_ui
{ {
$sep = array(); $sep = array();
list($min, $hour, $day, $month, $weekday) = explode(" ", $curVal); list($min, $hour, $day, $month, $weekday) = explode(" ", $curVal);
$text = (isset($this->min_options[$min])) ? $this->min_options[$min] : LAN_CRON_50. $min; $text = (isset($this->min_options[$min])) ? $this->min_options[$min] : LAN_CRON_50 ." ". $min; // Minute(s)
$text .= "<br />"; $text .= "<br />";
$text .= (isset($this->hour_options[$hour])) ? $this->hour_options[$hour] : LAN_CRON_51. $hour; $text .= (isset($this->hour_options[$hour])) ? $this->hour_options[$hour] : LAN_CRON_51 ." ". $hour; // Hour(s)
$text .= "<br />"; $text .= "<br />";
$text .= ($day != '*') ? LAN_CRON_52 . $day : LAN_CRON_40; $text .= ($day != '*') ? LAN_CRON_52 ." ". $day : LAN_CRON_40; // Day(s)
$text .= "<br />"; $text .= "<br />";
$text .= ($month != '*') ? LAN_CRON_53 . strftime("%B", mktime(00, 00, 00, $month, 1, 2000)) : LAN_CRON_41; $text .= ($month != '*') ? LAN_CRON_53 ." ". strftime("%B", mktime(00, 00, 00, $month, 1, 2000)) : LAN_CRON_41; // Month(s)
$text .= "<br />"; $text .= "<br />";
$text .= ($weekday != '*') ? LAN_CRON_54 . strftime("%A", mktime(00, 00, 00, 5, $weekday, 2000)) : LAN_CRON_42; $text .= ($weekday != '*') ? LAN_CRON_54 ." ". strftime("%A", mktime(00, 00, 00, 5, $weekday, 2000)) : LAN_CRON_42; // Weekday(s)
return $text; return $text;
} }

View File

@ -45,18 +45,17 @@ define("LAN_CRON_05_2", "Backup the system database to");
define("LAN_CRON_6", "Couldn't Import Prefs"); define("LAN_CRON_6", "Couldn't Import Prefs");
define("LAN_CRON_7", "Couldn't Import Timing Settings"); define("LAN_CRON_7", "Couldn't Import Timing Settings");
define("LAN_CRON_8", "Imported Timing Settings for"); define("LAN_CRON_8", "Imported Timing Settings for");
//define("LAN_CRON_9", "Imported");
define("LAN_CRON_10", "[x] minutes and [y] seconds ago."); // [x] and [y] are automatically replaced. define("LAN_CRON_9", "[x] minutes and [y] seconds ago."); // [x] and [y] are automatically replaced.
define("LAN_CRON_11", "[y] seconds ago."); define("LAN_CRON_10", "[y] seconds ago.");
define("LAN_CRON_12", "Active Crons"); define("LAN_CRON_11", "Active Crons");
define("LAN_CRON_13", "Last cron refresh"); define("LAN_CRON_12", "Last cron refresh");
define("LAN_CRON_14", "Please be sure cron.php is executable."); define("LAN_CRON_13", "Please be sure cron.php is executable.");
define("LAN_CRON_15", "Please CHMOD /cron.php to 755."); define("LAN_CRON_14", "Please CHMOD /cron.php to 755.");
define("LAN_CRON_16", "Use the following Cron Command"); define("LAN_CRON_15", "Use the following Cron Command");
define("LAN_CRON_17", "Using your server control panel (eg. cPanel, DirectAdmin, Plesk etc.) please create a crontab to run this command on your server every minute."); define("LAN_CRON_16", "Using your server control panel (eg. cPanel, DirectAdmin, Plesk etc.) please create a crontab to run this command on your server every minute.");
// leave some room for additions/changes // leave some room for additions/changes
@ -79,9 +78,9 @@ define("LAN_CRON_42", "Every Week Day");
define("LAN_CRON_50", "Minute(s):"); define("LAN_CRON_50", "Minute(s):");
define("LAN_CRON_51", "Hour(s):"); define("LAN_CRON_51", "Hour(s):");
define("LAN_CRON_52", "Day(s):"); define("LAN_CRON_52", "Day(s):");
define("LAN_CRON_53", "Month(s):"); // 52 - 54 need to be included in cron line 468 - 472 => spaces define("LAN_CRON_53", "Month(s):");
define("LAN_CRON_54", "Weekday(s):"); define("LAN_CRON_54", "Weekday(s):");
//define("LAN_CRON_55", "Active");
define("LAN_CRON_BACKUP", "Backup"); define("LAN_CRON_BACKUP", "Backup");
define("LAN_CRON_LOGGING", "Logging"); define("LAN_CRON_LOGGING", "Logging");