************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
-if (!empty($_GET['sub']))
-{
+if (!empty($_GET['sub'])) {
switch ($_GET['sub'])
{
case "points":
- if ((empty($_POST['points_register'])) || (empty($_POST['points_ref'])))
- {
+ if ((empty($_POST['points_register'])) || (empty($_POST['points_ref']))) {
unset($_POST['ok']);
}
break;
case "ref":
- if (isset($_GET['do']))
- {
- if (((empty($_POST['lvl'])) || (empty($_POST['perc']))) && ($_GET['do'] == "add"))
- {
+ if (isset($_GET['do'])) {
+ if (((empty($_POST['lvl'])) || (empty($_POST['perc']))) && ($_GET['do'] == "add")) {
unset($_POST['ok']);
}
}
break;
}
-}
- else
-{
+} else {
// Display overview
$_GET['sub'] = "overview";
}
-if (isset($_POST['ok']))
-{
+if (isset($_POST['ok'])) {
$SQL = array();
switch ($_GET['sub'])
{
switch ($_GET['do'])
{
case "add":
- $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_refdepths (level, percents) VALUES ('".$_POST['lvl']."', '".$_POST['perc']."')";
+ $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_refdepths (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')";
break;
case "edit": // Change entries
- foreach ($_POST['lvl'] as $id => $value)
- {
+ foreach ($_POST['lvl'] as $id => $value) {
// Secure ID
$id = bigintval($id);
break;
case "del":
- foreach ($_POST['id'] as $id => $value)
- {
+ foreach ($_POST['id'] as $id => $value) {
$result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
}
// Update cache file
- if (GET_EXT_VERSION("cache") >= "0.1.2")
- {
+ if (GET_EXT_VERSION("cache") >= "0.1.2") {
if ($cacheInstance->cache_file("refdepths", true)) $cacheInstance->cache_destroy();
}
break;
switch ($_CONFIG['allow_direct_pay'])
{
case 'Y':
- define('__DIRECT_Y', ' checked');
+ define('__DIRECT_Y', " checked");
define('__DIRECT_N', "");
break;
case 'N':
define('__DIRECT_Y', "");
- define('__DIRECT_N', ' checked');
+ define('__DIRECT_N', " checked");
break;
}
// One-time referral bonus add-mode
switch ($_CONFIG['reg_points_mode'])
{
- case "ref" : define('__MODE_REF', ' checked'); define('__MODE_DIRECT', ""); break;
- case "direct": define('__MODE_REF', ""); define('__MODE_DIRECT', ' checked'); break;
+ case "ref" : define('__MODE_REF', " checked"); define('__MODE_DIRECT', ""); break;
+ case "direct": define('__MODE_REF', ""); define('__MODE_DIRECT', " checked"); break;
}
// Referral payout value