Index: modules/cvslog/cvs.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cvslog/cvs.module,v retrieving revision 1.156 diff -u -p -r1.156 cvs.module --- modules/cvslog/cvs.module 17 Jul 2007 18:45:50 -0000 1.156 +++ modules/cvslog/cvs.module 21 Jul 2007 23:31:22 -0000 @@ -48,6 +48,8 @@ function cvs_menu($may_cache) { if ($may_cache) { // User pages: $access = user_access('access CVS messages'); + $admin_access = user_access('administer CVS'); + $items[] = array( 'path' => 'cvs', 'title' => t('CVS messages'), @@ -85,10 +87,8 @@ function cvs_menu($may_cache) { 'weight' => 2, ); */ - } - else { + // Admin pages: - $access = user_access('administer CVS'); // If for some reason someone is using this module without // project.module (which is technically legitimate, though hard to @@ -100,7 +100,7 @@ function cvs_menu($may_cache) { 'title' => t('Project administration'), 'description' => t('Administrative interface for project management and related modules.'), 'callback' => 'system_admin_menu_block_page', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_NORMAL_ITEM, ); } @@ -111,7 +111,7 @@ function cvs_menu($may_cache) { 'title' => t('CVS settings'), 'callback' => 'drupal_get_form', 'callback arguments' => array('cvs_settings_form'), - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_NORMAL_ITEM, ); @@ -121,14 +121,14 @@ function cvs_menu($may_cache) { 'title' => t('CVS accounts'), 'description' => t('Approve or deny requests from the !application_url, import CVS users from an existing CVSROOT/password file, or export a CVSROOT/passwd file to install in any of your CVS repositories.', array('!application_url' => l(t('CVS application'), 'cvs-application'))), 'callback' => 'cvs_account', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_NORMAL_ITEM, ); $items[] = array( 'path' => 'admin/project/cvs-accounts/list', 'title' => t('List'), 'callback' => 'cvs_account', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items[] = array( @@ -136,7 +136,7 @@ function cvs_menu($may_cache) { 'title' => t('Import'), 'callback' => 'drupal_get_form', 'callback arguments' => array('cvs_account_import'), - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_LOCAL_TASK, 'weight' => 2, ); @@ -144,7 +144,7 @@ function cvs_menu($may_cache) { 'path' => 'admin/project/cvs-accounts/export', 'title' => t('Export'), 'callback' => 'cvs_account_export', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_LOCAL_TASK, 'weight' => 3, ); @@ -152,7 +152,7 @@ function cvs_menu($may_cache) { 'path' => 'admin/project/cvs-accounts/status', 'title' => t('Status'), 'callback' => 'cvs_account_status', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_LOCAL_TASK, 'weight' => 4, ); @@ -163,14 +163,14 @@ function cvs_menu($may_cache) { 'title' => t('CVS repositories'), 'description' => t('Define and configure what CVS repositories are connected to your site, how CVS log messages should be saved, and how to integrate each repository with a source browsing tool such as ViewCVS.'), 'callback' => 'cvs_repository', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_NORMAL_ITEM, ); $items[] = array( 'path' => 'admin/project/cvs-repositories/list', 'title' => t('List'), 'callback' => 'cvs_repository', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items[] = array( @@ -178,7 +178,7 @@ function cvs_menu($may_cache) { 'title' => t('Add repository'), 'callback' => 'drupal_get_form', 'callback arguments' => array('cvs_repository_form'), - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_LOCAL_TASK, 'weight' => 2, ); @@ -186,24 +186,27 @@ function cvs_menu($may_cache) { 'path' => 'admin/project/cvs-repositories/edit', 'title' => t('Edit repository'), 'callback' => 'cvs_repository_edit', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_CALLBACK, ); $items[] = array( 'path' => 'admin/project/cvs-repositories/delete', 'title' => t('Delete'), 'callback' => 'cvs_repository_delete', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_CALLBACK, ); $items[] = array( 'path' => 'admin/project/cvs-repositories/fetch', 'title' => t('Fetch log'), 'callback' => 'cvs_repository_fetch', - 'access' => $access, + 'access' => $admin_access, 'type' => MENU_CALLBACK, ); + } + else { + // Dynamic menu items (!$may_cache). if (arg(0) == 'user' && is_numeric(arg(1))) { $result = db_query('SELECT uid, status FROM {cvs_accounts} WHERE uid = %d', arg(1)); if ($account = db_fetch_object($result)) {