diff --git a/README.md b/README.md index 6ee2db84..a8ffec31 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Gazelle is a web framework geared towards private BitTorrent trackers. Although * [PHP 5.4 or later](http://us.php.net/) (required) * [Memcached](http://memcached.org/) (required) * [Sphinx](http://sphinxsearch.com/) (required) +* [procps-ng](http://sourceforge.net/projects/procps-ng/) (recommended) ## Changelog You may have noticed that commits in the repository do not have have descriptive messages. If you are looking for a change log of Gazelle it can be [viewed here](https://raw.github.com/WhatCD/Gazelle/master/docs/CHANGES.txt). The change log is generated daily and includes new additions or modifications to Gazelle's source. diff --git a/classes/donations.class.php b/classes/donations.class.php index 1962fe5c..398016e7 100644 --- a/classes/donations.class.php +++ b/classes/donations.class.php @@ -301,11 +301,6 @@ public static function has_donor_forum($UserID) { return self::get_rank($UserID) >= DONOR_FORUM_RANK || self::get_special_rank($UserID) >= MAX_SPECIAL_RANK; } - public static function is_mod($UserID) { - $Permissions = Permissions::get_permissions_for_user($UserID); - return isset($Permissions['users_mod']) && $Permissions['users_mod']; - } - /** * Put all the common donor info in the same cache key to save some cache calls */ @@ -323,7 +318,7 @@ public static function get_donor_info($UserID) { } else { $Rank = $SpecialRank = $TotalRank = $DonationTime = 0; } - if (self::is_mod($UserID)) { + if (Permissions::is_mod($UserID)) { $Rank = MAX_EXTRA_RANK; $SpecialRank = MAX_SPECIAL_RANK; } diff --git a/classes/permissions.class.php b/classes/permissions.class.php index ac906688..ca9113ea 100644 --- a/classes/permissions.class.php +++ b/classes/permissions.class.php @@ -83,22 +83,27 @@ public static function get_permissions_for_user($UserID, $CustomPermissions = fa // This is legacy donor cruft if ($UserInfo['Donor']) { $DonorPerms = self::get_permissions(DONOR); + unset($DonorPerms['Permissions']['MaxCollages']); } else { $DonorPerms = array('Permissions' => array()); } - $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages; if (isset($CustomPermissions['MaxCollages'])) { $MaxCollages += $CustomPermissions['MaxCollages']; + unset($CustomPermissions['MaxCollages']); } - $Permissions['MaxCollages'] = $MaxCollages; - - //Combine the permissions + $Permissions['Permissions']['MaxCollages'] = $MaxCollages; + // Combine the permissions return array_merge( $Permissions['Permissions'], $BonusPerms, $CustomPermissions, $DonorPerms['Permissions']); } + + public static function is_mod($UserID) { + $Permissions = self::get_permissions_for_user($UserID); + return isset($Permissions['users_mod']) && $Permissions['users_mod']; + } } ?> diff --git a/classes/script_start.php b/classes/script_start.php index de1a5179..e70d73a7 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -185,7 +185,7 @@ // Load in the permissions $LoggedUser['Permissions'] = Permissions::get_permissions_for_user($LoggedUser['ID'], $LoggedUser['CustomPermissions']); - $LoggedUser['Permissions']['MaxCollages'] += Donations::get_personal_collages($LoggedUser['ID'], check_perms('users_mod')); + $LoggedUser['Permissions']['MaxCollages'] += Donations::get_personal_collages($LoggedUser['ID']); // Change necessary triggers in external components $Cache->CanClear = check_perms('admin_clear_cache'); diff --git a/sections/reports/reports.php b/sections/reports/reports.php index 232f7d5b..c22597bc 100644 --- a/sections/reports/reports.php +++ b/sections/reports/reports.php @@ -95,7 +95,7 @@ $Type = $Types[$Short]; $Reference = "reports.php?id=$ReportID#report$ReportID"; ?> -
+
@@ -242,7 +242,6 @@
Report #
-
set_query_id($Reports); } diff --git a/sections/schedule/index.php b/sections/schedule/index.php index f4703a67..1c0cd368 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -3,6 +3,12 @@ ob_end_flush(); gc_enable(); +/* + * Use this if your version of pgrep does not support the '-c' option. + * The '-c' option requires procps-ng. + * + * $PCount = chop(shell_exec("/usr/bin/pgrep -f schedule.php | wc -l")); + */ $PCount = chop(shell_exec("/usr/bin/pgrep -cf schedule.php")); if ($PCount > 3) { // 3 because the cron job starts two processes and pgrep finds itself diff --git a/sections/user/user.php b/sections/user/user.php index b53a0464..0bbcfe17 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -211,7 +211,7 @@ function check_paranoia_here($Setting) { Permissions Sessions