Job_Posting Module unlocked for Anonymous Users

divu18in - December 17, 2008 - 08:02
Project:Job Posting
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi all,

This was a big issue on job posting module that there was no support for anonymous users. After struggling a lot I found the way to battle with this problem. Here is a few changes that you have to make .module file in job_posting module...

1. In function job_posting_application_form replace

$form['job_posting_applicant'] = array(
'#type' => 'item',
'#title' => t('Applicant'),
'#value' => $user->name .' <'. $user->mail .'>',
'#maxlength' => 64,
);
with
$form['job_posting_applicant'] = array(
'#type' => 'textfield',
'#title' => t('Applicant'),
'#value' => '',
'#maxlength' => 64,
);

2. Replace function
function job_posting_application_form_page($node_id) {
// forward to job listing page an application form is requested
// for a nid that is unpublished, information-only or otherwise
// expired or invalid
$query = 'SELECT COUNT(*) FROM {node} n INNER JOIN {job_posting} p
ON n.nid = p.nid
WHERE p.nid = %d
AND n.status = 1
AND p.applink = 1
AND (p.deadline > %d OR p.expires = 0)';
if (db_result(db_query($query, $node_id, _job_posting_gmt()))) {
//retrieve node info for job_posting being applied to
$node = db_fetch_object(db_query(
'SELECT n.nid, n.title, p.email AS job_posting_email
FROM {node} n INNER JOIN {job_posting} p
ON n.nid = p.nid
WHERE n.nid = %d', $node_id)
);
return drupal_get_form('job_posting_application_form',
array($node->nid, $node->title, $node->job_posting_email));
}
drupal_goto('jobs');
}

with

function job_posting_application_form_page($node_id) {

return drupal_get_form('job_posting_application_form',
array($node->nid, $node->title, $node->job_posting_email));

}

And your module will be unlocked for anonymous users...

Thanks

Divesh Kumar

#1

gmarus - January 7, 2009 - 17:10
Category:bug report» feature request

not a bug report -- changing to more appropriate category

#2

whoey - January 25, 2009 - 17:16

did not work for me...

#3

thememex - April 15, 2009 - 03:33

Please see this similar post with an attached workaround (version 6.x-1.10):
http://drupal.org/node/391756

#4

maksimu - April 24, 2009 - 18:58

nope, did not work.

#5

gmarus - September 30, 2009 - 17:22
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.