diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-02-15 20:09:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-02-15 20:09:46 +0000 |
commit | 4b0b2d02eecaa27e3162a0fad9d31bb08f4df53b (patch) | |
tree | cf369f7370c1be045e3d48e7a9beb26d1d0f3714 /modules/statistics/statistics.module | |
parent | ae5136e51b87b414c737f4726c367c18db79fc49 (diff) | |
download | brdo-4b0b2d02eecaa27e3162a0fad9d31bb08f4df53b.tar.gz brdo-4b0b2d02eecaa27e3162a0fad9d31bb08f4df53b.tar.bz2 |
- Patch by Steven: removed redundant permission checks. These are no longer
required thanks to the new 404 handling.
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r-- | modules/statistics/statistics.module | 89 |
1 files changed, 38 insertions, 51 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index f5c1b36c8..997a81ee0 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -192,30 +192,23 @@ function statistics_admin() { $op = $_POST["op"]; $edit = $_POST["edit"]; - /* Only allow people with sufficient access. */ - if ((user_access("administer statistics module")) || (user_access("administer statistics"))) { - - if (empty($op)) { - $op = arg(2); - } - - /* non-configuration admin pages */ - switch ($op) { - case "referrers": - $output = statistics_top_refer(); - break; - case "log": - $output = statistics_admin_displaylog(); - break; - default: - $output = statistics_admin_topnodes(); - } - - print theme("page", $output); + if (empty($op)) { + $op = arg(2); } - else { - print theme("page", message_access()); + + /* non-configuration admin pages */ + switch ($op) { + case "referrers": + $output = statistics_top_refer(); + break; + case "log": + $output = statistics_admin_displaylog(); + break; + default: + $output = statistics_admin_topnodes(); } + + print theme("page", $output); } @@ -497,42 +490,36 @@ function statistics_block($op = "list", $delta = 0) { function statistics_page() { - if (user_access("access content")) { - $output = ""; - - // build day's most popular content list if enabled - if ($displaycount = variable_get("statistics_userpage_day_cnt", 0)) { - $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; - $table .= statistics_summary("daycount", $displaycount); - $table .= "</table>"; + $output = ""; - $output .= theme("box", t("Day's most popular content:"), $table, "main"); - } + // build day's most popular content list if enabled + if ($displaycount = variable_get("statistics_userpage_day_cnt", 0)) { + $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; + $table .= statistics_summary("daycount", $displaycount); + $table .= "</table>"; - // build all time most popular content list if enabled - if ($displaycount = variable_get("statistics_userpage_all_cnt", 0)) { - $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; - $table .= statistics_summary("totalcount", $displaycount); - $table .= "</table>"; + $output .= theme("box", t("Day's most popular content:"), $table, "main"); + } - $output .= theme("box", t("All time most popular content:"), $table, "main"); - } + // build all time most popular content list if enabled + if ($displaycount = variable_get("statistics_userpage_all_cnt", 0)) { + $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; + $table .= statistics_summary("totalcount", $displaycount); + $table .= "</table>"; - // build last viewed content list if enabled - if ($displaycount = variable_get("statistics_userpage_last_cnt", 0)) { - $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; - $table .= statistics_summary("timestamp", $displaycount); - $table .= "</table>"; + $output .= theme("box", t("All time most popular content:"), $table, "main"); + } - $output .= theme("box", t("Last viewed content:"), $table, "main"); - } + // build last viewed content list if enabled + if ($displaycount = variable_get("statistics_userpage_last_cnt", 0)) { + $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">"; + $table .= statistics_summary("timestamp", $displaycount); + $table .= "</table>"; - print theme("page", $output); - } - else { - // access denied - print theme("page", message_access()); + $output .= theme("box", t("Last viewed content:"), $table, "main"); } + + print theme("page", $output); } |