Greetings,
First I want to say that I've enjoyed eticket so far.
I went ahead and registered because I'm looking for a little guidance.
I'm looking for where the delete button is rendered for the private messages and in the view ticket screen for admin status.
Rather than describe what I've done, here's some code:
in init.php:
//Ugly Hack
<?php
$sql_del = "SELECT value from ". $db_table['settings']." WHERE `key` = 'del_allowed'";
$a_result = mysql_query($sql_del);
$allowed_del = mysql_fetch_assoc($a_result);
if(strpos($allowed_del['value'], $_SESSION['user']['id']) !== false)
{
$_SESSION['user']['allow_delete'] = '1';
}
else
{
$_SESSION['user']['allow_delete'] = '0';
}
?>
then in main.html.php
<?php // around line 57
if ($_SESSION['user']['type'] == 'admin'):
?>
<?php if ($_SESSION['user']['allow_delete'] === '1')
{
?><input class="inputsubmit" type="submit" id="delete" name="delete" title="<?php echo LANG_TIP_DELETE; ?>" onClick='if(confirm("<?php echo LANG_DELETE_CONFIRM; ?>")) return; else return false;' value="<?php echo LANG_DELETE; ?>">
<?php
}
else
{
//maybe publish a disabled button.
}
?>
I'd like to use this same session variable to set the availability of delete button through out the web app.
If this is unclear, please ask me to clarify. Its 8:00am here and I'm a quart low on coffee.
Thanks,
-Todd