- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
- *
- * @ Version : 1.1.3.0
- * @ Author : DeZender
- * @ Release on : 17.05.2011
- * @ Official site : http://DeZender.Net
- *
- */
- if (( ( ( ( ( !isset( $_GET['pg'] ) || !in_array( $_GET['pg'], array( 'graph', 'graph_pareto', 'file', 'file.staffphoto', 'excel', 'excel_filter', 'ajax_gateway', 'mobile' ) ) ) && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) && extension_loaded( 'zlib' ) ) && !ini_get( 'zlib.output_compression' ) ) && function_exists( 'ob_gzhandler' ) )) {
- $encodings = explode( ',', strtolower( preg_replace( '/\s+/', '', $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) );
- if (( in_array( 'gzip', $encodings ) || in_array( 'x-gzip', $encodings ) )) {
- ob_start( 'ob_gzhandler' );
- header( 'Content-Encoding: ' . (in_array( 'x-gzip', $encodings ) ? 'x-gzip' : 'gzip') );
- } else {
- ob_start( );
- }
- } else {
- ob_start( );
- }
- error_reporting( 1 | 4 );
- set_magic_quotes_runtime( 0 );
- if (( isset( $_SERVER['HTTP_X_MOZ'] ) && strtoupper( $_SERVER['HTTP_X_MOZ'] ) == 'PREFETCH' )) {
- header( 'HTTP/1.0 403 Forbidden' );
- echo 'HelpSpot cannot run with the Google Web Accelerator installed in your browser. Please uninstall it and try again or use a different browser.';
- exit( );
- }
- define( 'SSKEY', md5( 'wookie fulton $2Zgh91' ) );
- if (file_exists( 'config.php' )) {
- ob_start( );
- include( 'config.php' );
- ob_end_clean( );
- } else {
- header( 'Location: installer.php' );
- exit( );
- }
- set_include_path( cBASEPATH . '/helpspot/pear' );
- include_once( cBASEPATH . '/helpspot/lib/util.lib.php' );
- if (( ( isset( $_GET['pg'] ) && $_GET['pg'] == 'custompg' ) && isset( $_GET['file'] ) )) {
- $custom_file = clean_filename( $_GET['file'] );
- if (file_exists( 'custom_pages/' . trim( $custom_file ) . '.php' )) {
- ob_start( );
- include( 'custom_pages/' . trim( $custom_file ) . '.php' );
- $custom_pagebody = ob_get_clean( );
- }
- }
- include_once( cBASEPATH . '/helpspot/lib/auth.adodb.php' );
- include_once( cBASEPATH . '/helpspot/pear/Auth/Auth.php' );
- include_once( cBASEPATH . '/helpspot/lib/utf8.lib.php' );
- include_once( cBASEPATH . '/helpspot/lib/error.lib.php' );
- include_once( cBASEPATH . '/helpspot/lib/platforms.lib.php' );
- include_once( cBASEPATH . '/helpspot/lib/display.lib.php' );
- include_once( cBASEPATH . '/helpspot/pear/Crypt_RC4/Rc4.php' );
- include_once( cBASEPATH . '/helpspot/lib/api.lib.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.notify.php' );
- include_once( cBASEPATH . '/helpspot/lib/phpMailer/class.phpmailer.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.hsmailer.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.userscape.bayesian.classifier.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.license.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.array2recordset.php' );
- include_once( cBASEPATH . '/helpspot/pear/Net/UserAgent/Detect.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.filter.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.auto.rule.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.triggers.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.person.status.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.business_hours.php' );
- include_once( cBASEPATH . '/helpspot/lib/class.language.php' );
- include_once( cBASEPATH . '/helpspot/lib/phpass/PasswordHash.php' );
- if ($_GET['pg'] == 'iphone') {
- hs_redirect( 'Location: admin.php?pg=mobile' );
- }
- clean_data( );
- if (!hsinitdb( )) {
- exit( 'Cannot connect to database. Check your config.php file.' );
- }
- hsinitsettings( );
- define( 'IN_PORTAL', false );
- $licenseObj = new usLicense( cHD_CUSTOMER_ID, cHD_LICENSE, SSKEY );
- $GLOBALS['license'] = $licenseObj->getLicense( );
- if ($GLOBALS['license']['Beta']) {
- exit( 'Beta license does not work with this version.' );
- }
- $page = (isset( $_GET['pg'] ) ? clean_filename( $_GET['pg'] ) : 'workspace');
- $action = (isset( $_GET['action'] ) ? $_GET['action'] : '');
- $hidePageFrame = 0;
- $htmldirect = false;
- $formerrors = array( );
- $errorbox = '';
- $pagebody = '';
- $pagetitle = '';
- $tab = 'nav_hd';
- $subtab = '';
- $headscript = '';
- $onload = '';
- $GLOBALS['lang'] = new language( $page );
- include( cBASEPATH . '/helpspot/lib/lookup.lib.php' );
- if (( ( $page != 'admin.settings' && isset( $_POST['vmode'] ) ) && $_POST['vmode'] == 'license_upload' )) {
- if (( isset( $_FILES['license']['tmp_name'] ) && is_uploaded_file( $_FILES['license']['tmp_name'] ) )) {
- $activestaff = $GLOBALS['DB']->Execute( 'SELECT xPerson FROM HS_Person WHERE fDeleted = ?', array( 0 ) );
- $license_string = file_get_contents( $_FILES['license']['tmp_name'] );
- $licenseObj = new usLicense( cHD_CUSTOMER_ID, $license_string, SSKEY );
- $license = $licenseObj->getLicense( );
- if (( ( ( isset( $license['CustomerID'] ) && isset( $license['Users'] ) ) && trim( $license['Users'] ) != 'unlimited' ) && $license['Users'] < $activestaff->RecordCount( ) )) {
- storeglobalvar( 'cHD_LICENSE', $license_string, __FILE__, 170 );
- $GLOBALS['license'] = $license;
- $user_dif = $activestaff->RecordCount( ) - $license['Users'];
- $ct = 0;
- if (0 < $user_dif) {
- while ($row = $activestaff->FetchRow( )) {
- if ($user['xPerson'] != $row['xPerson']) {
- apideleteresource( 'HS_Person', 'xPerson', $row['xPerson'], 'delete', __FILE__, 183 );
- $ct++;
- if ($user_dif == $ct) {
- break;
- }
- }
- }
- }
- $onload = 'alert("' . hs_jshtmlentities( lg_licenseuploader ) . '");';
- } else {
- if (isset( $license['CustomerID'] )) {
- storeglobalvar( 'cHD_LICENSE', $license_string, __FILE__, 195 );
- $GLOBALS['license'] = $license;
- } else {
- $error = lg_licnotvalid;
- }
- }
- } else {
- $error = lg_licnotvalid;
- }
- ..................................
- ....................
- .........