--- content_profile.module	2009-02-13 18:32:02.000000000 +0100
+++ content_profile.module	2009-03-22 01:43:12.000000000 +0100
@@ -53,11 +53,43 @@ function content_profile_menu() {
       'file' => 'node.pages.inc',
       'file path' => drupal_get_path('module', 'node'),
       'type' => content_profile_get_settings($type, 'edit_tab') == 'top' ? MENU_LOCAL_TASK : MENU_CALLBACK,
-    );
+    );    
   }
+
+  // Register a path to allow the logged-in user to edit their user profile
+  $items['edit-profile'] = array(
+    'title' => t('Edit my profile'),
+    'page callback' => 'content_profile_redirect_user',
+    'access callback' => 'content_profile_page_access',
+    'access arguments' => array(content_profile_get_profile_type(), $GLOBALS['user']),
+    'weight' => content_profile_get_settings(content_profile_get_profile_type(), 'weight'),
+  );  
   return $items;
 }
 
+/*
+  * content_profile_redirect_user
+ * redirect user to real profile editing page
+ */
+function content_profile_redirect_user() {
+  drupal_goto('user/' . $GLOBALS['user']->uid . '/profile/' . content_profile_get_profile_type());
+  exit;
+}
+ 
+/*
+ * get profile content type for a uid - assuming there's only one profile per user
+ */
+function content_profile_get_profile_type() {
+  // dirty, dirty hack assuming there's only one profile per user - maybe a user could have profiles of different types?
+  // get nodetype of relevant profile content type for user
+  static $content_type;
+
+  if (!$content_type) {
+    $content_type = db_result(db_query("SELECT type FROM {node} n WHERE uid = %d AND type IN ('%s')", $GLOBALS['user']->uid, implode(',', content_profile_get_types('names')))); 
+  }
+  return $content_type;
+}
+
 /**
  * Implementation of hook_menu_alter().
  * Take over menu items generated by the user module for our categories.
