demon |
Moderator |
|
|
Joined: Sep 22, 2010 |
Posts: 485 |
|
|
|
|
|
|
|
Code: | <?php
class SevenDBO
{
public function __construct( $dbdata, $dbuser, $dbpass )
{
try
{
if ( !( $this->link = odbc_connect( $dbdata, $dbuser, $dbpass ) ) )
{
throw new Exception( "Veritabanina baglanilamadi!" );
}
}
catch ( Exception $sevendbo )
{
exit( $sevendbo->getMessage( ) );
}
}
public function security( $text )
{
$text = trim( $text );
$search = array( "\xC7", "\xE7", "\xD0", "\xF0", "\xFD", "\xDD", "\xD6", "\xF6", "\xDE", "\xFE", "\xDC", "\xFC", "," );
$replace = array( "C", "c", "G", "g", "i", "I", "O", "o", "S", "s", "U", "u" );
$new_text = str_replace( $search, $replace, $text );
return $new_text;
}
public function doquery( $query )
{
try
{
if ( !( $this->ver = odbc_exec( $this->link, $query ) ) )
{
throw new Exception( "Sorguda hata olustu." );
}
}
catch ( Exception $sevendbo )
{
exit( $sevendbo->getMessage( ) );
}
}
public function query( $sorgu )
{
try
{
if ( !( $this->query = odbc_exec( $this->link, $sorgu ) ) )
{
throw new Exception( "Sorguda hata olustu." );
}
}
catch ( Exception $sevendbo )
{
exit( $sevendbo->getMessage( ) );
}
}
public function result( $write )
{
return odbc_result( $this->ver, $write );
}
public function results( $write )
{
return odbc_result( $this->query, $write );
}
public function row( )
{
return odbc_fetch_row( $this->ver );
}
public function rows( )
{
return odbc_fetch_row( $this->query );
}
public function fetch( )
{
odbc_fetch_array( $this->ver );
}
public function __desctruct( )
{
odbc_free_result( );
odbc_close( $this->link );
}
public function uyari( $c )
{
echo "<script type=\"text/javascript\">alert(\"".$c."\");</script>";
}
public function yonlendir( $url, $zaman )
{
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"".$zaman.";URL=".$url."\">";
}
public 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;
}
public function licence_control( $sp4 )
{
global $scripturl;
if ( !empty( $_SERVER['SERVER_NAME'] ) )
{
$site = $_SERVER['SERVER_NAME'];
}
else
{
if ( !empty( $_SERVER['HTTP_HOST'] ) )
{
$site = $_SERVER['HTTP_HOST'];
}
else
{
$site = preg_match( "~(http|ftp)[s]?:\\/\\/[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."panelseven1372interlsasanayiiasdwwq" ) ) ) ) )."panelseven1372interlsasanayiiasdwwq211w5qszxcfgqg" );
$sevenpanel = substr( $sevenpanel, 0, 25 );
$sevenpanel = wordwrap( $sevenpanel, 5, "-", true );
$sevenpanel = mb_strtoupper( $sevenpanel );
if ( $sevenpanel != $sp4 || $sevenpanel !== $sp4 )
{
exit( "<b>Server Sahibine Duyurulur:</b> Lutfen SevenPanel yetkili saticisindan lisans satin aliniz." );
}
}
}
?>
|
|
|