Location: PHPKode > projects > KSMS bulk sms manager > ksms-e1.2.35/admin/admconfig.inc.php
<?php
// -------------------------------------------------------------------------//
// KSMS ^ Short Message System Manager										//
// -------------------------------------------------------------------------//
// Based on "DBSMS" (C) 2002 Paolo Remonato									//
// Copyright (C) 2002-2006 Paolo Remonato									//
// KSMS-PROJECT HOME  :  http://ksms.sourceforge.net/						//
// -------------------------------------------------------------------------//
//   Please,do not delete these lines	^^^									//
// -------------------------------------------------------------------------//
/*
  This program is free software; you can redistribute it and/or modify it under the terms
  of the GNU General Public License as published by the Free Software Foundation.
  The software is provided "as is" without any express or implied warranty of any kind,
  Including warranties of noninfringement, merchantability, or fitness for a particular purpose.  
*/
###		@version 	: 2006-02-20,v1.2.35	kingmo
###		@last upd 	: 
###		@filename 	: admconfig.inc.php

/* ************************************************ */
/*     COMMON CONFIGURATION 						*/
/* ************************************************ */

 // VERY IMPORTANT :::
 // After the first login in admin area and after change the admin password, SET THIS TO "on"
define("CHECK_ADMIN_ACCESS", "off");

 // If you set to yes this, you see some data at the top of every page and 
 // some mysql-errors may display at the public!
 // Set to YES only for debug or testing. Set to NO whe you are in working side"
define("QUERY_DEBUG", "off");

/* **************************************************************************************** */
/* 				BASE CONFIGURATION															*/
/* **************************************************************************************** */
// List of authorized domain to use this program (NO http://)
	$domauth1 = 'www.YOURSITE.net';
	$domauth2 = '10.0.0.2';		// if you want to connect from internal network
	$domauth3 = 'sms.example.com';	// if you want to connect from another domain name
// List of authorized IP to use this program (NO http://)
	$authorizedIP1 = '151.38.150.243';	// YOUR IP ADDRESS
	$authorizedIP2 = '10.0.0.3';		// INTERNAL IP NETWORK ADDRESS
	$authorizedIP3 = '0.0.0.1';		// ANOTHER IP

// error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
error_reporting(E_ALL);
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

// Ksms version string.
/// look at file: vers.inc.php
///  $cfg["version"] = "xxxxx";
require("../vers.inc.php");

$cfg["signature"] = "KSMS admin - the bulk sms system manager " . $cfg["version"];
$cfg["sysver"] = "KSMS " . $cfg["version"];

### -> Database connection parameters.
$cfg["db_type"] = "mysql";      		// DB server type eg: mysql, postgres, sqlite, odbc. See ADODB docs.
$cfg["db_host"] = "localhost";  		// DB server hostname. DSN if odbc OR /path/filename if sqlite.
$cfg["db"] = "KSMSenDB";           		// Ksms database. Not used if odbc or sqlite.
$cfg["auid"] = "ksmsusr";       		// DB server user id.
$cfg["apasswd"] = "pgp0025tx01qetwys";	// DB server password.
$cfg["db_persist"] = FALSE;     		// Use persistent database connection. TRUE or FALSE.
### -> Miscellaneous configuration parameters.
$cfg["curr"] = "€  ";					// Local currency symbol. eg: $, £, € etc. (FEATURED)
$cfg["sespath"] = "/tmp/Session_tmp/";	// Full Path. Directory for sessions file (chmod 0777)


// For debuggin (view) in "connection.inc.php". TRUE or FALSE.
if (QUERY_DEBUG == 'on') {
$cfg["admview_debug"] = TRUE;
 } else {
$cfg["admview_debug"] = FALSE;
}

/*
### -> "unix" or "win"
$cfg["os"] = "unix";
### -> Full path to ksms directory.
$cfg["basedir"] = "/.../...../KSMS";
*/

// HACK ATTEMPT
if ( !defined('IN_KSMS') )
{	die("Hacking attempt");  }

/* ********************************************************************************* */
/* CHECK IF THE HOST IS AN ABLE HOSTER !											 */
/* ********************************************************************************* */
$SERVERIP = $_SERVER['SERVER_ADDR'];
$SERVERNAME = $_SERVER['SERVER_NAME'];
$HEADHOST = $_SERVER['REMOTE_ADDR'];
if (QUERY_DEBUG == 'on')
{
	// Only for test purpose, leave commented the following four lines!!!
		echo "<font face='Verdana,Geneva,Arial,Helvetica,sans-serif' size='2' color='#ff9900'>";
		echo "SERVER NAME = ".$SERVERNAME."&nbsp;|&nbsp;";
		echo "Domain Auth = ".$domauth2."&nbsp;|||&nbsp;";
		echo "SERVER IP = ".$SERVERIP."&nbsp;|&nbsp;";
		echo "Authorized IP = ".$authorizedIP2."!";
		echo "</font><br />";
}

// TO DO : CHANGE THESE ROUTINES!
if ($SERVERIP != $authorizedIP1) { $aa = 1; }
if ($SERVERIP != $authorizedIP2) { $aa = 2; }
if ($SERVERIP != $authorizedIP3) { $aa = 3; }
//	echo "<br />:::: ".$aa." ::::<br />";
if (($aa < 1) || ($aa > 3))
	{
		// STOP. IS NOT AUTHORIZED!
		// future language implementation!
		//echo $lang['keyerrors1']."<br />";
		//include $errorfootpage;
	echo("<b>Page not found.Please Try Again.</b> <br><b>Pagina non disponibile. Riprova più tardi</b>");
	include("err_foot.inc.php");
		exit;
	}

if ($SERVERNAME != $domauth1) { $bb = 1; }
if ($SERVERNAME != $domauth2) { $bb = 2; }
if ($SERVERNAME != $domauth3) { $bb = 3; }
//	echo "<br />:::: ".$bb." ::::<br />";
if (($bb < 1) || ($bb > 3))
	{
		// allora la chiamata non è autorizzata
		echo $lang['keyerrors2']."<br />";
		include $errorfootpage;
		exit;
	}

if (!file_exists($cfg["sespath"]))
{
echo '<font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="5" color="#0000ff">KSMSShort Message System Manager!</font><br />';
echo '<br />';
echo 'YOU DON\'T HAVE SETUP THE DIRECTORY FOR SESSIONS ('.$cfg["sespath"].')';
echo '<br />';
echo 'See your configuration file in admin directory (admconfig.inc.php) and change the variable "sespath"';
echo '<br />';
echo '<br /><font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="2" color="#D20000">You must setup with the Apache\'s rights (e.g.: chown apache:httpd '.$cfg["sespath"].')</font><br />';
exit("unable to open the sessions directory");
}
?>
Return current item: KSMS bulk sms manager