diff options
-rw-r--r-- | muamba.info | 1 | ||||
-rw-r--r-- | muamba.misc.inc | 12 | ||||
-rw-r--r-- | muamba.module | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/muamba.info b/muamba.info index f039221..0b16b58 100644 --- a/muamba.info +++ b/muamba.info @@ -8,3 +8,4 @@ dependencies[] = features dependencies[] = strongarm dependencies[] = muamba_interface dependencies[] = muamba_system +dependencies[] = privatemsg diff --git a/muamba.misc.inc b/muamba.misc.inc index 4168464..25fceac 100644 --- a/muamba.misc.inc +++ b/muamba.misc.inc @@ -13,7 +13,17 @@ */ function muamba_request($nid) { // Sanitize - $nid = (int) $nid; + $nid = (int) $nid; + $node = node_load($nid); + if (!$node) { + // TODO: error + return; + } + + global $user; + + // TODO: check if user is not blocked? + privatemsg_new_thread(array(user_load($node->uid)), 'User request', 'User has requested an item'); return t('You have requested an item'); } diff --git a/muamba.module b/muamba.module index fbddf45..8a2da28 100644 --- a/muamba.module +++ b/muamba.module @@ -10,8 +10,8 @@ */ function muamba_permission() { return array( - 'administer muamba' => array( - 'title' => t('request item'), + 'request item' => array( + 'title' => t('Request an item'), 'description' => t('Request an item to be borrowed or donated.'), ), ); |