<?php
if (!defined('IN_COMMON'))
{
exit('no directly opening : ' . __file__);
}
function kleeja_auth_login ($name, $pass)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect($forum_srv, $forum_user, $forum_pass, $forum_db);
unset($forum_pass);
//securing name
$secnam=mysql_real_escape_string($name);
$shapw=sha1(strtolower($secnam) . $pass) ;
$query= "SELECT * FROM smf_members WHERE member_name='$secnam' AND passwd='$shapw' ";
echo "$query";
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$_SESSION['USER_ID'] = $row['id_member'];
$_SESSION['USER_NAME'] = $row['member_name'] ;
$_SESSION['USER_MAIL'] = $row['email_address'];
$_SESSION['USER_ADMIN'] = ($row['id_group'] == 1) ? 1 : 0;
$_SESSION['USER_SESS'] = session_id();
}
mysql_free_result($result);
unset($pass);
mysql_close();
return true;
}
else
{
mysql_close();
return false;
}
}
function kleeja_auth_username ($user_id)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect($forum_srv, $forum_user, $forum_pass, $forum_db);
unset($forum_pass);
//securing name
$valnin=intval($user_id);
$query= "SELECT member_name FROM smf_members WHERE id_member='$valnin'" ;
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$returnname = $row['username'];
}
mysql_free_result($result);
unset($pass);
mysql_close();
return true;
}
else
{
mysql_close();
return false;
}
}
?>
بلوهوست لا يقبل سكربت رفع ملفات اذا كان الموقع مخصص لرفع الملفات
اما اذا كان رفع الملفات على دومين فرعى مثلا و هو مكمل للموقع فهو ممكن
موقعى الأخر http://www.gfxland.info (http://www.gfxland.info)
مركز رفع ملفاته http://download.gfxland.info/ (http://download.gfxland.info/)
<?php
if (!defined('IN_COMMON'))
{
exit('no directly opening : ' . __file__);
}
function kleeja_auth_login ($name, $pass)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect($forum_srv, $forum_user, $forum_pass, $forum_db);
unset($forum_pass);
//securing name
$secnam=mysql_real_escape_string($name);
$shapw=sha1(strtolower($secnam) . $pass) ;
$query= "SELECT * FROM smf_members WHERE member_name='$secnam' AND passwd='$shapw' ";
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$_SESSION['USER_ID'] = $row['id_member'];
$_SESSION['USER_NAME'] = $row['member_name'] ;
$_SESSION['USER_MAIL'] = $row['email_address'];
$_SESSION['USER_ADMIN'] = ($row['id_group'] == 1) ? 1 : 0;
$_SESSION['USER_SESS'] = session_id();
}
mysql_free_result($result);
unset($pass);
mysql_close();
return true;
}
else
{
mysql_close();
return false;
}
}
function kleeja_auth_username ($user_id)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect($forum_srv, $forum_user, $forum_pass, $forum_db);
unset($forum_pass);
//securing name
$valnin=intval($user_id);
$query= "SELECT member_name FROM smf_members WHERE id_member='$valnin'" ;
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$returnname = $row['username'];
}
mysql_free_result($result);
unset($pass);
mysql_close();
return true;
}
else
{
mysql_close();
return false;
}
}
?>
<?php
if (!defined('IN_COMMON'))
{
exit('no directly opening : ' . __file__);
}
function kleeja_auth_login ($name, $pass)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect("$forum_srv", "$forum_user", "$forum_pass")or die("áÇ íãßä ÇáÅÊÕÇá ÈÇáÎÇÏã");
mysql_select_db("$forum_db")or die("áÇ íãßä ÊÍÏíÏ ÞÇÚÏÉ ÇáÈíÇäÇÊ");
unset($forum_pass);
//securing name
$secnam=mysql_real_escape_string($name);
$shapw=sha1(strtolower($secnam) . $pass) ;
$query= "SELECT * FROM {$forum_prefix}members WHERE member_name='$secnam' AND passwd='$shapw' ";
$result = @mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$_SESSION['USER_ID'] = $row['id_member'];
$_SESSION['USER_NAME'] = $row['member_name'] ;
$_SESSION['USER_MAIL'] = $row['email_address'];
$_SESSION['USER_ADMIN'] = ($row['id_group'] == 1) ? 1 : 0;
$_SESSION['USER_SESS'] = session_id();
}
mysql_free_result($result);
unset($pass);
mysql_close();
return true;
}
else
{
mysql_close();
return false;
}
}
function kleeja_auth_username ($user_id)
{
global $script_path ;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'SimpleMachineForum'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
mysql_connect("$forum_srv", "$forum_user", "$forum_pass")or die("áÇ íãßä ÇáÅÊÕÇá ÈÇáÎÇÏã");
mysql_select_db("$forum_db")or die("áÇ íãßä ÊÍÏíÏ ÞÇÚÏÉ ÇáÈíÇäÇÊ");
unset($forum_pass);
//securing name
$valnin=intval($user_id);
$query= "SELECT member_name FROM {$forum_prefix}members WHERE id_member='$valnin'" ;
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
while($row=mysql_fetch_array($result))
{
$returnname = $row['username'];
}
mysql_free_result($result);
unset($pass);
return true;
}
else
{
$SQLSM->close();
return false;
}
}
?>
هذاهو الكود الصحيح