<?php
/**
* @author : SEVENSTYLE
* @copyright : 2012
*
*/
class SevenDBO {
function __construct($dbdata, $dbuser, $dbpass) {
try {
if (!$this->link = odbc_connect($dbdata, $dbuser, $dbpass)) {
throw new Exception('Veritabanina baglanilamadi!');
}
}
catch(Exception $sevendbo) {
die($sevendbo->getMessage());
}
}
function security($text) {
$text = trim($text);
$search = array('', '', '', '', '', '', '', '', '', '', '', '', ',');
$replace = array('C', 'c', 'G', 'g', 'i', 'I', 'O', 'o', 'S', 's', 'U', 'u');
$new_text = str_replace($search, $replace, $text);
return $new_text;
}
function doquery($query) {
try {
if (!$this->ver = odbc_exec($this->link, $query)) {
throw new Exception('Sorguda hata olustu.');
}
}
catch(Exception $sevendbo) {
die($sevendbo->getMessage());
}
}
function query($sorgu) {
try {
if (!$this->query = odbc_exec($this->link, $sorgu)) {
throw new Exception('Sorguda hata olustu.');
}
}
catch(Exception $sevendbo) {
die($sevendbo->getMessage());
}
}
function result($write) {
return odbc_result($this->ver, $write);
}
function results($write) {
return odbc_result($this->query, $write);
}
function row() {
return odbc_fetch_row($this->ver);
}
function rows() {
return odbc_fetch_row($this->query);
}
function fetch() {
odbc_fetch_array($this->ver);
}
function __desctruct() {
odbc_free_result();
odbc_close($this->link);
}
function uyari($c) {
echo '<script type="text/javascript">alert("' . $c . '");</script>';
}
function yonlendir($url, $zaman) {
echo '<META HTTP-EQUIV="Refresh" CONTENT="' . $zaman . ';URL=' . $url . '">';
}
function SQLSecurity($text) {
$text = trim(htmlspecialchars($text));
$search = array("'", '"', "TRUNCATE", "truncate", "UPDATE", "update", "SELECT", "select", "DROP", "drop", "DELETE", "delete", "WHERE", "where", "EXEC", "exec", "INSERT INTO", "insert into", "PROCEDURE", "procedure", "--");
$replace = array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
$new_text = str_replace($search, $replace, $text);
return $new_text;
}
function licence_control($sp4) {
global $scripturl;
if (!empty($_SERVER['SERVER_NAME'])) $site = $_SERVER['SERVER_NAME'];
elseif (!empty($_SERVER['HTTP_HOST'])) $site = $_SERVER['HTTP_HOST'];
else $site = preg_match('~(http|ftp)?:\/\/[w\.]*([a-zA-Z0-9\.]+)\/~i', $scripturl, $match) ? $match[2] : '';
if (empty($site)) return;
if (strpos($site, 'www.') !== false) $site = substr($site, 4);
$sevenpanel = sha1(sha1(sha1(md5(md5(md5($site . 'v10panelsifrleme1234'))))) . 'v10panelsifrleme1234*/');
$sevenpanel = substr($sevenpanel, 0, 25);
$sevenpanel = wordwrap($sevenpanel, 5, '-', true);
if ($sevenpanel != $sp4 || $sevenpanel !== $sp4) die('Server Sahibine Duyurulur: Lutfen SevenPanel yetkili saticisindan lisans satin aliniz.');
}
}