summaryrefslogtreecommitdiff
path: root/modules/cvs.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-20 20:00:40 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-20 20:00:40 +0000
commit72065fb8351b54eee5f1928c18e06ad81aa9b502 (patch)
tree59052fb790134eed81b52b69150a1e231bd44083 /modules/cvs.module
parent7752dc4c7c4cffda07152d8ee89bce05f16a5d6c (diff)
downloadbrdo-72065fb8351b54eee5f1928c18e06ad81aa9b502.tar.gz
brdo-72065fb8351b54eee5f1928c18e06ad81aa9b502.tar.bz2
- Added a brand-new access.module which allows you to manage 'roles'
(groups) and 'permissions' ... (inspired by Zope's system). + Once installed, click the help-link for more information. + See updates/2.00-to-x.xx.sql for the SQL updates. - Modified loads of code to use our new access.module. The system still has to mature though: new permissions have to be added and existing permissions need stream-lining. Awaiting suggestions. - As a direct result of the new access system, I had to rewrite the way the top-level links in admin.php are rendered and displayed, and xhtml-ified admin.php while I was at it. TODO - Home-brewed modules need updating, home-brewed themes not. (Examples: file.module, trip_link.module) - As soon we *finished* the refactoring of the user system (KJ has been working on this refactoring already) we should consider to embed this role and permission code into account.module ...
Diffstat (limited to 'modules/cvs.module')
-rw-r--r--modules/cvs.module33
1 files changed, 22 insertions, 11 deletions
diff --git a/modules/cvs.module b/modules/cvs.module
index 7eefac3de..cc81a12e6 100644
--- a/modules/cvs.module
+++ b/modules/cvs.module
@@ -1,5 +1,9 @@
<?php
+function cvs_perm() {
+ return array("view CVS messages");
+}
+
function cvs_cron() {
if (time() - variable_get("cvs_cron_last", 0) > variable_get("cvs_cron_time", time())) {
variable_set("cvs_cron_last", time());
@@ -22,20 +26,27 @@ function cvs_conf_options() {
}
function cvs_page() {
- global $theme;
+ global $user, $theme;
- $result = db_query("SELECT * FROM cvs ORDER BY timestamp DESC LIMIT 50");
+ if (user_access($user, "view CVS messages")) {
+ $result = db_query("SELECT * FROM cvs ORDER BY timestamp DESC LIMIT 50");
- while ($cvs = db_fetch_object($result)) {
- $output .= "<b>File:</b> $cvs->files<br />";
- $output .= "<b>Date:</b> ". format_date($cvs->timestamp) ."<br />";
- $output .= "<b>User:</b> $cvs->user<br />";
- $output .= "\n". nl2br(htmlentities($cvs->message)) ."<hr />";
- }
+ while ($cvs = db_fetch_object($result)) {
+ $output .= "<b>File:</b> $cvs->files<br />";
+ $output .= "<b>Date:</b> ". format_date($cvs->timestamp) ."<br />";
+ $output .= "<b>User:</b> $cvs->user<br />";
+ $output .= "\n". nl2br(htmlentities($cvs->message)) ."<hr />";
+ }
- $theme->header();
- $theme->box("CVS commit messages", "<div style=\"font-family: monospace;\">$output</div>");
- $theme->footer();
+ $theme->header();
+ $theme->box("CVS commit messages", "<div style=\"font-family: monospace;\">$output</div>");
+ $theme->footer();
+ }
+ else {
+ $theme->header();
+ $theme->box(t("Access denied"), message_access());
+ $theme->footer();
+ }
}
?> \ No newline at end of file