]> git.mxchange.org Git - mailer.git/commitdiff
New feature of repaying points to user/jackpot/shred added
authorRoland Häder <roland@mxchange.org>
Sun, 18 May 2008 16:26:56 +0000 (16:26 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 18 May 2008 16:26:56 +0000 (16:26 +0000)
12 files changed:
inc/extensions/ext-order.php
inc/extensions/ext-sql_patches.php
inc/language/de.php
inc/language/order_de.php
inc/modules/admin/action-task.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-config_order.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-del_task.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-overview.php
templates/de/html/admin/admin_config_order.tpl

index 873f7fd74b120a4d5e0400464b1efa5e966788ad..16f7f737401e170587a2a6b504449b388f9f9b8c 100644 (file)
@@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
 }
 
 // Version number
-$EXT_VERSION = "0.4.8";
+$EXT_VERSION = "0.4.9";
 
 // Auto-set extension version
 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8");
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -292,15 +292,23 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us
                $UPDATE_NOTES = "Men&uuml;punkt &quot;Mailbuchungsseite&quot; nach &quot;Mailbuchung&quot; umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.";
                break;
 
+       case "0.4.9": // SQL queries for v0.4.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD repay_deleted_mails ENUM('REPAY', 'JACKPOT', 'SHRED') not null default 'REPAY'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei L&ouml;schung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen ".POINTS." wieder gutgeschrieben werden sollen oder in den Jackpot landen.";
+               break;
+
        }
        break;
 
 default: // Do stuff when extension is loaded
        $dummy = LOAD_CONFIG();
-       $_CONFIG['order_min']    = $dummy['order_min'];      // Order at least X mails
-       $_CONFIG['order_max']    = $dummy['order_max_full']; // Ordering mode: as much as possible or as much as the user want's to receive
-       $_CONFIG['order_select'] = $dummy['order_select'];   // Sorting mode for selecting users while looking some up for mail delivery
-       $_CONFIG['order_mode']   = $dummy['order_mode'];     // Ascending or descending sort order for above
+       $_CONFIG['order_min']           = $dummy['order_min'];           // Order at least X mails
+       $_CONFIG['order_max']           = $dummy['order_max_full'];      // Ordering mode: as much as possible or as much as the user want's to receive
+       $_CONFIG['order_select']        = $dummy['order_select'];        // Sorting mode for selecting users while looking some up for mail delivery
+       $_CONFIG['order_mode']          = $dummy['order_mode'];          // Ascending or descending sort order for above
+       $_CONFIG['repay_deleted_mails'] = $dummy['repay_deleted_mails']; // Wether repay points or send them to jackpot/shreder on mail order deletion
        unset($dummy);
 
        // Do daily reset only when installed and extension version is at least 0.1.1
index 3cb088c02570f1cf3799c7bc9ddba6541489a1b9..294db45c190a7b158bebfe2a03ea439a6ca00b59 100644 (file)
@@ -581,15 +581,11 @@ default: // Do stuff when extension is loaded
                }
 
                // Test again
