Initial commit

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
Luke Tainton
2020-02-26 12:23:50 +00:00
commit 39782c53ef
500 changed files with 141257 additions and 0 deletions

BIN
hesk/install/hesk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,430 @@
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
function hesk_insertTag(tag) {
var text_to_insert = '%%'+tag+'%%';
hesk_insertAtCursor(document.form1.msg, text_to_insert);
document.form1.message.focus();
}
function hesk_insertAtCursor(myField, myValue) {
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
function hesk_changeAll(myID) {
var d = document.form1;
var setTo = myID.checked ? true : false;
for (var i = 0; i < d.elements.length; i++)
{
if(d.elements[i].type == 'checkbox' && d.elements[i].name != 'checkall')
{
d.elements[i].checked = setTo;
}
}
}
function hesk_attach_disable(ids) {
for($i=0;$i<ids.length;$i++) {
if (ids[$i]=='c11'||ids[$i]=='c21'||ids[$i]=='c31'||ids[$i]=='c41'||ids[$i]=='c51') {
document.getElementById(ids[$i]).checked=false;
}
document.getElementById(ids[$i]).disabled=true;
}
}
function hesk_attach_enable(ids) {
for($i=0;$i<ids.length;$i++) {
document.getElementById(ids[$i]).disabled=false;
}
}
function hesk_attach_toggle(control,ids) {
if (document.getElementById(control).checked) {
hesk_attach_enable(ids);
} else {
hesk_attach_disable(ids);
}
}
function hesk_window(PAGE,HGT,WDT)
{
var HeskWin = window.open(PAGE,"Hesk_window","height="+HGT+",width="+WDT+",menubar=0,location=0,toolbar=0,status=0,resizable=1,scrollbars=1");
HeskWin.focus();
}
function hesk_toggleLayerDisplay(nr) {
if (document.all)
document.all[nr].style.display = (document.all[nr].style.display == 'none') ? 'block' : 'none';
else if (document.getElementById)
document.getElementById(nr).style.display = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
}
function hesk_confirmExecute(myText) {
if (confirm(myText))
{
return true;
}
return false;
}
function hesk_deleteIfSelected(myField,myText) {
if(document.getElementById(myField).checked)
{
return hesk_confirmExecute(myText);
}
}
function hesk_rate(url,element_id)
{
if (url.length==0)
{
return false;
}
var element = document.getElementById(element_id);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
element.innerHTML = xmlHttp.responseText;
}
}
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("rating").innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
var heskKBquery = '';
var heskKBfailed = false;
function hesk_suggestKB()
{
var d = document.form1;
var s = d.subject.value;
var m = d.message.value;
var element = document.getElementById('kb_suggestions');
if (s != '' && m != '' && (heskKBquery != s + " " + m || heskKBfailed == true) )
{
element.style.display = 'block';
var params = "p=1&" + "q=" + encodeURIComponent( s + " " + m );
heskKBquery = s + " " + m;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
return;
}
xmlHttp.open('POST','suggest_articles.php',true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
element.innerHTML = xmlHttp.responseText;
heskKBfailed = false;
}
else
{
heskKBfailed = true;
}
}
xmlHttp.send(params);
}
setTimeout(function() { hesk_suggestKB(); }, 2000);
}
function hesk_suggestKBsearch(isAdmin)
{
var d = document.searchform;
var s = d.search.value;
var element = document.getElementById('kb_suggestions');
if (isAdmin)
{
var path = 'admin_suggest_articles.php';
}
else
{
var path = 'suggest_articles.php';
}
if (s != '' && (heskKBquery != s || heskKBfailed == true) )
{
element.style.display = 'block';
var params = "q=" + encodeURIComponent( s );
heskKBquery = s;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
return;
}
xmlHttp.open('POST', path, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
element.innerHTML = unescape(xmlHttp.responseText);
heskKBfailed = false;
}
else
{
heskKBfailed = true;
}
}
xmlHttp.send(params);
}
setTimeout(function() { hesk_suggestKBsearch(isAdmin); }, 2000);
}
function hesk_suggestEmail(emailField, displayDiv, padDiv, isAdmin, allowMultiple)
{
var email = document.getElementById(emailField).value;
var element = document.getElementById(displayDiv);
if (isAdmin)
{
var path = '../suggest_email.php';
}
else
{
var path = 'suggest_email.php';
}
if (email != '')
{
var params = "e=" + encodeURIComponent(email) + "&ef=" + encodeURIComponent(emailField) + "&dd=" + encodeURIComponent(displayDiv) + "&pd=" + encodeURIComponent(padDiv);
if (allowMultiple)
{
params += "&am=1";
}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
return;
}
xmlHttp.open('POST', path, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
element.innerHTML = unescape(xmlHttp.responseText);
element.style.display = 'block';
}
}
xmlHttp.send(params);
}
}
function hesk_btn(Elem, myClass)
{
Elem.className = myClass;
}
function hesk_checkPassword(password)
{
var numbers = "0123456789";
var lowercase = "abcdefghijklmnopqrstuvwxyz";
var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var punctuation = "!.@$#*()%~<>{}[]";
var combinations = 0;
if (hesk_contains(password, numbers) > 0) {
combinations += 10;
}
if (hesk_contains(password, lowercase) > 0) {
combinations += 26;
}
if (hesk_contains(password, uppercase) > 0) {
combinations += 26;
}
if (hesk_contains(password, punctuation) > 0) {
combinations += punctuation.length;
}
var totalCombinations = Math.pow(combinations, password.length);
var timeInSeconds = (totalCombinations / 200) / 2;
var timeInDays = timeInSeconds / 86400
var lifetime = 365000;
var percentage = timeInDays / lifetime;
var friendlyPercentage = hesk_cap(Math.round(percentage * 100), 98);
if (friendlyPercentage < (password.length * 5)) {
friendlyPercentage += password.length * 5;
}
var friendlyPercentage = hesk_cap(friendlyPercentage, 98);
var progressBar = document.getElementById("progressBar");
progressBar.style.width = friendlyPercentage + "%";
if (percentage > 1) {
// strong password
progressBar.style.backgroundColor = "#3bce08";
return;
}
if (percentage > 0.5) {
// reasonable password
progressBar.style.backgroundColor = "#ffd801";
return;
}
if (percentage > 0.10) {
// weak password
progressBar.style.backgroundColor = "orange";
return;
}
if (percentage <= 0.10) {
// very weak password
progressBar.style.backgroundColor = "red";
return;
}
}
function hesk_cap(number, max) {
if (number > max) {
return max;
} else {
return number;
}
}
function hesk_contains(password, validChars) {
count = 0;
for (i = 0; i < password.length; i++) {
var char = password.charAt(i);
if (validChars.indexOf(char) > -1) {
count++;
}
}
return count;
}
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain)
{
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}

