This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** MOD_Archive START COPY FROM THIS LINE, paste beneath /main.inc.php " require(INCLUDE_DIR.'mysql.php');" | |
* Which subfolder would you like to start archiving tickets into? | |
*/ | |
define ( 'BACKUPDIR', ROOT_DIR . 'backups' . DIRECTORY_SEPARATOR ); | |
/** | |
* Change to false to show more output, makes cron send emails which you may not care about. | |
*/ | |
define ( 'CRONFRIENDLY', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define ( 'MEMCACHED_LOCATION', 'localhost' ); // Change to your memcached implementation.. should be possible to access multiple memcache servers in future if necessary. | |
define ( 'MEMCACHED_PORT', '11211' ); // Port number. Don't forget to allow this over the network if not local. | |
define ( 'MEMCACHED_PREFIX', 'ost-' ); // must be unique on server This references osTickets specifically. | |
define ( 'MEMCACHED_DEFAULT_TIMEOUT', 3600 ); // 1 hour. | |
define ( 'MEMCACHED_DEBUGMODE', true ); // set to true to show cache deletions and populations in apache logs. | |
/** | |
* Abstract extendible class containing PHP Memcached functions that facilitate and ease use for applications and mini-calls. | |
* ;-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define ( 'HIGH_PRIORITY', 1 ); | |
define ( 'NORMAL_PRIORITY', 2 ); | |
define ( 'LOW_PRIORITY', 3 ); | |
define ( 'NO_PRIORITY', 0 ); | |
echo "Time to beat: 0.027ms\n"; | |
test ( 'StrPos', 'strposversion' ); | |
test ( 'PregMatch', 'pregmatchversion' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've just trawled the code (including latest dev), and no, there is no part of it which will do that.. | |
Shouldn't be too hard to implement though, just a few modifications, and a single db entry! | |
First, Run this query to create the template: | |
<?php | |
INSERT INTO `tickets`.`ost_email_template` (`id`, `tpl_id`, `code_name`, `subject`, `body`, `created`, `updated`) VALUES (NULL, 1, 'ticket.close', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, | |
Our customer care team has closed the ticket, #%{ticket.number} on your behalf. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 49c17afdb035cf825288613cc1011aeb86ebdb01 Mon Sep 17 00:00:00 2001 | |
From: Grizly <clonemeagain@gmail.com> | |
Date: Sun, 26 Jan 2014 10:44:36 +1100 | |
Subject: [PATCH 1/1] Actual changes to osTicket to implement Custom PHP file | |
actions for Ticket Filters. | |
--- | |
include/class.filter.php | 7 +++++++ | |
include/staff/filter.inc.php | 20 ++++++++++++++++++++ | |
2 files changed, 27 insertions(+), 0 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
import cookielib | |
import urllib2 | |
# Configure the server IP, Username & Password (defaults provided) | |
server='10.0.0.1:8181' | |
username='administrator' | |
password='admin123' | |
# Using mechanize: http://wwwsearch.sourceforge.net/mechanize/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An example service definition for nagios that assumes you have the following information: | |
$DATABASE_{HOST,NAME,USER,PASS} for connecting to the database | |
$DOMAIN = to create a Nagios link | |
$PREFIX = what you used to prefix your db in osTicket (commonly ost) | |
Ensure check_mysql_query is installed and working, create a read-only db-user from your nagios host to your database, | |
tweak the open and unassigned ticket count to your liking, in this example 100 = warning, 250 = critical | |
define service { | |
host_name $DATABASE_HOST | |
service_description OsTickets Open Tickets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example crontab, every Friday night etc: | |
#m h dom mon dow command | |
0 23 * * 5 /path/to/support/prune_files.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import json | |
import urllib2 | |
''' | |
Loads as many settings as makes sense for every domain in your account | |
Then stores those settings in a json file named for the domain. | |
''' | |
api_prefix = 'https://api.cloudflare.com/client/v4/zones/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -q | |
<?php | |
/********************************************************************* | |
rcron.php | |
PHP script used for remote cron calls. | |
To make this work, setup an API key for localhost with ip: 127.0.0.1 | |
Put this script in the root of your webserver, then call it |
OlderNewer