-               if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble'])))
-               {
+               if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
                        // File hash fas generated so we can also file the secret file... hopefully.
-                       if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash'])))
-                       {
+                       if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash']))) {
                                $_CONFIG['secret_key'] = implode("", file(PATH."inc/.secret/.".$_CONFIG['file_hash']));
-                       }
-                        else
-                       {
+                       } else {
                                // Cannot read secret file!
                                mxchange_die("Cannot read secret file!");
                        }
index 650db038c24ee9506874d6fc387ba424eae56b74..eb4144f820785e762e3c3c03d1f95380d04ec7b6 100644 (file)
@@ -1107,6 +1107,7 @@ define('SUBJECT_DIRECT_PAYMENT', "Direkte {!POINTS!}-Gutschrift durch das System
 define('ADMIN_LOGOUT_SQL_PATCHES_DONE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung <strong>sql_patches</strong> installiert haben und dabei das Passort-Hashing ge&auml;ndert/verbessert wurde. Bitte erneut einloggen!");
 define('ADMIN_POINTS_REPAYED', "Es wurden dem Mitglied <u>%s</u> {!POINTS!} zur&uuml;ckgeschrieben.");
 define('ADMIN_NO_POINTS_REPAYED', "Die Mailbuchung hatte keine {!POINTS!} zum zur&uuml;ckbuchen!");
+define('EXTENSION_WARNING_EXT_INACTIVE', "Die Erweiterung <u>%s</u> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
 
 //
 ?>
index 6663f4b4327aa5f7459079a7e40ccea72a893ffb..b0767dfb05a023e8af09b8f7491b3ca394daa3bd 100644 (file)
@@ -73,5 +73,11 @@ define('ADMIN_AUTOSEND_ACTIVE', "Der Auto-Versand ist in Ihrem {!MT_WORD!} derze
 define('MEMBER_AUTOSEND_INACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit deaktiviert. Ihre Mailbuchung wird bald von einem Administrator ueberprueft und dann freigegeben.");
 define('MEMBER_AUTOSEND_ACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit aktiviert. Ihr Mailbuchung wurde aktiviert und wird bald automatisch versant.");
 
+// Repay deleted mails constants
+define('ADMIN_CFG_REPAY_POINTS_REPAY', "Dem Mitglied gutschreiben");
+define('ADMIN_CFG_REPAY_POINTS_JACKPOT', "In den Jackpot legen");
+define('ADMIN_CFG_REPAY_POINTS_NEVER', "Nicht gutschreiben (verf&auml;llt dann)");
+define('ADMIN_REPAY_ON_DELETE_MODE', "Wie sollen {!POINTS!} von gel&ouml;schten Mails verbucht werden?");
+
 //
 ?>
index 08c5eaa5fffacf8d9c41be2d3088a340d2e378e1..692d4f0d3617bf7831a0ecb88f4f0d2d7cda9c30 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
 }
 
 // Add description as navigation point
index 605f525a1b1acffc171de080f05fe625175a667e..bdd3334894fd11e6522e6692b903282fa0244119 100644 (file)
@@ -47,7 +47,8 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks)
         array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
 
        // We currently don't want to install an extension so let's find out if we need...
-       $EXT_LOAD_MODE = "register"; $JOBS_DONE = true;
+       $EXT_LOAD_MODE = "register";
+       $JOBS_DONE = true;
 
        // Open the extension directory
        $handle = opendir(PATH."inc/extensions/") or mxchange_die("Cannot read extension directory!");
@@ -80,14 +81,15 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks)
 
                        // Is the extension not yet installed?
                        if ((SQL_NUMROWS($result) == 0) && (empty($ext_ver))) {
+                               // Generate subject line
+                               $ext_subj = sprintf("[%s:]", $ext);
+
                                // Not installed and do we have created a task for the admin?
-                               $ext_subj = "[".$ext.":] ".ADMIN_NEW_EXT_SUBJ;
                                //* DEBUG: */ echo $ext.":".$ext_ver."=";
-                               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE subject='%s' LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT `id` FROM `"._MYSQL_PREFIX."_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1",
                                 array($ext_subj), __FILE__, __LINE__);
                                //* DEBUG: */ echo SQL_NUMROWS($result)."<br />\n";
-                               if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == ""))
-                               {
+                               if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == "")) {
                                        // Template file
                                        $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
                                                PATH,
@@ -96,25 +98,22 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks)
                                        );
 
                                        // Load text for task
-                                       if ((file_exists($tpl)) && (is_readable($tpl)))
-                                       {
+                                       if ((file_exists($tpl)) && (is_readable($tpl))) {
                                                // Load extension's own text template (HTML!)
                                                $MSG = LOAD_TEMPLATE("ext_".$ext, true);
-                                       }
-                                        else
-                                       {
+                                       } else {
                                                // Load default message
                                                $MSG = LOAD_EMAIL_TEMPLATE("admin_new_ext","", 0);
                                        }
 
                                        // Task not created so it's a brand-new extension which we need to register and create a task for!
-                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created)
+                                       $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created)
 VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())",
- array(
-       GET_ADMIN_ID(get_session('admin_login')),
-       $ext_subj,
-       addslashes($MSG),
-),  __FILE__, __LINE__, true, false);
                                       array(
+                                               GET_ADMIN_ID(get_session('admin_login')),
+                                               $ext_subj,
+                                               addslashes($MSG),
+                                       ),  __FILE__, __LINE__, true, false);
                                }
 
                                // Free memory
@@ -122,12 +121,9 @@ VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())",
 
                                // We maybe want to install an extension so let's test-drive it...
                                include(PATH."inc/extensions/".$file);
-                       }
-                        else
-                       {
+                       } else {
                                // Maybe we want to update?
-                               if ((empty($cacheArray['extensions']['ext_version'][$ext])) && (SQL_NUMROWS($result) == 1))
-                               {
+                               if ((empty($cacheArray['extensions']['ext_version'][$ext])) && (SQL_NUMROWS($result) == 1)) {
                                        list($dummy, $ext_ver) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
                                }
@@ -135,11 +131,9 @@ VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())",
                                // Update extension
                                if (!empty($ext_ver)) EXTENSION_UPDATE($file, $ext, $ext_ver);
 
-                               if (!empty($cacheArray['active_extensions'][$ext]))
-                               {
+                               if (!empty($cacheArray['active_extensions'][$ext])) {
                                        // Maybe we want to keept the current extension active?
-                                       if (($cacheArray['active_extensions'][$ext] == 'Y') && (!EXT_IS_ACTIVE($ext, true, true)))
-                                       {
+                                       if (($cacheArray['active_extensions'][$ext] == 'Y') && (!EXT_IS_ACTIVE($ext, true, true))) {
                                                // Reactivate this extension!
                                                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='Y' WHERE ext_name='%s' LIMIT 1",
                                                 array($ext), __FILE__, __LINE__);
@@ -159,46 +153,47 @@ FROM "._MYSQL_PREFIX."_task_system
 WHERE assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')
 ORDER BY userid DESC, task_type DESC, subject, task_created DESC",
         array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_tasks) > 0)
-       {
+
+       if (SQL_NUMROWS($result_tasks) > 0) {
                // New jobs found!
                $JOBS_DONE = false;
        }
 
+       // Free the result
+       SQL_FREERESULT($result);
+
+       // Return status
        return $JOBS_DONE;
 }
+
 //
-function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
-{
+function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
        global $_CONFIG, $NOTES;
-       if ((isset($_POST['assign'])) && (count($_POST['task']) > 0))
-       {
+       if ((isset($_POST['assign'])) && (count($_POST['task']) > 0)) {
                // Assign / do tasks
                $OUT = ""; $SW = 2;
-               foreach ($_POST['task'] as $id=>$sel)
-               {
+               foreach ($_POST['task'] as $id=>$sel) {
                        $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM "._MYSQL_PREFIX."_task_system WHERE id=%d AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1",
                         array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result_task) == 1)
-                       {
+                       if (SQL_NUMROWS($result_task) == 1) {
                                // Task is valid...
                                list($tid, $uid, $type, $subj, $text, $created, $status, $aid) = SQL_FETCHROW($result_task);
                                SQL_FREERESULT($result_task);
-                               if ($aid == "0")
-                               {
+
+                               if ($aid == "0") {
                                        // Assgin current admin to unassgigned task
                                        $result_assign = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE id=%d LIMIT 1",
                                         array(GET_ADMIN_ID(get_session('admin_login')), bigintval($tid)), __FILE__, __LINE__);
                                }
+
                                $ADD = "";
-                               if ($type == "SUPPORT_MEMBER")
-                               {
+                               if ($type == "SUPPORT_MEMBER") {
                                        $mode = substr($text, 0, strpos($text, ":"));
                                        $text = substr($text, strpos($text, ":") + 1);
                                        $ADD = "<LI>".ADMIN_TASK_SUPPORT_MODE.": <STRONG>".$mode."</STRONG></LI>";
                                }
-                               if ($uid > 0)
-                               {
+
+                               if ($uid > 0) {
                                        $result_user = SQL_QUERY_ESC("SELECT sex, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
                                         array(bigintval($uid)), __FILE__, __LINE__);
                                        if (SQL_NUMROWS($result_user) == 1)
@@ -217,11 +212,9 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
                                $title = TASK_NO_TITLE;
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
-                               if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == 'Y')) || (!EXT_IS_ACTIVE("sql_patches")))
-                               {
+                               if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == 'Y')) || (!EXT_IS_ACTIVE("sql_patches"))) {
                                        $ext_name = substr($subj, 1, strpos($subj, ":") - 1);
-                                       if ($type == "EXTENSION")
-                                       {
+                                       if ($type == "EXTENSION") {
                                                // Load SQL commands for registering
                                                $SQLs = EXTENSION_REGISTER($ext_name, $id, true);
 
@@ -230,9 +223,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
 
                                                // Set title
                                                $title = ADMIN_SQLS_EXECUTED_ON_REGISTER;
-                                       }
-                                        elseif ($type == "EXTENSION_UPDATE")
-                                       {
+                                       } elseif ($type == "EXTENSION_UPDATE") {
                                                // Load SQL commands for update (already done!)
                                                $ext_name = substr($ext_name, 7);
                                                $ext_name = substr($ext_name, 0, strpos($ext_name, "-"));
@@ -248,9 +239,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
 
                                                // Set title
                                                $title = ADMIN_SQLS_EXECUTED_ON_UPDATE;
-                                       }
-                                        else
-                                       {
+                                       } else {
                                                // Remove extension's name
                                                $ext_name = "";
                                        }
@@ -262,9 +251,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
                                                // Add verbose SQL table
                                                $text .= EXTENSION_VERBOSE_TABLE($SQLs, $title, " class=\"admin_table top2 left2 right2\"", true, "100%")."<br />\n";
                                        }
-                               }
-                                else
-                               {
+                               } else {
                                        // Run SQL commands in dry mode but only return the notes
                                        $SQLs = EXTENSION_UPDATE("ext-".$ext_name.".php", $ext_name, $ext_ver, true);
                                        $text .= $NOTES;
@@ -292,16 +279,13 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
                                         array($ext_name), __FILE__, __LINE__);
                                        $lines = SQL_NUMROWS($result_lines);
                                        SQL_FREERESULT($result_lines);
-                                       if ($lines == "0")
-                                       {
+                                       if ($lines == "0") {
                                                // New extension found
                                                $OUT .= LOAD_TEMPLATE("admin_ext_reg_form", true, array(
                                                        'id'       => bigintval($id),
                                                        'ext_name' => $ext_name
                                                ));
-                                       }
-                                        else
-                                       {
+                                       } else {
                                                // Task is closed so nothing is todo
                                                $OUT .= "<FONT class=\"admin_failed\">".ADMIN_EXT_ALREADY_REGISTERED."</FONT>\n";
 
@@ -319,8 +303,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks)
                                        $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_EXTENSION_UPDATED."</FONT>\n";
 
                                        // Close task
-                                       if (($status != "CLOSED") && ($status != "DELETED"))
-                                       {
+                                       if (($status != "CLOSED") && ($status != "DELETED")) {
                                                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET status='SOLVED' WHERE id=%d LIMIT 1",
                                                 array(bigintval($tid)), __FILE__, __LINE__);
                                        }
index 73fc2f7232e0e2392dd01be4f133cbab1a2d1ef1..c864f160edfd71fd1c519233d0f93f491431e7a8 100644 (file)
@@ -40,13 +40,10 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
-if (isset($_POST['ok']))
-{
+if (isset($_POST['ok'])) {
        // Save data
        ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
+} else {
        // Prepare constants for the template
        switch ($_CONFIG['order_max'])
        {
@@ -90,6 +87,26 @@ if (isset($_POST['ok']))
                define('_CFG_TEST_TEXT_Y', ' checked');
        }
 
+       switch ($_CONFIG['repay_deleted_mails']) {
+               case "REPAY":
+                       define('_CFG_REPAY_POINTS_REPAY'  , " selected=\"selected\"");
+                       define('_CFG_REPAY_POINTS_JACKPOT', "");
+                       define('_CFG_REPAY_POINTS_NONE'   , "");
+                       break;
+
+               case "JACKPOT":
+                       define('_CFG_REPAY_POINTS_REPAY'  , "");
+                       define('_CFG_REPAY_POINTS_JACKPOT', " selected=\"selected\"");
+                       define('_CFG_REPAY_POINTS_NONE'   , "");
+                       break;
+
+               case "NONE":
+                       define('_CFG_REPAY_POINTS_REPAY'  , "");
+                       define('_CFG_REPAY_POINTS_JACKPOT', "");
+                       define('_CFG_REPAY_POINTS_NONE'   , " selected=\"selected\"");
+                       break;
+       }
+
        if ($_CONFIG['test_subj'] == 'N') {
                define('_CFG_TEST_SUBJ_N', ' checked');
                define('_CFG_TEST_SUBJ_Y', "");
index d573eb6b2c9dfbdfc6932965be8cd19e5b208696..635b6443e9a8399d987dfd9579420f75d676ad7f 100644 (file)
@@ -92,7 +92,7 @@ WHERE s.pool_id=%d LIMIT 1",
                        SQL_FREERESULT($result);
 
                        // Shall we pay the points back to the user?
-                       if ($_CONFIG['repay_deleted_mails'] == "Y") {
+                       if ($_CONFIG['repay_deleted_mails'] != "NEVER") {
                                // Get all user links
                                $result = SQL_QUERY_ESC("SELECT COUNT(id) AS 'cnt' FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d",
                                        array(bigintval($stats_id)), __FILE__, __LINE__);
@@ -107,6 +107,12 @@ WHERE s.pool_id=%d LIMIT 1",
                                $totalPoints = $links * $price;
                                //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
                                if ($totalPoints > 0) {
+                                       // Shall we payback to user or jackpot?
+                                       if ($_CONFIG['repay_deleted_mails'] == "JACKPOT") {
+                                               // Set jackpot
+                                               $sender = 0;
+                                       }
+
                                        // Pay back points
                                        //* DEBUG: */ echo "PAYBACK:".$sender."<br />\n";
                                        ADD_POINTS_REFSYSTEM($sender, $totalPoints, true, "0", false,"direct");
index ed8e7187fac063de80fd0b24c0e0e02cb9f1b374..c04777e4e9e78fa48c4ca3c247995cd74231ae98 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
 }
+
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
-OUTPUT_HTML("</FONT><br /><br />");
 
 //
 ?>
index 7587438b1167d463bc03fa66f8c37b009946d246..a4c2c82f766bad2a82d124265d80b2daf8c878a8 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
 }
+
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
index 44991b3b282478b053528b2c039ffb7f2cee3380..799cae84f1cdf967d578f9c633d80830970911fb 100644 (file)
@@ -44,23 +44,23 @@ ADD_DESCR("admin", basename(__FILE__));
 require_once(PATH."inc/modules/admin/overview-inc.php");
 
 $JOBS_DONE = true;
+$taskExt = false; // Default is that "task" is not installed
+
 // When the admin is logging in check several things first (new jobs to complete and so on)
 if ($GLOBALS['action'] == "login")
 {
-       if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW')))
-       {
+       if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) {
                // When task extension is registered output advanced overview page
                $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task'
-       }
-        else
-       {
+               $taskExt = true;
+       } else {
                // Output standart overview (provided by overview-inc.php)
                $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks);
        }
 }
-// Do we have new jobs or not?
-if ($JOBS_DONE)
-{
+
+// Are there jobs to be done?
+if ($JOBS_DONE) {
        // Generate overview of all main menus
        global $menuDesription, $FATAL;
        if ((is_array($menuDesription)) && (sizeof($menuDesription) > 0)) {
@@ -80,7 +80,13 @@ if ($JOBS_DONE)
                // Load base template
                LOAD_TEMPLATE("admin_menu_hints", false, $OUT);
        }
-} elseif (!EXT_IS_ACTIVE("task")) {
+} elseif (!$taskExt) {
+       if (EXT_IS_ACTIVE("task")) {
+               // Output warning message
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(EXTENSION_WARNING_EXT_INACTIVE, "task"));
+               OUTPUT_HTML("<br />");
+       }
+
        // List selected tasks on overview when task management is not active
        OUTPUT_SELECTED_TASKS($_POST, $result_tasks);
 }
index b0f988e8e6dcf697665e8f808176a16d8246238c..d5f79b0646757b5c4fea6f8dc86ebf9a0a95266a 100644 (file)
                <TD width="10" class="seperator">&nbsp;</TD>
        </TR>
 
+       <TR>
+               <TD colspan="5" height="7" class="seperator">&nbsp;</TD>
+       </TR>
+
+       <TR>
+               <TD width="10" class="seperator">&nbsp;</TD>
+               <TD align="right" width="275">{--ADMIN_REPAY_ON_DELETE_MODE--}</TD>
+               <TD width="10" class="seperator">&nbsp;</TD>
+               <TD align="center" width="275">
+                       <SELECT name="repay_deleted_mails" class="admin_select" size="1">
+                               <OPTION value="repay"{--_CFG_REPAY_POINTS_REPAY--}">{--ADMIN_CFG_REPAY_POINTS_REPAY--}</OPTION>
+                               <OPTION value="jackpot"{--_CFG_REPAY_POINTS_JACKPOT--}">{--ADMIN_CFG_REPAY_POINTS_JACKPOT--}</OPTION>
+                               <OPTION value="never"{--_CFG_REPAY_POINTS_NEVER--}">{--ADMIN_CFG_REPAY_POINTS_NEVER--}</OPTION>
+                       </SELECT>
+               </TD>
+               <TD width="10" class="seperator">&nbsp;</TD>
+       </TR>
+
        <TR>
                <TD colspan="5" height="7" class="seperator bottom2">&nbsp;</TD>
        </TR>
                <TD width="10" class="seperator">&nbsp;</TD>
                <TD align="right" width="275">{--ADMIN_ORDER_SELECTION_MODE--}:</TD>
                <TD width="10" class="seperator">&nbsp;</TD>
-               <TD align="center" width="275"><SELECT name="order_mode"
-                       class="admin_select" size="1">
-                       <OPTION value="ASC"{--__ASC_DEFAULT--}">{--SORT_ASCENDING--}</OPTION>
-                       <OPTION value="DESC"{--__DESC_DEFAULT--}">{--SORT_DESCENDING--}</OPTION>
-               </SELECT></TD>
+               <TD align="center" width="275">
+                       <SELECT name="order_mode" class="admin_select" size="1">
+                               <OPTION value="ASC"{--__ASC_DEFAULT--}">{--SORT_ASCENDING--}</OPTION>
+                               <OPTION value="DESC"{--__DESC_DEFAULT--}">{--SORT_DESCENDING--}</OPTION>
+                       </SELECT>
+               </TD>
                <TD width="10" class="seperator">&nbsp;</TD>
        </TR>
        <TR>