961
hesk/install/hesk_style.css Normal file
View File

@@ -0,0 +1,961 @@
body {
background-color: #f3fef4;
color: black;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
margin-left:0;
margin-right:0;
margin-top:0;
margin-bottom:0;
}
table.enclosing {
background-color:#FFFFFF;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
width: 960px;
}
td {
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: left;
}
a img {
vertical-align: bottom;
border : none;
}
td.white {
background-color: #FFFFFF;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
td.admin_white {
background-color: #FFFFFF;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border: #d1dceb 1px solid;
padding: 1px;
}
td.admin_gray {
background-color: #f5fffa;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border: #d1dceb 1px solid;
padding: 1px;
}
td.notes {
background-color: #fffbf2;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
border: #ffe6b8 1px solid;
}
th.tDetailsHead {
background-color: #F7F7F7;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
text-align: center;
}
td.tDetailsBody {
background-color: #FFFFFF;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
border: #F7F7F7 1px solid;
text-align: center;
}
.small {
font-size: 11px;
}
.smaller {
font-size: 10px;
}
a {
color : Blue;
text-decoration : underline;
}
a:hover {
color : Red;
text-decoration : none;
}
a.smaller {
font-size: 10px;
color : Blue;
text-decoration : underline;
}
a.smaller:hover {
font-size: 10px;
color : Red;
text-decoration : none;
}
table.white {
background-color: #ffffff ;
color : #23559C;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
border-collapse: collapse;
}
table.white th {
background-color: #ffffff;
color : #23559C;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border: #b2babd 1px solid;
border-collapse: collapse;
background-image: url(img/tableheader.jpg);
background-repeat: no-repeat;
background-position: left top;
}
table.white th a {
color : #23559C;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}
table.white td {
height: 25px;
padding-left: 5px;
}
.noborder {
border: none;
}
h3 {
color : #74804e;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
margin: 0px;
}
.important {
color: Red;
}
.medium {
color: #FF9900;
}
input {
font-size: 12px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color:#000000;
}
input.button {
font-size: 12px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color:#000000;
background-color:#FFFFFF;
}
select {
font-size: 12px;
height: 20px;
}
header a img {border: none; text-decoration: none !important;}
.open {color : #FF0000;}
.waitingreply {color : #FF9933;}
.replied {color : #0000FF;}
.resolved {color : #008000;}
.allbutresolved {color : #000000;}
.success {color : #008000;}
.error {color : #FF0000;}
.notice {color : #FF9900}
#ok {
border: 1px solid #679800;
}
#error {
border: 1px solid #ba3225;
}
.rate {
color: #666666;
text-align: right;
font-style: italic;
}
a.article {
color : Black;
text-decoration: none;
font-size: 11px;
}
a.article:hover {
color : Red;
text-decoration : none;
}
.article_list {
font-size: 11px;
}
fieldset {
margin-bottom: 6px;
border: 1px SOLID #267DDC;
padding: 4px;
background-color:white;
position:relative;
display:block;
padding: 15px 10px 10px 10px;
margin:20px 0px 20px 0px;
}
legend {
background-image: url(img/bluebtn.png);
background-repeat: no-repeat;
color: #172901;
border: 1px solid #267DDC;
height: 10px;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
display:block;
width: auto;
padding:5px 5px;
position:relative;
width:130px;
}
/*newly introduced styles (version 2.0)*/
.header {
width: 100%;
background-color: #74a62b;
color : #ffffff;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: center;
background-image: url(img/header.png);
background-repeat: repeat-x;
height: 57px;
padding: 0px;
margin: 0px;
}
.header td {
text-align: center;
vertical-align: middle;
color:#FFFFFF;
}
.header a, .header a:link, .header a:active, .header a:visited {
color : #ffffff;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: center;
}
.header a:hover {}
.headersm {
width: 100%;
background-color: #669933;
color : #ffffff;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: left;
background-image: url(img/headerbgsm.jpg);
background-repeat: repeat-x;
height: 25px;
padding: 0px;
margin: 0px;
font-weight:bold;
padding-left: 20px;
}
hr {
border: none;
border-bottom: 1px dotted #adbac3;
width: 100%;
padding-top: 10px;
margin-bottom: 10px;
height: 1px;
}
.greenbutton {
background-image: url(img/greenbtn.jpg);
background-repeat: no-repeat;
text-align: center;
color: #FFFFFF;
border: 1px solid #527234;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
height: 19px;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px
}
.greenbuttonover {
background-image: url(img/greenbtnover.gif);
background-repeat: no-repeat;
text-align: center;
color: #FFFFFF;
border: 1px solid #527234;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
height: 19px;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px
}
.orangebutton {
background-image: url(img/orangebtn.jpg);
background-repeat: no-repeat;
text-align: center;
color: #660000;
border: 1px solid #bf6628;
height: 20px;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px;
text-decoration: none;
margin-top: 0px;
}
.orangebuttonover {
background-image: url(img/orangebtnover.gif);
background-repeat: no-repeat;
text-align: center;
color: #660000;
border: 1px solid #bf6628;
height: 20px;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px;
text-decoration: none;
margin-top: 0px;
}
.bluebutton {
background-image: url(img/bluebtn.png);
background-repeat: no-repeat;
text-align: center;
color: #660000;
border: 1px solid #5b79a3;
height: 20px;
font-size: 10px;
font-weight:bold;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
text-decoration: none;
margin-right: 2px;
padding-top: 2px;
}
/*styles for roundcorners tables*/
.roundcornersleft {
width: 7px;
background-image: url(img/roundcornerslm.jpg);
background-repeat: repeat-y;
background-position: left;
}
.roundcornersright {
width: 7px;
background-image: url(img/roundcornersrm.jpg);
background-repeat: repeat-y;
background-position: right;
}
.roundcornerstop {
height: 7px;
background-image: url(img/roundcornerst.jpg);
background-repeat: repeat-x;
background-position: top;
}
.roundcornersbottom {
height: 7px;
background-image: url(img/roundcornersb.jpg);
background-repeat: repeat-x;
background-position: bottom;
}
.ticketrow {
background-color: #f5fffa;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
border: #748aaf 1px dotted;
padding: 6px;
}
.ticketalt {
background-color: #ffffff;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
padding: 6px;
}
.tickettd {
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.subheaderrow {
background-color: #ffffff;
color : #23559C;
border: #23559C solid 1px;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border-collapse: collapse;
background-image: url(img/tableheader.jpg);
background-repeat: no-repeat;
background-position: left top;
height: 25px;
padding-left: 20px;
padding-right: 20px;
padding-top: 5px;
}
.homepageh3, .section {
color: #74804e;
font-weight: bold;
}
/*newly introduced styles (version 2.2)*/
.large {
font-size:14px;
}
.largebold {
font-size:14px;
font-weight:bold;
}
.assignedyou {
color: red;
}
.assignedother {
color: green;
}
div.error {
border: 1px solid #cd0a0a;
background: #fef1ec;
color: #cd0a0a;
padding: 10px;
}
div.success {
border: 1px solid #18760f;
background: #e9ffdb;
color: #363636;
padding: 10px;
}
div.notice {
border: 1px solid #fcefa1;
background: #fff9de;
color: #363636;
padding: 10px;
vertical-align: middle;
}
.admin_green {
background-color: #e3ffd0;
font-weight: bold;
}
.admin_red {
background-color: #fef1ec;
font-weight: bold;
}
.borderBottom {
border-bottom: silver 1px dashed;
}
.borderTop {
border-top: silver 1px dashed;
}
.alignTop {
vertical-align: top;
}
.alignMiddle {
vertical-align: middle;
}
.alignBottom {
vertical-align: bottom;
}
hr.dashed {
border: none 0;
border-top: 1px dashed silver;
height: 1px;
}
/* newly introduced styles (version 2.3) */
h1 {
color : #74804e;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
margin: 0px;
}
.critical {
color: #9400d3;
font-weight: bold;
}
td.admin_critical {
background-color: #fff0ff;
color : #000000;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border: 1px solid #ff66ff;
padding: 1px;
}
.isError {
color: black;
background-color: #fff9f7;
border: 1px solid red;
}
.isNotice {
color: black;
border: 1px solid orange;
background: #fbf9ee;
}
.optionWhiteON{
padding:2px;
border:1px dotted silver;
background-color: #b0e0e6;
}
.optionWhiteOFF {
padding:2px;
border:1px dotted silver;
background-color: white;
}
.optionBlueON {
padding:2px;
border:1px dotted gray;
background-color: #b0e0e6;
}
.optionBlueOFF {
padding:2px;
border:1px dotted gray;
background-color: #f5fffa;
}
.optionWhiteNbON{
border: none;
background-color: #b0e0e6;
vertical-align: text-bottom;
}
.optionWhiteNbOFF {
border: none;
background-color: white;
vertical-align: text-bottom;
}
.kbCatListON {
background-color: #fcefa1;
}
.kbCatListOFF {
background-color: white;
}
div.progress-container {
border: 1px solid #ccc;
width: 100px;
margin: 2px 5px 2px 0;
padding: 1px;
float: left;
background: white;
}
div.progress-container > div {
background-color: #ACE97C;
height: 12px
}
.black {color: black;}
.inprogress {color : #006400;}
.onhold {color : #000000;}
div.online {
border: 1px solid #e5e8ff;
background: #ffffff;
color: #000000;
padding: 0px;
vertical-align: middle;
}
span.online {
font-size: 10px;
white-space:nowrap;
}
/* newly introduced styles (version 2.4) */
.orangebuttonsec {
background-image: url(img/orangebtnsec.jpg);
background-repeat: no-repeat;
text-align: center;
color: #660000;
border: 1px solid #bf6628;
height: 20px;
font-size: 10px;
font-weight:normal;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px;
text-decoration: none;
margin-top: 0px;
}
.orangebuttonsecover {
background-image: url(img/orangebtnover.gif);
background-repeat: no-repeat;
text-align: center;
color: #660000;
border: 1px solid #bf6628;
height: 20px;
font-size: 10px;
font-weight:normal;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
background-position: left top;
padding-left: 6px;
padding-right: 6px;
margin-left: 2px;
margin-right: 2px;
text-decoration: none;
margin-top: 0px;
}
td.admin_yellow {
background-color: #ffffe0;
color : #4a5571;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border: #d1dceb 1px solid;
padding: 1px;
}
/* New styles in HESK version 2.5 */
.kb_published {
color: #009900;
}
.kb_private {
color: #4a5571;
}
.kb_draft {
color: #cc9933;
}
.searchbutton {
cursor:pointer;
width:70px;
height:27px;
text-indent:-999px;
text-transform: capitalize;
color: transparent;
background: url(img/ico-search.png) no-repeat #4d90fe center;
border: 1px solid #3079ED;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
.searchbutton:hover {
background: url(img/ico-search.png) no-repeat center #357AE8;
border: 1px solid #2F5BB7;
}
.searchfield {
width:400px;
height:21px;
font-size:14px;
text-indent:2px;
vertical-align: bottom;
}
.sbsmall {
width:50px;
height:22px;
margin-top:2px;
}
.sfsmall {
width:200px;
height:16px;
font-size:12px;
margin-top:2px;
}
/* New styles in HESK version 2.6 */
div.info {
border: 1px solid #9acfea;
background: #d9edf7;
color: #363636;
padding: 10px;
vertical-align: middle;
}
div.none {
color: #363636;
padding: 10px;
vertical-align: middle;
}
/* New styles in HESK version 2.7 */
div.select_category
{
min-width: 50%;
min-height: 300px;
display: inline-block;
text-align:left;
margin-top: 10px;
}
#select_category {
border: 1px solid #111;
background: transparent;
width: 100%;
padding: 5px 35px 5px 5px;
font-size: 14px;
border: 1px solid #ccc;
height: 34px;
}
#ul_category {
list-style-type: none;
margin: 0;
padding: 0;
}
#ul_category li {
border: 1px solid #d1d5d7;
border-top: none;
border-radius: 2px;
}
#ul_category li:first-child {
border-top: 1px solid #d1d5d7;
}
#ul_category li a {
display: block;
font-size: 14px;
padding: 0.75em 0.75em;
text-decoration: none;
transition: all 0.12s ease;
word-wrap: break-word;
}
#ul_category li a:hover {
color: black;
background-color: #e9ffdb;
}
select.multiple {
font-size: 12px;
height: auto;
}
/* New styles in HESK version 2.8 */
#hesk_nav{
list-style:none;
float:right;
/* Bring the nav above everything else--uncomment if needed.
position:relative;
z-index:5;
*/
margin: 0px;
}
#hesk_nav li{
float:left;
margin-right:4px;
position:relative;
}
#hesk_nav a{
display:block;
background-color:#ffffff;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
border:1px solid #dcdcdc;
cursor:pointer;
color:#666666;
font-size:12px;
padding:4px 10px;
text-decoration:none;
}
#hesk_nav a:hover{
color: red;
background:#f6f6f6;
}
/*--- DROPDOWN ---*/
#hesk_nav ul{
background:#fff; /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */
background:rgba(255,255,255,0); /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */
list-style:none;
position:absolute;
left:-9999px; /* Hide off-screen when not needed (this is more accessible than display:none;) */
z-index:5;
padding-left: 0px;
padding-top: 2px;
}
#hesk_nav ul li{
padding-top:1px; /* Introducing a padding between the li and the a give the illusion spaced items */
float:none;
}
#hesk_nav ul a{
white-space:nowrap; /* Stop text wrapping and creating multi-line dropdown items */
padding:8px 14px;
}
#hesk_nav li:hover ul{ /* Display the dropdown on hover */
left:auto; /* Bring back on-screen when needed */
text-align:left;
right:0;
margin-right:-10px;
}
#hesk_nav li:hover a{ /* These create persistent hover states, meaning the top-most link stays 'hovered' even when your cursor has moved down the list. */
background:#f6f6f6;
text-decoration:none;
}
#hesk_nav li:hover ul a{
background:#ffffff;
text-decoration:none;
}
#hesk_nav li:hover ul a{ /* The persistent hover state does however create a global style for links even before they're hovered. Here we undo these effects. */
text-decoration:none;
}
#hesk_nav li:hover ul li a:hover{ /* Here we define the most explicit hover states--what happens when you hover each individual link. */
background:#f6f6f6;
}
.notification {
background-color: #fff;
box-shadow: 0 4px 8px 0 rgba(0, 41, 89, 0.1);
padding: 20px 28px 20px 28px;
position: relative;
display: block;
margin-bottom: 24px;
}
.notification::before {
content: "";
width: 8px;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.notification.red {
background-color: #fff5f5;
}
.notification.red::before {
background-color: #e64342;
}
.notification.orange {
background-color: #ffffcc;
}
.notification.orange::before {
background-color: #eeb707;
}
.notification.green {
background-color: #f0fff4;
}
.notification.green::before {
background-color: #38bc7d;
}
.notification.blue {
background-color: #ebf8ff;
}
.notification.blue::before {
background-color: #002d73;
}
.notification b {
font-weight: bold;
}
.notification i {
font-style: italic;
}

BIN
hesk/install/img/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

49
hesk/install/index.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
define('IN_SCRIPT',1);
define('HESK_PATH','../');
require(HESK_PATH . 'install/install_functions.inc.php');
// Reset installation steps
hesk_session_stop();
hesk_iHeader();
?>
<table border="0" width="100%">
<tr>
<td><a href="https://www.hesk.com"><img src="hesk.png" width="166" height="60" alt="Visit HESK.com" border="0" /></a></td>
<td align="center"><h3>Thank you for downloading HESK. Please choose an option below:</h3></td>
</tr>
</table>
<hr />
<form method="get" action="install.php">
<p align="center"><input type="submit" value="Click here to INSTALL HESK &raquo;" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p>
<p align="center">Install a new copy of HESK</p>
</form>
<hr />
<form method="get" action="update.php">
<p align="center"><input type="submit" value="Click here to UPDATE HESK &raquo;" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p>
<p align="center">Update existing HESK to version <?php echo HESK_NEW_VERSION; ?></p>
</form>
<?php
hesk_iFooter();
exit();
?>

744
hesk/install/install.php Normal file
View File

@@ -0,0 +1,744 @@
<?php
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
define('IN_SCRIPT',1);
define('HESK_PATH','../');
define('INSTALL_PAGE', 'install.php');
require(HESK_PATH . 'install/install_functions.inc.php');
// If no step is defined, start with step 1
if ( ! isset($_SESSION['step']) )
{
$_SESSION['step']=1;
}
// Check if the license has been agreed to and verify sessions are working
elseif ($_SESSION['step']==1)
{
$agree = hesk_POST('agree', '');
if ($agree == 'YES')
{
// Are sessions working?
if ( empty($_SESSION['works']) )
{
hesk_iSessionError();
}
// All OK, continue
$_SESSION['license_agree']=1;
$_SESSION['step']=2;
}
else
{
$_SESSION['step']=1;
}
}
// Test database connection?
if ($_SESSION['step'] == 3 && isset($_POST['dbtest']) )
{
// Username
$_SESSION['admin_user'] = hesk_input( hesk_POST('admin_user') );
if ( strlen($_SESSION['admin_user']) == 0 )
{
$_SESSION['admin_user'] = 'Administrator';
}
// Password
$_SESSION['admin_pass'] = hesk_input( hesk_POST('admin_pass') );
if ( strlen($_SESSION['admin_pass']) == 0 )
{
$_SESSION['admin_pass'] = substr(str_shuffle("23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"), 0, mt_rand(8,12) );
}
// Password hash for the database
$_SESSION['admin_hash'] = hesk_Pass2Hash($_SESSION['admin_pass']);
// Test DB connection
$hesk_db_link = hesk_iTestDatabaseConnection();
// Generate HESK table names
$hesk_tables = array(
$hesk_settings['db_pfix'].'attachments',
$hesk_settings['db_pfix'].'banned_emails',
$hesk_settings['db_pfix'].'banned_ips',
$hesk_settings['db_pfix'].'categories',
$hesk_settings['db_pfix'].'custom_fields',
$hesk_settings['db_pfix'].'custom_statuses',
$hesk_settings['db_pfix'].'kb_articles',
$hesk_settings['db_pfix'].'kb_attachments',
$hesk_settings['db_pfix'].'kb_categories',
$hesk_settings['db_pfix'].'logins',
$hesk_settings['db_pfix'].'mail',
$hesk_settings['db_pfix'].'notes',
$hesk_settings['db_pfix'].'online',
$hesk_settings['db_pfix'].'pipe_loops',
$hesk_settings['db_pfix'].'replies',
$hesk_settings['db_pfix'].'reply_drafts',
$hesk_settings['db_pfix'].'reset_password',
$hesk_settings['db_pfix'].'service_messages',
$hesk_settings['db_pfix'].'std_replies',
$hesk_settings['db_pfix'].'tickets',
$hesk_settings['db_pfix'].'ticket_templates',
$hesk_settings['db_pfix'].'users',
);
// Check if any of the HESK tables exists
$res = hesk_dbQuery('SHOW TABLES FROM `'.hesk_dbEscape($hesk_settings['db_name']).'`');
while ($row = hesk_dbFetchRow($res))
{
if (in_array($row[0],$hesk_tables))
{
hesk_iDatabase(2);
}
}
// Timezone
$hesk_settings['timezone'] = hesk_input( hesk_POST('timezone') );
if ( ! in_array($hesk_settings['timezone'], timezone_identifiers_list()) )
{
$hesk_settings['timezone'] = 'UTC';
}
// All ok, let's save settings
hesk_iSaveSettings();
// Now install HESK database tables
hesk_iTables();
// And move to the next step
$_SESSION['step']=4;
}
// Which step are we at?
switch ($_SESSION['step'])
{
case 2:
hesk_iCheckSetup();
break;
case 3:
hesk_iDatabase();
break;
case 4:
hesk_iFinish();
break;
default:
hesk_iStart();
}
// ******* FUNCTIONS ******* //
function hesk_iFinish()
{
global $hesk_settings;
hesk_iHeader();
?>
<br />
<?php hesk_show_success('Congratulations, you have successfully completed HESK database setup!'); ?>
<h3>Next steps:</h3>
<ol>
<li><span style="color:#ff0000">Delete the <b>/install</b> folder from your server!</span><br />&nbsp;</li>
<li>Remember your login details:<br />
<pre style="font-size: 1.17em">
Username: <span style="color:red; font-weight:bold"><?php echo stripslashes($_SESSION['admin_user']); ?></span>
Password: <span style="color:red; font-weight:bold"><?php echo stripslashes($_SESSION['admin_pass']); ?></span>
</pre>
<br />&nbsp;
</li>
<table>
<tr>
<td>
<form action="<?php echo HESK_PATH . $hesk_settings['admin_dir']; ?>/index.php" method="post">
<input type="hidden" name="a" value="do_login" />
<input type="hidden" name="remember_user" value="JUSTUSER" />
<input type="hidden" name="user" value="<?php echo stripslashes($_SESSION['admin_user']); ?>" />
<input type="hidden" name="pass" value="<?php echo stripslashes($_SESSION['admin_pass']); ?>" />
<input type="hidden" name="goto" value="mail.php?a=read&amp;id=1" />
<input type="submit" value="Read HESK quick start guide" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" />
</form>
</td>
<td> - or -</td>
<td>
<form action="<?php echo HESK_PATH . $hesk_settings['admin_dir']; ?>/index.php" method="post">
<input type="hidden" name="a" value="do_login" />
<input type="hidden" name="remember_user" value="JUSTUSER" />
<input type="hidden" name="user" value="<?php echo stripslashes($_SESSION['admin_user']); ?>" />
<input type="hidden" name="pass" value="<?php echo stripslashes($_SESSION['admin_pass']); ?>" />
<input type="hidden" name="goto" value="admin_settings_general.php" />
<input type="submit" value="Skip directly to settings" class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" />
</form>
</td>
</tr>
</table>
</ol>
<p>&nbsp;</p>
<?php
hesk_iFooter();
} // End hesk_iFinish()
function hesk_iTables()
{
global $hesk_db_link, $hesk_settings;
// -> Attachments
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."attachments` (
`att_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`ticket_id` varchar(13) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`saved_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`real_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`size` int(10) unsigned NOT NULL DEFAULT '0',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (`att_id`),
KEY `ticket_id` (`ticket_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Banned emails
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."banned_emails` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`banned_by` smallint(5) unsigned NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
");
// -> Banned IPs
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."banned_ips` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`ip_from` int(10) unsigned NOT NULL DEFAULT '0',
`ip_to` int(10) unsigned NOT NULL DEFAULT '0',
`ip_display` varchar(100) NOT NULL,
`banned_by` smallint(5) unsigned NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
");
// -> Categories
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`cat_order` smallint(5) unsigned NOT NULL DEFAULT '0',
`autoassign` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`priority` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '3',
PRIMARY KEY (`id`),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// ---> Insert default category
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` (`id`, `name`, `cat_order`) VALUES (1, 'General', 10)");
// -> Custom fields
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` (
`id` tinyint(3) UNSIGNED NOT NULL,
`use` enum('0','1','2') NOT NULL DEFAULT '0',
`place` enum('0','1') NOT NULL DEFAULT '0',
`type` varchar(20) NOT NULL DEFAULT 'text',
`req` enum('0','1','2') NOT NULL DEFAULT '0',
`category` text,
`name` text,
`value` text,
`order` smallint(5) UNSIGNED NOT NULL DEFAULT '10',
PRIMARY KEY (`id`),
KEY `useType` (`use`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// ---> Insert empty custom fields
hesk_dbQuery("
INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` (`id`, `use`, `place`, `type`, `req`, `category`, `name`, `value`, `order`) VALUES
(1, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(2, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(3, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(4, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(5, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(6, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(7, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(8, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(9, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(10, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(11, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(12, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(13, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(14, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(15, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(16, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(17, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(18, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(19, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(20, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(21, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(22, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(23, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(24, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(25, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(26, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(27, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(28, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(29, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(30, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(31, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(32, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(33, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(34, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(35, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(36, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(37, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(38, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(39, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(40, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(41, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(42, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(43, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(44, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(45, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(46, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(47, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(48, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(49, '0', '0', 'text', '0', NULL, '', NULL, 1000),
(50, '0', '0', 'text', '0', NULL, '', NULL, 1000)
");
// -> Custom statuses
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_statuses` (
`id` tinyint(3) UNSIGNED NOT NULL,
`name` text NOT NULL,
`color` varchar(6) NOT NULL,
`can_customers_change` enum('0','1') NOT NULL DEFAULT '1',
`order` smallint(5) UNSIGNED NOT NULL DEFAULT '10',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> KB Articles
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`catid` smallint(5) unsigned NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`author` smallint(5) unsigned NOT NULL,
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`keywords` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`rating` float NOT NULL DEFAULT '0',
`votes` mediumint(8) unsigned NOT NULL DEFAULT '0',
`views` mediumint(8) unsigned NOT NULL DEFAULT '0',
`type` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`html` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`sticky` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`art_order` smallint(5) unsigned NOT NULL DEFAULT '0',
`history` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `catid` (`catid`),
KEY `sticky` (`sticky`),
KEY `type` (`type`),
FULLTEXT KEY `subject` (`subject`,`content`,`keywords`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> KB Attachments
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_attachments` (
`att_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`saved_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`real_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`size` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`att_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> KB Categories
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`parent` smallint(5) unsigned NOT NULL,
`articles` smallint(5) unsigned NOT NULL DEFAULT '0',
`articles_private` smallint(5) unsigned NOT NULL DEFAULT '0',
`articles_draft` smallint(5) unsigned NOT NULL DEFAULT '0',
`cat_order` smallint(5) unsigned NOT NULL,
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `type` (`type`),
KEY `parent` (`parent`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// ---> Insert default KB category
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` (`id`, `name`, `parent`, `cat_order`, `type`) VALUES (1, 'Knowledgebase', 0, 10, '0')");
// -> Login attempts
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."logins` (
`ip` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`number` tinyint(3) unsigned NOT NULL DEFAULT '1',
`last_attempt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `ip` (`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Private messages
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."mail` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`from` smallint(5) unsigned NOT NULL,
`to` smallint(5) unsigned NOT NULL,
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`read` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`deletedby` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `from` (`from`),
KEY `to` (`to`,`read`,`deletedby`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// ---> Insert welcome email
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."mail` (`id`, `from`, `to`, `subject`, `message`, `dt`, `read`, `deletedby`) VALUES (NULL, 9999, 1, 'HESK quick start guide', '".hesk_dbEscape("</p><div style=\"text-align:justify; padding-left: 10px; padding-right: 10px;\">\r\n\r\n<p>&nbsp;<br /><b>Welcome to HESK! You'll find it is a great tool for improving your customer support.</b></p>\r\n\r\n<p><b>Here is a short guide to get you started.</b><br />&nbsp;</p>\r\n\r\n<hr />\r\nSTEP #1: setup your profile\r\n<hr />\r\n<ol>\r\n<li>go to <a href=\"profile.php\">Profile</a>,</li>\r\n<li>set your name and email address.</li>\r\n</ol>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #2: configure HESK\r\n<hr />\r\n<ol>\r\n<li>go to <a href=\"admin_settings_general.php\">Settings</a>,</li>\r\n<li>for a quick start, just modify these on the \"General\" tab:<br /><br />\r\nWebsite title<br />\r\nWebsite URL<br />\r\nWebmaster email<br />&nbsp;\r\n</li>\r\n<li>you can come back to the settings page later and explore all the options. To view details about a setting, click the [?]</li>\r\n</ol>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #3: add ticket categories\r\n<hr />\r\n<p>Go to <a href=\"manage_categories.php\">Categories</a> to add ticket categories.</p>\r\n<p>You cannot delete the default category, but you can rename it.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<hr />\r\nSTEP #4: add staff accounts\r\n<hr />\r\n<p>Go to <a href=\"manage_users.php\">Users</a> to create new staff accounts.</p>\r\n<p>You can use two user types in HESK:</p>\r\n<ul>\r\n<li><b>Administrators</b>, who have full access to all HESK features</li>\r\n<li><b>Staff</b>, who have access to limited privileges and categories</li>\r\n</ul>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #5: useful tools\r\n<hr />\r\n<p>You can do a lot on the <a href=\"banned_emails.php\">Tools</a> page, for example:</p>\r\n<ul>\r\n<li>create custom ticket statuses,</li>\r\n<li>add custom input fields to the \"Submit a ticket\" form,</li>\r\n<li>modify email templates,</li>\r\n<li>and more.</li>\r\n</ul>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #6: create a knowledgebase\r\n<hr />\r\n<p>A clear and comprehensive knowledgebase can drastically reduce the number of support tickets you receive, thereby saving you significant time and effort in the long run.</p>\r\n<p>Go to <a href=\"manage_knowledgebase.php\">Knowledgebase</a> to create categories and write articles for your knowledgebase.</p>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #7: don't repeat yourself\r\n<hr />\r\n<p>Sometimes several support tickets are addressing the same issues - allowing you to use pre-written (&quot;canned&quot;) responses.</p>\r\n<p>To compose canned responses go to <a href=\"manage_canned.php\">Canned</a> page.</p>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #8: secure your help desk\r\n<hr />\r\n<p>Make sure your help desk is as secure as possible by going through <a href=\"https://www.hesk.com/knowledgebase/?article=82\">HESK security check list</a></p>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #9: stay updated\r\n<hr />\r\n<p>HESK regularly receives improvements and bug fixes, make sure you know about them!</p>\r\n<ul>\r\n<li>for fast notifications, <a href=\"https://twitter.com/HESKdotCOM\">follow us on <b>Twitter</b></a></li>\r\n<li>for email notifications, subscribe to our low-volume zero-spam <a href=\"https://www.hesk.com/newsletter.php\">newsletter</a></li>\r\n</ul>\r\n\r\n&nbsp;\r\n\r\n<hr />\r\nSTEP #10: look professional\r\n<hr />\r\n<p>To look more professional and not advertise the tools you use, <a href=\"https://www.hesk.com/buy.php\">remove &quot;Powered by&quot; links</a> from your help desk.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>Again, welcome to HESK and enjoy using it!</p>\r\n\r\n<p>Klemen Stirn<br />\r\nAuthor and owner</p>\r\n\r\n</div><p>")."', NOW(), '0', 9999)");
// -> Notes
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."notes` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`ticket` mediumint(8) unsigned NOT NULL,
`who` smallint(5) unsigned NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `ticketid` (`ticket`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Online
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."online` (
`user_id` smallint(5) unsigned NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`tmp` int(11) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `user_id` (`user_id`),
KEY `dt` (`dt`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Pipe loops
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."pipe_loops` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`hits` smallint(1) unsigned NOT NULL DEFAULT '0',
`message_hash` char(32) COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY `email` (`email`,`hits`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Replies
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`replyto` mediumint(8) unsigned NOT NULL DEFAULT '0',
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`attachments` mediumtext COLLATE utf8_unicode_ci,
`staffid` smallint(5) unsigned NOT NULL DEFAULT '0',
`rating` enum('1','5') COLLATE utf8_unicode_ci DEFAULT NULL,
`read` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `replyto` (`replyto`),
KEY `dt` (`dt`),
KEY `staffid` (`staffid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Reply drafts
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."reply_drafts` (
`owner` smallint(5) unsigned NOT NULL,
`ticket` mediumint(8) unsigned NOT NULL,
`message` mediumtext CHARACTER SET utf8 NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY `owner` (`owner`),
KEY `ticket` (`ticket`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Reset password
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."reset_password` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`user` smallint(5) unsigned NOT NULL,
`hash` char(40) NOT NULL,
`ip` varchar(45) NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `user` (`user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
");
// -> Service messages
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`author` smallint(5) unsigned NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`style` enum('0','1','2','3','4') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`order` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
");
// -> Canned Responses
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."std_replies` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`reply_order` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Tickets
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`trackid` varchar(13) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`category` smallint(5) unsigned NOT NULL DEFAULT '1',
`priority` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '3',
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT '2000-01-01 00:00:00',
`lastchange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`firstreply` timestamp NULL DEFAULT NULL,
`closedat` timestamp NULL DEFAULT NULL,
`articles` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` tinyint(3) unsigned NOT NULL DEFAULT '0',
`openedby` mediumint(8) DEFAULT '0',
`firstreplyby` smallint(5) unsigned DEFAULT NULL,
`closedby` mediumint(8) NULL DEFAULT NULL,
`replies` smallint(5) unsigned NOT NULL DEFAULT '0',
`staffreplies` smallint(5) unsigned NOT NULL DEFAULT '0',
`owner` smallint(5) unsigned NOT NULL DEFAULT '0',
`assignedby` mediumint(8) NULL DEFAULT NULL,
`time_worked` time NOT NULL DEFAULT '00:00:00',
`lastreplier` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`replierid` smallint(5) unsigned DEFAULT NULL,
`archive` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`locked` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`merged` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`history` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom1` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom2` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom3` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom4` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom5` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom6` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom7` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom8` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom9` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom10` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom11` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom12` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom13` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom14` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom15` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom16` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom17` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom18` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom19` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom20` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom21` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom22` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom23` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom24` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom25` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom26` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom27` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom28` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom29` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom30` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom31` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom32` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom33` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom34` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom35` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom36` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom37` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom38` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom39` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom40` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom41` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom42` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom43` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom44` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom45` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom46` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom47` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom48` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom49` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom50` mediumtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `trackid` (`trackid`),
KEY `archive` (`archive`),
KEY `categories` (`category`),
KEY `statuses` (`status`),
KEY `owner` (`owner`),
KEY `openedby` (`openedby`,`firstreplyby`,`closedby`),
KEY `dt` (`dt`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Ticket templates
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."ticket_templates` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`tpl_order` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
// -> Users
hesk_dbQuery("
CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`pass` char(40) COLLATE utf8_unicode_ci NOT NULL,
`isadmin` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`signature` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`categories` varchar(500) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`afterreply` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`autostart` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`autoreload` smallint(5) unsigned NOT NULL DEFAULT '0',
`notify_customer_new` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_customer_reply` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`show_suggested` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_new_unassigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_new_my` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_reply_unassigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_reply_my` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_assigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_pm` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_note` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`default_list` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`autoassign` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`heskprivileges` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`ratingneg` mediumint(8) unsigned NOT NULL DEFAULT '0',
`ratingpos` mediumint(8) unsigned NOT NULL DEFAULT '0',
`rating` float NOT NULL DEFAULT '0',
`replies` mediumint(8) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `autoassign` (`autoassign`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
");
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."users` (`id`, `user`, `pass`, `isadmin`, `name`, `email`, `heskprivileges`) VALUES (1, '".hesk_dbEscape($_SESSION['admin_user'])."', '".hesk_dbEscape($_SESSION['admin_hash'])."', '1', 'Your name', 'you@example.com', '')");
return true;
} // End hesk_iTables()
function hesk_iSaveSettings()
{
global $hesk_settings, $hesklang;
$spam_question = hesk_generate_SPAM_question();
$hesk_settings['secimg_use'] = empty($_SESSION['set_captcha']) ? 0 : 1;
$hesk_settings['use_spamq'] = empty($_SESSION['use_spamq']) ? 0 : 1;
$hesk_settings['question_ask'] = $spam_question[0];
$hesk_settings['question_ans'] = $spam_question[1];
$hesk_settings['set_attachments'] = empty($_SESSION['set_attachments']) ? 0 : 1;
$hesk_settings['hesk_version'] = HESK_NEW_VERSION;
if (isset($_SERVER['HTTP_HOST']))
{
$protocol = HESK_SSL? 'https://' : 'http://';
$hesk_settings['site_url']=$protocol . $_SERVER['HTTP_HOST'];
if (isset($_SERVER['REQUEST_URI']))
{
$hesk_settings['hesk_url']=$protocol . $_SERVER['HTTP_HOST'] . str_replace('/install/install.php','',$_SERVER['REQUEST_URI']);
}
}
/* Encode and escape characters */
$set = $hesk_settings;
foreach ($hesk_settings as $k=> $v)
{
if (is_array($v) || is_object($v))
{
continue;
}
$set[$k] = addslashes($v);
}
$set['debug_mode'] = 0;
$set['email_providers'] = count($set['email_providers']) ? "'" . implode("','", $set['email_providers']) . "'" : '';
$set['notify_spam_tags'] = count($set['notify_spam_tags']) ? "'" . implode("','", $set['notify_spam_tags']) . "'" : '';
// Check if PHP version is 5.2.3+
$set['db_vrsn'] = (version_compare(PHP_VERSION, '5.2.3') >= 0) ? 1 : 0;
// If SSL is enabled, let's force it by default
$set['force_ssl'] = HESK_SSL ? 1 : 0;
hesk_iSaveSettingsFile($set);
return true;
} // End hesk_iSaveSettings()
?>

File diff suppressed because it is too large Load Diff

1634
hesk/install/update.php Normal file

File diff suppressed because it is too large Load Diff