46
قسم الدعم الخاص بالنسخة (Smf (2.0 / رد: استفسار هام بخصوص صندوق التحرير المتقدم
« في: 27 , مارس, 2012 - 09:39:40 مسائاً »
ربما هو كما تقول
هنا يمكنك مشاهدة جميع المشاركات التى كتبها هذا العضو . لاحظ انه يمكنك فقط مشاهدة المشاركات التى كتبها فى الاقسام التى يسمح لك بدخولها فقط .
),
'chat' => array(
'title' => إسم الزر,
'href' => رابط الشات,
'show' => true,
'sub_buttons' => array(
),
),
'calendar' => array(
'title' => $txt['calendar'],
'href' => $scripturl . '?action=calendar',
'show' => $context['allow_calendar'],
'sub_buttons' => array(
'view' => array(
'title' => $txt['calendar_menu'],
'href' => $scripturl . '?action=calendar',
'show' => allowedTo('calendar_post'),
),
'post' => array(
'title' => $txt['calendar_post_event'],
'href' => $scripturl . '?action=calendar;sa=post',
'show' => allowedTo('calendar_post'),
'is_last' => true,
),
),
<?php
/**
*
* @package auth
* @version $Id: smf.php SAFAD $
*
*/
//no for directly open
if (!defined('IN_COMMON'))
{
exit();
}
//
//Path of config file in smf
//
if(!defined('SCRIPT_CONFIG_PATH'))
{
define('SCRIPT_CONFIG_PATH', '/Settings.php');
}
function kleeja_auth_login ($name, $pass, $hashed = false, $expire, $loginadm = false, $return_name = false)
{
global $lang, $config, $usrcp, $userinfo;
global $script_path, $script_encoding, $script_srv, $script_db, $script_user, $script_pass, $script_prefix;
if(isset($script_path))
{
//check for last slash
if(isset($script_path[strlen($script_path)]) && $script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
//get some useful data from smf config file
if(file_exists(PATH . $script_path . SCRIPT_CONFIG_PATH))
{
require_once (PATH . $script_path . SCRIPT_CONFIG_PATH);
//
//get config from config file
//
$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
{
//
//custom config data
//
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
//some people change their db charset
if(isset($script_db_charset))
{
$forum_db_charset = $script_db_charset;
}
}
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)
{
return kleeja_auth_login ($user_id, false, false, 0, false, true);
}
?>