Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 19bf123

Browse files
committed
restored original files and go to Versino 1.6 ST.
1 parent f5237cb commit 19bf123

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+910
-529
lines changed

include/class.msgtpl.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class.msgtpl.php
44
55
Peter Rotich <[email protected]>
6-
Copyright (c) 2006,2007,2008,2009 osTicket
6+
Copyright (c) 2006-2010 osTicket
77
http://www.osticket.com
88
99
Released under the GNU General Public License WITHOUT ANY WARRANTY.
@@ -86,6 +86,8 @@ function update($var,&$errors){
8686
$fields['ticket_autoresp_body'] = array('type'=>'string', 'required'=>1, 'error'=>'Template message required');
8787
$fields['message_autoresp_subj'] = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
8888
$fields['message_autoresp_body'] = array('type'=>'string', 'required'=>1, 'error'=>'Template message required');
89+
$fields['ticket_notice_subj'] = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
90+
$fields['ticket_notice_body'] = array('type'=>'string', 'required'=>1, 'error'=>'Template message required');
8991
$fields['ticket_overlimit_subj'] = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
9092
$fields['ticket_overlimit_body'] = array('type'=>'string', 'required'=>1, 'error'=>'Template message required');
9193
$fields['ticket_reply_subj'] = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
@@ -122,6 +124,8 @@ function update($var,&$errors){
122124
',ticket_autoresp_body='.db_input(Format::striptags($var['ticket_autoresp_body'])).
123125
',message_autoresp_subj='.db_input(Format::striptags($var['message_autoresp_subj'])).
124126
',message_autoresp_body='.db_input(Format::striptags($var['message_autoresp_body'])).
127+
',ticket_notice_subj='.db_input(Format::striptags($var['ticket_notice_subj'])).
128+
',ticket_notice_body='.db_input(Format::striptags($var['ticket_notice_body'])).
125129
',ticket_alert_subj='.db_input(Format::striptags($var['ticket_alert_subj'])).
126130
',ticket_alert_body='.db_input(Format::striptags($var['ticket_alert_body'])).
127131
',message_alert_subj='.db_input(Format::striptags($var['message_alert_subj'])).
@@ -186,6 +190,8 @@ function create($var,&$errors){
186190
',ticket_autoresp_body='.db_input(Format::striptags($info['ticket_autoresp_body'])).
187191
',message_autoresp_subj='.db_input(Format::striptags($info['message_autoresp_subj'])).
188192
',message_autoresp_body='.db_input(Format::striptags($info['message_autoresp_body'])).
193+
',ticket_notice_subj='.db_input(Format::striptags($info['ticket_notice_subj'])).
194+
',ticket_notice_body='.db_input(Format::striptags($info['ticket_notice_body'])).
189195
',ticket_alert_subj='.db_input(Format::striptags($info['ticket_alert_subj'])).
190196
',ticket_alert_body='.db_input(Format::striptags($info['ticket_alert_body'])).
191197
',message_alert_subj='.db_input(Format::striptags($info['message_alert_subj'])).

include/class.nav.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ class.nav.php
55
Navigation helper classes. Pointless BUT helps keep navigation clean and free from errors.
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.
1212
See LICENSE.TXT for details.
1313
1414
vim: expandtab sw=4 ts=4 sts=4:
15-
$Id: class.nav.php,v 1.1.2.2 2009/11/29 22:03:28 carlos.delfino Exp $
15+
$Id: $
1616
**********************************************************************/
1717
class StaffNav {
1818
var $tabs=array();
@@ -21,15 +21,9 @@ class StaffNav {
2121
var $activetab;
2222
var $ptype;
2323

24-
function StaffNav($pagetype='staff',$trl = null){
24+
function StaffNav($pagetype='staff'){
2525
global $thisuser;
2626

27-
if(isset($trl)){
28-
$this->trl = $trl;
29-
}else{
30-
$this->trl = new Translate();
31-
}
32-
3327
$this->ptype=$pagetype;
3428
$tabs=array();
3529
if($thisuser->isAdmin() && strcasecmp($pagetype,'admin')==0) {

include/class.pagenate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class.format.php
55
Pagenation support class
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.

include/class.staff.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ function observeDaylight() {
8585
return $this->udata['daylight_saving']?true:false;
8686
}
8787

88+
function getRefreshRate(){
89+
return $this->udata['auto_refresh_rate'];
90+
}
91+
8892
function getPageLimit() {
8993
global $cfg;
9094
$limit=$this->udata['max_page_size'];
@@ -196,6 +200,10 @@ function canAccessDept($deptid){
196200
return ($this->isadmin() ||in_array($deptid,$this->getDepts()))?true:false;
197201
}
198202

203+
function canCreateTickets(){
204+
return ($this->isadmin() || $this->udata['can_create_tickets'])?true:false;
205+
}
206+
199207
function canEditTickets(){
200208
return ($this->isadmin() || $this->udata['can_edit_tickets'])?true:false;
201209
}
@@ -242,6 +250,8 @@ function create($vars,&$errors) {
242250

243251
function save($id,$vars,&$errors) {
244252

253+
include_once(INCLUDE_DIR.'class.dept.php');
254+
245255
if($id && $id!=$vars['staff_id'])
246256
$errors['err']='Internal Error';
247257

@@ -262,6 +272,8 @@ function save($id,$vars,&$errors) {
262272

263273
if(!$vars['email'] || !Validator::is_email($vars['email']))
264274
$errors['email']='Valid email required';
275+
elseif(Email::getIdByEmail($vars['email']))
276+
$errors['email']='Already in-use system email';
265277

266278
if($vars['phone'] && !Validator::is_phone($vars['phone']))
267279
$errors['phone']='Valid number required';
@@ -298,9 +310,9 @@ function save($id,$vars,&$errors) {
298310
',firstname='.db_input(Format::striptags($vars['firstname'])).
299311
',lastname='.db_input(Format::striptags($vars['lastname'])).
300312
',email='.db_input($vars['email']).
301-
',phone='.db_input($vars['phone']).
313+
',phone="'.db_input($vars['phone'],false).'"'.
302314
',phone_ext='.db_input($vars['phone_ext']).
303-
',mobile='.db_input($vars['mobile']).
315+
',mobile="'.db_input($vars['mobile'],false).'"'.
304316
',signature='.db_input(Format::striptags($vars['signature']));
305317

306318
if($vars['npassword'])

include/class.sys.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class.sys.php
55
System core helper.
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.
@@ -23,7 +23,7 @@ class Sys {
2323

2424
var $loglevel=array(1=>'Error','Warning','Debug');
2525

26-
static $trl ;
26+
static $trl ;
2727

2828
static function getTranslatorToLocale($str="us"){
2929
if(!isset(self::$trl[$str])){

include/class.ticket.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class.ticket.php
55
The most important class! Don't play with fire please.
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.
@@ -38,15 +38,17 @@ class Ticket{
3838
var $fullname;
3939
var $staff_id;
4040
var $dept_id;
41+
var $topic_id;
4142
var $dept_name;
4243
var $subject;
43-
var $topic;
44+
var $helptopic;
4445
var $overdue;
4546

4647
var $lastMsgId;
4748

4849
var $dept; //Dept class
4950
var $staff; //Staff class
51+
var $topic; //Topic class
5052
var $tlock; //TicketLock class
5153

5254
function Ticket($id,$exid=false){
@@ -56,9 +58,10 @@ function Ticket($id,$exid=false){
5658
function load($id) {
5759

5860

59-
$sql =' SELECT ticket.*,lock_id,dept_name,priority_desc FROM '.TICKET_TABLE.' ticket '.
61+
$sql =' SELECT ticket.*,topic.topic_id as topicId,lock_id,dept_name,priority_desc FROM '.TICKET_TABLE.' ticket '.
6062
' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '.
6163
' LEFT JOIN '.TICKET_PRIORITY_TABLE.' pri ON ticket.priority_id=pri.priority_id '.
64+
' LEFT JOIN '.TOPIC_TABLE.' topic ON ticket.topic_id=topic.topic_id '.
6265
' LEFT JOIN '.TICKET_LOCK_TABLE.' tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() '.
6366
' WHERE ticket.ticket_id='.db_input($id);
6467
//echo $sql;
@@ -80,6 +83,7 @@ function load($id) {
8083
$this->priority=$row['priority_desc'];
8184
$this->staff_id =$row['staff_id'];
8285
$this->dept_id =$row['dept_id'];
86+
$this->topic_id =$row['topicId']; //Note that we're actually joining the topic table to make the topic is not deleted (long story!).
8387
$this->dept_name =$row['dept_name'];
8488
$this->subject =$row['subject'];
8589
$this->topic =$row['topic'];

include/class.topic.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class.topic.php
55
Help topic helper
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.
@@ -46,7 +46,7 @@ function load() {
4646
$this->topic=$info['topic'];
4747
$this->dept_id=$info['dept_id'];
4848
$this->priority_id=$info['priority_id'];
49-
$this->active=$info['enabled'];
49+
$this->active=$info['isactive'];
5050
$this->autoresp=$info['noautoresp']?false:true;
5151
$this->info=$info;
5252
return true;
@@ -84,6 +84,10 @@ function isEnabled() {
8484
return $this->active?true:false;
8585
}
8686

87+
function isActive(){
88+
return $this->isEnabled();
89+
}
90+
8791
function getInfo() {
8892
return $this->info;
8993
}
@@ -110,6 +114,13 @@ function save($id,$vars,&$errors) {
110114
$errors['topic']='Help topic required';
111115
elseif(strlen($vars['topic'])<5)
112116
$errors['topic']='Topic is too short. 5 chars minimum';
117+
else{
118+
$sql='SELECT topic_id FROM '.TOPIC_TABLE.' WHERE topic='.db_input(Format::striptags($vars['topic']));
119+
if($id)
120+
$sql.=' AND topic_id!='.db_input($id);
121+
if(($res=db_query($sql)) && db_num_rows($res))
122+
$errors['topic']='Topic alredy exists';
123+
}
113124

114125
if(!$vars['dept_id'])
115126
$errors['dept_id']='You must select a department';

include/class.usersession.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ class.usersession.php
55
User (client and staff) sessions handle.
66
77
Peter Rotich <[email protected]>
8-
Copyright (c) 2006,2007,2008,2009 osTicket
8+
Copyright (c) 2006-2010 osTicket
99
http://www.osticket.com
1010
1111
Released under the GNU General Public License WITHOUT ANY WARRANTY.
1212
See LICENSE.TXT for details.
1313
1414
vim: expandtab sw=4 ts=4 sts=4:
15-
$Id: class.usersession.php,v 1.1.2.1 2009/08/17 18:38:50 carlos.delfino Exp $
15+
$Id: $
1616
**********************************************************************/
1717

1818
include_once(INCLUDE_DIR.'class.client.php');
@@ -67,7 +67,7 @@ function sessionToken(){
6767
return($token);
6868
}
6969

70-
function isvalidSession($htoken,$maxidletime=0){
70+
function isvalidSession($htoken,$maxidletime=0,$checkip=false){
7171
global $cfg;
7272

7373
$token = rawurldecode($htoken);
@@ -90,7 +90,7 @@ function isvalidSession($htoken,$maxidletime=0){
9090
return FALSE;
9191
}
9292
#Make sure IP is still same ( proxy access??????)
93-
if(strcmp($ip, MD5($this->ip)))
93+
if($checkip && strcmp($ip, MD5($this->ip)))
9494
return FALSE;
9595

9696
$this->validated=TRUE;
@@ -119,7 +119,7 @@ function isValid(){
119119
if(!$this->getId() || $this->session->getSessionId()!=session_id())
120120
return false;
121121

122-
return $this->session->isvalidSession($_SESSION['_client']['token'],$cfg->getClientTimeout())?true:false;
122+
return $this->session->isvalidSession($_SESSION['_client']['token'],$cfg->getClientTimeout(),false)?true:false;
123123
}
124124

125125
function refreshSession(){
@@ -157,7 +157,7 @@ function isValid(){
157157
if(!$this->getId() || $this->session->getSessionId()!=session_id())
158158
return false;
159159

160-
return $this->session->isvalidSession($_SESSION['_staff']['token'],$cfg->getStaffTimeout())?true:false;
160+
return $this->session->isvalidSession($_SESSION['_staff']['token'],$cfg->getStaffTimeout(),$cfg->enableStaffIPBinding())?true:false;
161161
}
162162

163163
function refreshSession(){

include/class.validator.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ class.validator.php
66
77
88
Peter Rotich <[email protected]>
9-
Copyright (c) 2006,2007,2008,2009 osTicket
9+
Copyright (c) 2006-2010 osTicket
1010
http://www.osticket.com
1111
1212
Released under the GNU General Public License WITHOUT ANY WARRANTY.
1313
See LICENSE.TXT for details.
1414
1515
vim: expandtab sw=4 ts=4 sts=4:
16-
$Id: class.validator.php,v 1.1.2.1 2009/08/17 18:38:50 carlos.delfino Exp $
16+
$Id: $
1717
**********************************************************************/
1818
class Validator {
1919

@@ -35,7 +35,7 @@ function setFields(&$fields){
3535
}
3636

3737

38-
function validate($source){
38+
function validate($source,$userinput=true){
3939

4040
$this->errors=array();
4141
//Check the input and make sure the fields are specified.
@@ -47,6 +47,11 @@ function validate($source){
4747
if($this->errors)
4848
return false;
4949

50+
//if magic quotes are enabled - then try cleaning up inputs before validation...
51+
if($userinput && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
52+
$source=Format::strip_slashes($source);
53+
54+
5055
$this->input=$source;
5156

5257
//Do the do.
@@ -126,16 +131,14 @@ function errors(){
126131
return $this->errors;
127132
}
128133

129-
/* Functione below can be called directly without class instance. Validator::func(var..); */
134+
/* Functions below can be called directly without class instance. Validator::func(var..); */
130135
function is_email($email) {
131-
return (preg_match('/^([*+!.&#$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i',trim($email)));
132-
/*
133-
//return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",trim($email));
134-
*/
136+
return (preg_match('/^([*+!.&#$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i',trim(stripslashes($email))));
135137
}
136138
function is_phone($phone) {
137-
$stripped=eregi_replace("(\(|\)|\-|\+)","",ereg_replace("([ ]+)","",$phone));
138-
return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>13)))?false:true;
139+
/* We're not really validating the phone number but just making sure it doesn't contain illegal chars and of acceptable len */
140+
$stripped=preg_replace("(\(|\)|\-|\+|[ ]+)","",$phone);
141+
return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>16)))?false:true;
139142
}
140143

141144
function is_url($url) { //Thanks to 4ice for the fix.
@@ -166,7 +169,7 @@ function is_ip($ip) {
166169
return false;
167170

168171
$ip=trim($ip);
169-
if(ereg("^[0-9]{1,3}(.[0-9]{1,3}){3}$",$ip)) {
172+
if(preg_match("/^[0-9]{1,3}(.[0-9]{1,3}){3}$/",$ip)) {
170173
foreach(explode(".", $ip) as $block)
171174
if($block<0 || $block>255 )
172175
return false;

include/client/footer.inc.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
<div style="clear:both"></div>
22
</div>
3-
<div id="footer">Copyright &copy; Doede.net All rights reserved</div>
3+
<div id="footer">Copyright &copy; osTicket.com. All rights reserved</div>
44
<div align="center">
55
<!--> As a show of support, we ask that you leave powered by osTicket link to help spread the word. Thank you! -->
6-
<a id="powered_by" href="http://osticket.com">
7-
<img src="./images/poweredby.jpg" width="126" height="23" alt="Powered by osTicket"></a></div>
8-
<hr/>
9-
<br>
10-
Translated Copyright &copy; Doede.net
11-
<br />
12-
<a id="powered_by" href="http://www.webreus.nl">Hosted By Webreus</a>
13-
</div>
6+
<a id="powered_by" href="http://osticket.com"><img src="./images/poweredby.jpg" width="126" height="23" alt="Powered by osTicket"></a></div>
147
</div>
158
</body>
169
</html>

0 commit comments

Comments
 (0)