Of course.
Database
I use two DB. Ticket for osTicket and Extra for my modifications.
In Extra is the table staff_settings. This is what interests you.
Columns are id (of course), next staff_id and a column for authorization check.
For authorization check i use only 1 or 0 (yes or no), but you can use more for authorization level, if you need.
Directory and files in
In osTicket directory is a subfolder ph_scripts with all my files. On upgrade osTicket I need copy only one folder.
In this folder is, as example, file pA_modify.inc.php with following content:
<?php
//Connection with DB and table
include "../PH_scripts/connect_db.php";
$tabulka=mysqli_select_db($spojeni, "cis_extra");
mysqli_query($spojeni, "set names utf8");
if(!@tabulka) die ("Nicht verbunden mit Database cis_extra.");
//Get staff ID from osTicket
$StaffID = $thisstaff->getId();
$pa_anpassungen = 0;
//Read value from table staff_settings into variable
if(!$cis_staff_settings = mysqli_query($spojeni, "SELECT * FROM cis_staff_settings WHERE id=\"$StaffID\"")) {echo "<h2>Nicht verbunden mit Tabelle cis_staff_settings.</h2>\n"; }
while($cis_staff_settings = mysqli_fetch_array($cis_staff_settings))
{
$pa_anpassungen = $cis_staff_settings["pa_anpassungen"];
}
mysqli_close($spojeni);
//If variable contains 1, show a link SCP
if($pa_anpassungen == "1") {
$Link = "./PAAD/get.php?StaffID=".$thisstaff->getId();?>
| <a href="<?php echo ROOT_PATH.$Link ?>" target="_blank"><?php echo __('pA Anpassungen'); ?></a>
<?php } ?>
Editing osTicket core file
Add INCLUDE function anywhere you want.
In my case I add <?php include "../PH_scripts/pA_modify.inc.php"?>
in \include\staff\header.inc.php
<div id="header">
<p id="info" class="pull-right no-pjax"><?php echo sprintf(__('Welcome, %s.'), '<strong>'.$thisstaff->getFirstName().'</strong>'); ?>
<?php
if($thisstaff->isAdmin() && !defined('ADMINPAGE')) { ?>
| <a href="<?php echo ROOT_PATH ?>scp/admin.php" class="no-pjax"><?php echo __('Admin Panel'); ?></a>
<?php }else{ ?>
| <a href="<?php echo ROOT_PATH ?>scp/index.php" class="no-pjax"><?php echo __('Agent Panel'); ?></a>
<?php } ?>
| <a href="<?php echo ROOT_PATH ?>scp/profile.php"><?php echo __('Profile'); ?></a>
<?php include "../PH_scripts/pA_modify.inc.php"?>
| <a href="<?php echo ROOT_PATH ?>scp/logout.php?auth=<?php echo $ost->getLinkToken(); ?>" class="no-pjax"><?php echo __('Log Out'); ?></a>
</p>
<a href="<?php echo ROOT_PATH ?>scp/index.php" class="no-pjax" id="logo">
<span class="valign-helper"></span>
<img src="<?php echo ROOT_PATH ?>scp/logo.php?<?php echo strtotime($cfg->lastModified('staff_logo_id')); ?>" alt="osTicket — <?php echo __('Customer Support System'); ?>"/>
</a>
</div>
On upgrade osTicket I need add only this one line.