ExoPHP HelpDesk - PHP Help needed

Hi there,

I am having a bit of trouble, a client of mine needed a help desk so I installed and themed a script called ExoPHP Help Desk.

You can view it over at http://www.i-dba.co.uk/

The problem I am having is with Custom Fields, and duplicate emails being registered.

The custom fields are created automatically in the registration field when you create them in the admin area,

The thing is if you set the custom fields to be mandatory they are italicised, I need them a normal font and with a red asterix next to them, I have looked through all of the PHP files to try and find the part that styles the custom fields when they are added but no joy.

I am also having a problem of users registering with the same emails so I have say 2 users both using the same email address, I need the files edited to not let emails be duplicated.

I don’t know much PHP so don’t really know where to start with this.

If anyone can help it would be much appreciated. I can give a small donation if someone can help me.

Please email me on [email protected] if you can help,

Many thanks.

George

Anyone? :frowning:

I think you stand a better chance of a reply if you post the code in question.

Gary

Oh yes, sorry,

Here is the register.php code…

[php]<?php

session_start();

// << -------------------------------------------------------------------- >>
// >> EXO Helpdesk Registration File
// >>
// >> REGISTER . PHP File - User Registration Of HelpDesk
// >> Started : November 14, 2003
// >> Edited : February 05, 2006
// << -------------------------------------------------------------------- >>

ob_start();

define(“EX_FILE”, 1);

include_once ( ‘common.php’ );

$_Q = $db->query (“SELECT * FROM phpdesk_configs WHERE registrations=‘Open’” );

if ( $NO_AUTH != 1 )
{
// IF USER COOKIES EXISTS
header( “Location: index.php” );
}
elseif(!$db->num($_Q))
{
echo $error[‘register_close’];
}
else
{

if( SUBM == NULL )
{
	_parse( $tpl_dir . 'profile.tpl' );
	$read = getBlock( $class->read, 'MEMBER' );
	$n_pm = '<option value="1">Yes</option><option value="0">No</option>';
	$read = str_replace('^n_pm^',$n_pm, str_replace('^n_response^', $n_pm, $read));
	
	// PARSE ADD TICKET . TPL FILE
	_parse ( $tpl_dir . 'tickets.tpl' );
	
	// PREPARE VARIABLES
	$READ  =  getBlock( $class->read, 'ADD_TICKET' );
	$READ  =  rpl( '^e_text^', NULL, $READ );

	// THE OUTPUT VARIABLES
	$LIST  =  template ( $READ, $T_ST, $T_ED );
	$READ  =  template ( $READ, NULL, $T_ST );
		
	// GET FIELDS USING FUNCTION
	$FIELDS = get_fields( $LIST,'profile' );
	
	echo rpl( '^FIELDS^', $FIELDS, $read );
}
else
{
	
	$_Q = $db->query("SELECT * FROM phpdesk_members WHERE username='{$_POST['username']}'");
	$_Q1 = $db->query("SELECT * FROM phpdesk_staff WHERE username='{$_POST['username']}'");
	$_Q2 = $db->query("SELECT * FROM phpdesk_admin WHERE name='{$_POST['username']}'");
	
	// securimage

include_once $_SERVER[‘DOCUMENT_ROOT’] . ‘/securimage/securimage.php’;

$securimage = new Securimage();

if ($securimage->check($_POST[‘captcha_code’]) == false) {
// the code was incorrect
// handle the error accordingly with your other error checking

// or you can do something really basic like this
die(‘The code you entered was incorrect. Click here to go back and try again.’);
}

	//
	// VALIDATIONS!!!
	// First validate the user fields
	// Second validate the custom fields
	//
	$VALIDATE = validate('user',$_POST);
	$valFields = validate('fields', $_POST, 'Profile');
	
	
	if( $valFields == 1 )
	{
		echo $error['fields'];
	}
	elseif( $VALIDATE != "" )
	{
		echo $VALIDATE;
	}
	elseif($db->num($_Q) || $db->num($_Q1) || $db->num($_Q2))
	{
		echo $error['user_exists'];		
	}
	else
	{
		//
		// Get an ID
		// Pretty messy right now... :(
		//
		$Q  = $db->query( "SELECT * FROM phpdesk_staff" );
		$Q1 = $db->query( "SELECT * FROM phpdesk_members" );
		$Q2 = $db->query( "SELECT * FROM phpdesk_admin" );
		$total = $db->num($Q) + $db->num($Q1) + $db->num($Q2) + 2;
		while($x < $total)
		{	
			$x++;
			$Q = $db->query("SELECT * FROM phpdesk_staff WHERE id='{$x}'");
			$Q1 = $db->query("SELECT * FROM phpdesk_members WHERE id='{$x}'");
			$Q2 = $db->query("SELECT * FROM phpdesk_admin WHERE id='{$x}'");
															
			if(!$db->num($Q) && !$db->num($Q1) && !$db->num($Q2))
			{
				$id_got = $x;
				break;
			}
		}
		
		// Get Fields and Values for mySQL
		$FIELDS  =  get_fields ( '', 'profile', 'SQL' );
		$VALUES  =  val_fields ( $_POST, 'profile' );
		
		$sql = "INSERT INTO phpdesk_members (id,username,name,password,email,website,notify_pm,notify_response,registered,tppage,`FIELDS`,`VALUES`)
		VALUES('".$id_got."','".trim($_POST['username'])."', '".$_POST['name']."', '".md5($_POST['password'])."', '".$_POST['email']."', '".$_POST['website']."',
		'".$_POST['n_pm']."', '".$_POST['n_response']."', '".time()."', '".$_POST['tppage']."', '$FIELDS', '$VALUES')";

		if($db->query($sql))
		{
			echo $success['register'];
		}

		echo mail_it('register', $_POST['email'], $general['mail_title']);
	}
}

}

// INCLUDE FOOTER FILE
include_once ( ‘footer.php’ );

// Flush all the headers
ob_end_flush();

?>[/php]

As for the mandatory fields I am not sure that they are in the register.php i don’t know where it would be?

I need someone to have a look through the system for me to sort it if poss? Many thanks.

George

Sponsor our Newsletter | Privacy Policy | Terms of Service