The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!
You are not logged in.
Pages: 1
Hello i have read already this post http://forum.adultscriptpro.com/viewtopic.php?id=31
i have also demo version..want to try integration.i did that code the person has been posted for ASPro database but no luck..
Website im using Skadate 8
Here is the code from other post
<?php
#
# Copyright © 2004-2010 Chat software by [url=http://www.flashcoms.com]www.flashcoms.com[/url]
#
# This is the demo handler. Replace it with your custom logic.
#
$login = $_REQUEST['login'];
$password = $_REQUEST['password'];
//Connect to users database
$db = mysql_connect('localhost','dbuser','dbpass') or die(mysql_error());
mysql_select_db('databasename',$db) or die(mysql_error());
//Init request parameters
$userName = (isset($_REQUEST["login"])) ? urldecode($_REQUEST["login"]) : "";
$password = (isset($_REQUEST["password"])) ? urldecode($_REQUEST["password"]) : "";
$uid = (isset($_REQUEST["uid"])) ? urldecode($_REQUEST["uid"]) : "";
#$login = md5($login);
#$password = md5($password);
//Check if user filled login and password in the login screen (Chat authorization)
if($login != "" && $password != "")
{
# $sql = "SELECT * FROM skadate_profile WHERE username='".$login."' AND password='".$password."'"; //////// This works not, because the passwd is endcrpyted :(
# $sql = "SELECT * FROM skadate_profile WHERE username='".$login."'"; /// This works but no password check :(
}
//session/cookie base authorization (Auto login)
else if ($_SESSION['user_id']!="")
{
$sql = "SELECT * FROM user WHERE id='".$_SESSION["user_id"]."'";
}
// Non session/cookie based autologin authorization
else if ($uid!="")
{
$sql = "SELECT * FROM user WHERE id='".$_GET['user_id']."'";
}
else
{
echo '<login result="FAIL" error="error_authentication_failed1"/>';
exit;
}
//Select user data
$result = mysql_query($sql,$db);
$count=mysql_num_rows($result);
if($count==1)
#if(mysql_num_rows($result)==1)
{
//User found. get user info
$usersInfo = mysql_fetch_array($result);
$answer .= '<login result="OK">';
$answer .= '<userData>';
$answer .= '<id>'.$usersInfo['user_id'].'</id>';
$answer .= '<name><![CDATA['.$userName.']]></userName>';
$answer .= '<photo>'.$usersInfo['user_id'].'</id>';
$answer .= '<gender>'.$usersInfo['gender'].'</gender>'; //male, female or couple
$answer .= '</userData>';
$answer .= '</login>';
echo $answer;
exit;
}
else
{
//User not found OR authorization failed
echo '<login result="FAIL" error="error_authentication_failed"/>';
exit;
}
?>
Here is Skadate Login_wm.php
<?php
require_once './internals/$config.php';
require_once './internals/Header.inc.php';
$u = $_GET['username'];
$p = $_GET['password'];
if($_POST['with'])
{
$is_speed_dating = false;
if( !empty($_SESSION['speed_dating_event']['opponent_id']) )
{
$esd_username = app_Profile::getFieldValues($_SESSION['speed_dating_event']['opponent_id'], 'username');
if ( strtolower($esd_username ) == strtolower($_POST['with']) )
{
$is_speed_dating = true;
}
}
if (!$is_speed_dating)
{
$service = new SK_Service('initiate_im_session');
if ($service->checkPermissions() != SK_Service::SERVICE_FULL ){
exit( "{allowed: 0, alert: '{$service->permission_message['alert']}' }" );
}
}
exit( "{allowed: 1, username: '{$_POST['with']}'}" );
}
$query = sql_placeholder("SELECT IF( `password`= '$p', 1, 0 ) FROM `?#TBL_PROFILE` WHERE `username` = ? LIMIT 1", $u, $p);
$value = MySQL::fetchField($query);
if($value === false){
exit('4'); // 4 - username doesn't exist
}
else if($value == 0){
exit('1'); // 1 - wrong pass
}
exit('0'); // 0 - successfull authentication
?>
Is there anyone able to figure it out?
Pages: 1