Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] WebEngine 1.0.5 PL1

Newbie Spellweaver
Joined
Nov 16, 2012
Messages
47
Reaction score
1
this webengine is a joke , because i buy it with license and i wait him to fixed 4 days:| .

webengine i said me wait 2-3 hours and i wait 4 days=))
 
Junior Spellweaver
Joined
Aug 24, 2005
Messages
114
Reaction score
2
this webengine is a joke , because i buy it with license and i wait him to fixed 4 days:| .

webengine i said me wait 2-3 hours and i wait 4 days=))

I never had so much trouble to put an MU website online. :/:
Can you tell me other website, please? Thanks!
I create the admin account and as I enter the admin panel?

I dont know, do you? :blink:
 
Newbie Spellweaver
Joined
Nov 16, 2012
Messages
47
Reaction score
1
I never had so much trouble to put an MU website online. :/:
Can you tell me other website, please? Thanks!


I dont know, do you? :blink:



try bro DMN CMS , that site is stabile and owner from there i fixed you problem fast.
 
Newbie Spellweaver
Joined
Nov 25, 2011
Messages
44
Reaction score
0
help?


jacubb - [Release] WebEngine 1.0.5 PL1 - RaGEZONE Forums
 
Newbie Spellweaver
Joined
Nov 25, 2011
Messages
44
Reaction score
0
the header guys :) reemp

\img\bgtile.jpg

jacubb - [Release] WebEngine 1.0.5 PL1 - RaGEZONE Forums




//////////// edit

i need online players phpscript plz

jacubb - [Release] WebEngine 1.0.5 PL1 - RaGEZONE Forums
 
Last edited:
Junior Spellweaver
Joined
Jun 24, 2012
Messages
135
Reaction score
16
Where can i place custom template ?
sorry for stupid question
 
Initiate Mage
Joined
May 24, 2013
Messages
4
Reaction score
0
Hello profit not even fix the error admincp says 404 not found trying to enter, someone help me fix it?
 
Joined
Mar 25, 2010
Messages
527
Reaction score
43
all SQL query is this

Server: Msg 170, Level 15, State 1, Line 9
Line 9: Incorrect syntax near '('.

im using SQL2000
and xampp 1.7.1

and how to install this?
where to paste Files?

tnx
 
Newbie Spellweaver
Joined
Jun 12, 2005
Messages
63
Reaction score
12
Who have custom reset system with stats reset(Count of Reset x Points for all class)?
Ex.
For DW/DK/Elf/Sum = 300 x Resets,
For MG = 350 x Resets,
For DL = 400 x Resets,
For RF = 350 x Resets.
 
Newbie Spellweaver
Joined
Apr 13, 2013
Messages
79
Reaction score
4
Oy9J0pW - [Release] WebEngine 1.0.5 PL1 - RaGEZONE Forums


How to Fix This?
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Oct 21, 2014
Messages
55
Reaction score
1
Webengine has not live update? need to run cron.bat now and then o be updated?:blink:
 
Newbie Spellweaver
Joined
Nov 1, 2012
Messages
25
Reaction score
8
Hello friends RZ, this day come to make the following query, apparently the record, it is configured for MD5 mode register, and creating an account, shoot me the error:

[SQL 42000] [odbc 4121] > [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot find either column "dbo" or the user-defined function or aggregate "dbo.fn_md5", or the name is ambiguous. (SQLExecute[4121] at ext\pdo_odbc\odbc_stmt.c:133)

The line in the PHP log is as follows:

<?php

class common {


public function registerAccount($username,$password,$cpassword,$email) {
global $dB,$dB2;
if(check_value($username) && check_value($password) && check_value($cpassword) && check_value($email)) {
// Filters
if(!Validator::UsernameLength($username)) {
message('error', lang('error_5',true));
return;
}
if(!Validator::AlphaNumeric($username)) {
message('error', lang('error_6',true));
return;
}
if(!Validator::passwordLength($password)) {
message('error', lang('error_7',true));
return;
}
if($password != $cpassword) {
message('error', lang('error_8',true));
return;
}
if(!Validator::Email($email)) {
message('error', lang('error_9',true));
return;
}

loadModuleConfigs('register');

if(!$this->userExists($username)) {
if(!$this->emailExists($email)) {

if(mconfig('verify_email')) {
if($this->checkUsernameEVS($username)) {
message('error', lang('error_10',true));
return;
}
if($this->checkEmailEVS($email)) {
message('error', lang('error_11',true));
return;
}
$verificationKey = $this->createRegistrationVerification($username,$password,$email);
if(check_value($verificationKey)) {
$register_account = true;
}
} else {
$info = array($username, $password, 'test', '111111111111', '0', '0', '1', $email, date('m/d/Y'), date('m/d/Y'), '2005-01-03', '2005-01-03', '1', md5($username));
$query = "INSERT INTO "._TBL_MI_." (memb___id, memb__pwd, memb_name, sno__numb, bloc_code, ctl1_code, mail_chek, mail_addr, appl_days, modi_days, out__days, true_days, confirmed, activation_id) VALUES ('".$info[0]."', [dbo].[fn_md5]('".$info[1]."','".$info[0]."'), '".$info[2]."', '".$info[3]."', '".$info[4]."', '".$info[5]."', '".$info[6]."', '".$info[7]."', '".$info[8]."', '".$info[9]."', '".$info[10]."', '".$info[11]."', '".$info[12]."', '".$info[13]."')";
if(config('SQL_USE_2_DB',false)) {
$register_account = $dB2->query($query);
} else {
$register_account = $dB->query($query);
}
}

if($register_account) {
if(mconfig('verify_email')) {
$this->sendRegistrationVerificationEmail($username,$email,$verificationKey);
message('success', lang('success_18',true));
} else {
if(mconfig('send_welcome_email')) {
$this->sendWelcomeEmail($username,$email);
}

message('success', lang('success_1',true));
}

redirect(2,'login/',5);
} else {
message('error', lang('error_22',true));
}

} else {
message('error', lang('error_11',true));
}
} else {
message('error', lang('error_10',true));
}
} else {
message('error', lang('error_4',true));
}
}

public function changePasswordProcess($id,$username,$password,$new_password,$confirm_new_password) {
if(check_value($password) && check_value($new_password) && check_value($confirm_new_password)) {
if($this->validateUser($username,$password)) {
if(Validator::passwordLength($new_password)) {
if($new_password == $confirm_new_password) {
if(!$this->accountOnline($username)) {

// Update Password
if($this->changePassword($id,$username,$new_password)) {

/* success message */
message('success', lang('success_2',true));


/* send email with new password */
if(config('email_system_active',true)) {
$accountData = $this->accountInformation($id);
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}','{NEW_PASSWORD}');
$email_replace = array($username,$new_password);
$email_template = emailTemplate('CHANGE_PASSWORD');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['CHANGE_PASSWORD'];
$mail->MsgHTML($body);
if($mail->Send()) {
/* success message */
message('',lang('success_4',true),'NOTE:');
}
}
}

} else {
message('error', lang('error_23',true));
}

} else {
message('error', lang('error_14',true));
}
} else {
message('error', lang('error_8',true));
}
} else {
message('error', lang('error_7',true));
}
} else {
message('error', lang('error_13',true));
}
} else {
message('error', lang('error_4',true));
}
}

public function changePasswordProcess_verifyEmail($id,$username,$password,$new_password,$confirm_new_password,$ip_address) {
if(check_value($password) && check_value($new_password) && check_value($confirm_new_password)) {
if($this->validateUser($username,$password)) {
if(Validator::passwordLength($new_password)) {
if($new_password == $confirm_new_password) {
if(!$this->accountOnline($username)) {
if(!$this->hasActivePasswordChangeRequest($id)) {

/* account data */
$auth_code = rand(111111,999999);
$accountData = $this->accountInformation($id);
$link = $this->generatePasswordChangeVerificationURL($id,$auth_code);
if(is_array($accountData)) {

/* add request to database */
$add_request = $this->addPasswordChangeRequest($id,$new_password,$auth_code);

if($add_request) {
/* send email with new password */
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}','{DATE}','{IP_ADDRESS}','{LINK}','{EXPIRATION_TIME}');
$email_replace = array($username,date("m/d/Y @ j:i a"),$ip_address,$link,mconfig('change_password_request_timeout'));
$email_template = emailTemplate('CHANGE_PASSWORD_EMAIL_VERIFICATION');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['CHANGE_PASSWORD_EMAIL_VERIFICATION'];
$mail->MsgHTML($body);
}

if($mail->Send()) {
// success message
message('success', lang('success_3',true));
} else {
message('error', lang('error_20',true));
}
} else {
message('error', lang('error_21',true));
}
} else {
message('error', lang('error_21',true));
}
} else {
message('error', lang('error_19',true));
}
} else {
message('error', lang('error_14',true));
}
} else {
message('error', lang('error_8',true));
}
} else {
message('error', lang('error_7',true));
}
} else {
message('error', lang('error_13',true));
}
} else {
message('error', lang('error_4',true));
}
}

public function changePasswordVerificationProcess($user_id,$auth_code) {
global $dB,$dB2;
if(check_value($user_id) && check_value($auth_code)) {
$userid = Decode_id($user_id);
$authcode = Decode_id($auth_code);
$check = $dB->query_fetch_single("SELECT * FROM "._TBL_CHANGEPASSWORD_REQUEST_." WHERE user_id = '$userid'");
if(is_array($check)) {
loadModuleConfigs('usercp.mypassword');
$request_timeout = mconfig('change_password_request_timeout') * 3600;
$request_date = $check['request_date'] + $request_timeout;
if($request_date > time()) {
if($check['auth_code'] == $authcode) {
$accountData = $this->accountInformation($userid);
$username = $accountData[_CLMN_USERNM_];
$new_password = Decode($check['new_password']);
if(!$this->accountOnline($username)) {

// Update Password
$change_password = $this->changePassword($userid,$username,$new_password);

if($change_password) {

/* send email with new password */
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}','{NEW_PASSWORD}');
$email_replace = array($username,$new_password);
$email_template = emailTemplate('CHANGE_PASSWORD');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['CHANGE_PASSWORD'];
$mail->MsgHTML($body);
$mail->Send();
}

// Clear Password Change Request
$this->removePasswordChangeRequest($userid);

// Success Message
message('success', lang('success_5',true));

} else {
// unknown error
message('error', lang('error_29',true));
}
} else {
// account online
message('error', lang('error_28',true));
}
} else {
// bad auth code
message('error', lang('error_27',true));
}
} else {
// expired
message('error', lang('error_26',true));
}
} else {
// doesnt exist
message('error', lang('error_25',true));
}
} else {
// invalid data
message('error', lang('error_24',true));
}
}

public function passwordRecoveryProcess($email,$ip_address) {
if($this->emailExists($email)) {
$user_id = $this->retrieveUserIDbyEmail($email);
if(Validator::Number($user_id)) {
$accountData = $this->accountInformation($user_id);
if(is_array($accountData)) {

/* Account Recovery Code */
$arc = $this->generateAccountRecoveryCode($accountData[_CLMN_MEMBID_],$accountData[_CLMN_USERNM_]);

/* Account Recovery URL */
$aru = $this->generateAccountRecoveryLink($accountData[_CLMN_MEMBID_],$accountData[_CLMN_EMAIL_],$arc);

/* Send EMAIL to user */
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}

$email_strings = array(
'{USERNAME}',
'{DATE}',
'{IP_ADDRESS}',
'{LINK}'
);

$email_replace = array(
$accountData[_CLMN_USERNM_],
date("m/d/Y @ j:i a"),
$ip_address,
$aru
);

$email_template = emailTemplate('PASSWORD_RECOVERY_REQUEST');

if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['PASSWORD_RECOVERY_REQUEST'];
$mail->MsgHTML($body);

if(!$mail->Send()) {
// could not send email (unknown error)
message('error', lang('error_23',true));
} else {
/* success message */
message('success', lang('success_6',true));
}
} else {
// bad email template, cannot send email (unknown error)
message('error', lang('error_23',true));
}

} else {
// could not retrieve account data (unknown error)
message('error', lang('error_23',true));
}
} else {
// could not retrieve user id (unknown error)
message('error', lang('error_23',true));
}
} else {
// no email or invalid email
message('error', lang('error_30',true));
}
}

public function passwordRecoveryVerificationProcess($ui,$ue,$key) {
if(check_value($ui) && check_value($ue) && check_value($key)) {

$user_id = Decode($ui); // decoded user id
$user_email = Decode($ue); // decoded email address

if(Validator::Number($user_id)) {
if($this->emailExists($user_email)) {
$accountData = $this->accountInformation($user_id);
if(is_array($accountData)) {
$username = $accountData[_CLMN_USERNM_];
$gen_key = $this->generateAccountRecoveryCode($user_id,$username);

/* compare keys */
if($key == $gen_key) {

/* update user password */
$new_password = rand(11111111,99999999);
$update_pass = $this->changePassword($user_id,$username,$new_password);
if($update_pass) {

/* send email with new password */
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}

$email_strings = array(
'{USERNAME}',
'{NEW_PASSWORD}'
);

$email_replace = array(
$username,
$new_password
);

$email_template = emailTemplate('PASSWORD_RECOVERY_COMPLETED');

if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['PASSWORD_RECOVERY_COMPLETED'];
$mail->MsgHTML($body);

if(!$mail->Send()) {
// could not send email (unknown error)
message('error', lang('error_23',true));
} else {
/* success message */
message('success', lang('success_7',true));
}
} else {
// bad email template, cannot send email (unknown error)
message('error', lang('error_23',true));
}
} else {

message('error', lang('error_23',true));
}
} else {
message('error', lang('error_31',true));
}
} else {
message('error', lang('error_31',true));
}
} else {
message('error', lang('error_31',true));
}
} else {
message('error', lang('error_31',true));
}
} else {
message('error', lang('error_31',true));
}
}

public function masterKeyRecoveryProcess($user_id) {
global $dB,$dB2,$_COOKIE;
if(check_value($user_id)) {
if(!check_value($_COOKIE['webengine_masterkey'])) {
$accountData = $this->accountInformation($user_id);
if(check_value($accountData[_CLMN_MASTER_KEY_])) {
if(!$this->accountOnline($accountData[_CLMN_USERNM_])) {
/* send email with new password */
$username = $accountData[_CLMN_USERNM_];
$email_titles = config('email_titles',true);
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}','{CURRENT_MASTERKEY}');
$email_replace = array($username,$accountData[_CLMN_MASTER_KEY_]);
$email_template = emailTemplate('MASTER_KEY_RECOVERY');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$address = $accountData[_CLMN_EMAIL_];
$mail->AddAddress($address);
$mail->Subject = $email_titles['MASTER_KEY_RECOVERY'];
$mail->MsgHTML($body);
if(!$mail->Send()) {
// could not send email (unknown error)
message('error', lang('error_23',true));
} else {
/* success message */
message('success', lang('success_16',true));
/* set cookie for request limit */
setcookie("webengine_masterkey", $username, time()+3600); /* expire in 1 hour */
}
} else {
// bad email template, cannot send email (unknown error)
message('error', lang('error_23',true));
}
} else {
message('error', lang('error_14',true));
}
} else {
message('error', lang('error_49',true));
}
} else {
message('error', lang('error_50',true));
}
} else {
message('error', lang('error_23',true));
}
}

public function emailExists($email) {
global $dB,$dB2;
if(!Validator::Email($email)) { $error = true; }
if(!$error) {
debug('pass');
$query = "SELECT * FROM "._TBL_MI_." WHERE "._CLMN_EMAIL_." = '$email'";
if(config('SQL_USE_2_DB',false)) {
$check = $dB2->query_fetch_single($query);
} else {
$check = $dB->query_fetch_single($query);
}
if(is_array($check)) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function userExists($username) {
global $dB,$dB2;
if(!Validator::UsernameLength($username)) { $error = true; }
if(!Validator::AlphaNumeric($username)) { $error = true; }
if(!$error) {
$query = "SELECT * FROM "._TBL_MI_." WHERE "._CLMN_USERNM_." = '$username'";
if(config('SQL_USE_2_DB',false)) {
$check = $dB2->query_fetch_single($query);
} else {
$check = $dB->query_fetch_single($query);
}
if(is_array($check)) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function validateUser($username,$password) {
global $dB,$dB2;
if(!Validator::UsernameLength($username)) { $error = true; }
if(!Validator::AlphaNumeric($username)) { $error = true; }
if(!Validator::passwordLength($password)) { $error = true; }
if(!$error) {
$query = "SELECT * FROM "._TBL_MI_." WHERE "._CLMN_USERNM_." = '$username' AND "._CLMN_PASSWD_." = '$password'";
if(config('SQL_USE_2_DB',false)) {
$check = $dB2->query_fetch_single($query);
} else {
$check = $dB->query_fetch_single($query);
}
if(is_array($check)) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function retrieveUserID($username) {
global $dB,$dB2;
if(!Validator::UsernameLength($username)) { $error = true; }
if(!Validator::AlphaNumeric($username)) { $error = true; }
if(!$error) {
$query = "SELECT "._CLMN_MEMBID_." FROM "._TBL_MI_." WHERE "._CLMN_USERNM_." = '$username'";
if(config('SQL_USE_2_DB',false)) {
$data = $dB2->query_fetch_single($query);
} else {
$data = $dB->query_fetch_single($query);
}
if(is_array($data)) {
return $data[_CLMN_MEMBID_];
} else {
return null;
}
} else {
return null;
}
}

public function retrieveUserIDbyEmail($email) {
global $dB,$dB2;
if($this->emailExists($email)) {
$query = "SELECT "._CLMN_MEMBID_." FROM "._TBL_MI_." WHERE "._CLMN_EMAIL_." = '$email'";
if(config('SQL_USE_2_DB',false)) {
$data = $dB2->query_fetch_single($query);
} else {
$data = $dB->query_fetch_single($query);
}
if(is_array($data)) {
return $data[_CLMN_MEMBID_];
} else {
return null;
}
} else {
return null;
}
}

public function accountInformation($id) {
global $dB,$dB2;
if(!Validator::Number($id)) { $error = true; }
if(!$error) {
$query = "SELECT * FROM "._TBL_MI_." WHERE "._CLMN_MEMBID_." = '$id'";
if(config('SQL_USE_2_DB',false)) {
$data = $dB2->query_fetch_single($query);
} else {
$data = $dB->query_fetch_single($query);
}
if(is_array($data)) {
return $data;
} else {
return false;
}
} else {
return false;
}
}

public function accountOnline($username) {
global $dB,$dB2;
if(!Validator::UsernameLength($username)) { $error = true; }
if(!Validator::AlphaNumeric($username)) { $error = true; }
if(!$error) {
$query = "SELECT "._CLMN_CONNSTAT_." FROM "._TBL_MS_." WHERE "._CLMN_USERNM_." = '$username'";
if(config('SQL_USE_2_DB',false)) {
$data = $dB2->query_fetch_single($query);
} else {
$data = $dB->query_fetch_single($query);
}
if(is_array($data)) {
if($data[_CLMN_CONNSTAT_] == 1) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}

public function changePassword($id,$username,$new_password) {
global $dB,$dB2;
if(!Validator::Number($id)) { $error = true; }
if(!Validator::UsernameLength($username)) { $error = true; }
if(!Validator::AlphaNumeric($username)) { $error = true; }
if(!Validator::passwordLength($new_password)) { $error = true; }
if(!$error) {
$query = "UPDATE "._TBL_MI_." SET "._CLMN_PASSWD_." = [dbo].[fn_md5]('$new_password','$username') WHERE "._CLMN_MEMBID_." = '$id'";
if(config('SQL_USE_2_DB',false)) {
$change_password = $dB2->query($query);
} else {
$change_password = $dB->query($query);
}
if($change_password) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function addPasswordChangeRequest($user_id,$new_password,$auth_code) {
global $dB;
if(check_value($user_id) && check_value($new_password)) {
if(Validator::passwordLength($new_password)) {
$data = array(
$user_id,
Encode($new_password),
$auth_code,
time()
);
$add_request = $dB->query("INSERT INTO "._TBL_CHANGEPASSWORD_REQUEST_." (user_id,new_password,auth_code,request_date) VALUES (?, ?, ?, ?)", $data);
if($add_request) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}

public function hasActivePasswordChangeRequest($user_id) {
global $dB;
$check = $dB->query_fetch_single("SELECT * FROM "._TBL_CHANGEPASSWORD_REQUEST_." WHERE user_id = '$user_id'");
if(is_array($check)) {
$request_timeout = mconfig('change_password_request_timeout') * 3600;
$request_date = $check['request_date'] + $request_timeout;
if(time() > $request_date) {
$this->removePasswordChangeRequest($user_id);
return false;
} else {
return true;
}
} else {
return false;
}
}

public function removePasswordChangeRequest($user_id) {
global $dB;
$query = $dB->query("DELETE FROM "._TBL_CHANGEPASSWORD_REQUEST_." WHERE user_id = '$user_id'");
if($query) {
return true;
} else {
return false;
}
}

public function generatePasswordChangeVerificationURL($user_id,$auth_code) {
$build_url = __BASE_URL__;
$build_url .= 'verifyemail/';
$build_url .= '?op='; // operation
$build_url .= Encode_id(1);
$build_url .= '&uid=';
$build_url .= Encode_id($user_id);
$build_url .= '&ac=';
$build_url .= Encode_id($auth_code);
return $build_url;
}

public function addCredits($userid,$amount,$check_online=true,$custom=false,$custom_database="MuOnline",$custom_table="MEMB_INFO",$custom_column="cspoints",$column_user="memb___id",$custom_user_identifier=1) {
global $dB,$dB2;

// Filters
if(!check_value($userid)) { return; }
if(!check_value($amount)) { return; }
if(!Validator::Number($amount)) { return; }
if(!Validator::Number($userid)) { return; }

// retrieve account data
$accountData = $this->accountInformation($userid);
if(!is_array($accountData)) { return; }

// Online Check
if($check_online) {
if($this->accountOnline($accountData[_CLMN_USERNM_])) {
return;
}
}

if(!$custom) {
// REGULAR CREDITS SEND
if(config('add_credits_to_temp',true)) {
$query = "UPDATE "._TBL_MI_." SET "._CLMN_CREDITS_TEMP_." = "._CLMN_CREDITS_TEMP_." + $amount WHERE "._CLMN_MEMBID_." = '$userid'";
} else {
$query = "UPDATE "._TBL_MI_." SET "._CLMN_CREDITS_." = "._CLMN_CREDITS_." + $amount WHERE "._CLMN_MEMBID_." = '$userid'";
}
if(config('SQL_USE_2_DB',false)) {
$reward = $dB2->query($query);
} else {
$reward = $dB->query($query);
}
if($reward) {
return true;
}

} else {
// CUSTOM CREDITS SEND
// custom database
switch($custom_database) {
case "MuOnline":
$dataBase = $dB;
break;
case "Me_MuOnline":
$dataBase = $dB2;
break;
default:
$dataBase = $dB;
break;
}
// build query
$query = "UPDATE $custom_table SET $custom_column = $custom_column + ? WHERE $column_user = ?";
// user identifier
if($custom_user_identifier == 1) {
$userIdentifier = $accountData[_CLMN_USERNM_];
} else {
$userIdentifier = $userid;
}
// run query
$reward = $dataBase->query($query, array($amount, $userIdentifier));
if($reward) {
return true;
}
}
}

public function substractCredits($userid,$amount) {
global $dB,$dB2;
if(check_value($userid) && check_value($amount) && Validator::Number($amount) && Validator::Number($userid)) {
$userData = $this->accountInformation($userid);
if(is_array($userData)) {
$accountCredits = $userData[_CLMN_CREDITS_];
if($accountCredits >= $amount) {
$query = "UPDATE "._TBL_MI_." SET "._CLMN_CREDITS_." = "._CLMN_CREDITS_." - $amount WHERE "._CLMN_MEMBID_." = $userid";
if(config('SQL_USE_2_DB',false)) {
$deduct = $dB2->query($query);
} else {
$deduct = $dB->query($query);
}
if($deduct) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
// unknown error (incomplete data) or reward amount is not number
return false;
}
}

public function blockAccount($userid) {
global $dB,$dB2;
if(check_value($userid) && Validator::Number($userid)) {
$query = "UPDATE "._TBL_MI_." SET "._CLMN_BLOCCODE_." = 1 WHERE "._CLMN_MEMBID_." = '$userid'";
if(config('SQL_USE_2_DB',false)) {
$block = $dB2->query($query);
} else {
$block = $dB->query($query);
}
if($block) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function paypal_transaction($transaction_id,$user_id,$payment_amount,$paypal_email,$order_id) {
global $dB;
if(check_value($transaction_id) && check_value($user_id) && check_value($payment_amount) && check_value($paypal_email) && check_value($order_id)) {
if(Validator::Number($user_id)) {
$data = array(
$transaction_id,
$user_id,
$payment_amount,
$paypal_email,
time(),
1,
$order_id
);
$add = $dB->query("INSERT INTO "._TBL_PAYPAL_." (transaction_id, user_id, payment_amount, paypal_email, transaction_date, transaction_status, order_id) VALUES (?, ?, ?, ?, ?, ?, ?)", $data);
if($add) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}

public function paypal_transaction_reversed_updatestatus($order_id) {
global $dB;
if(check_value($order_id)) {
$update = $dB->query("UPDATE "._TBL_PAYPAL_." SET transaction_status = 0 WHERE order_id = '$order_id'");
if($update) {
return true;
} else {
return false;
}
} else {
return false;
}
}

function addRewardItem($character_name,$item_data_array) {
global $dB;
if(check_value($character_name) && check_value($item_data_array) && is_array($item_data_array)) {
$data = array(
$character_name,
$item_data_array[0],
$item_data_array[1],
$item_data_array[2],
$item_data_array[3],
$item_data_array[4],
$item_data_array[5],
$item_data_array[6],
$item_data_array[7],
$item_data_array[8],
$item_data_array[9]
);

$addItems = $dB->query("INSERT INTO "._TBL_REWARD_ITEM_." (name,iGroup,iIndex,iLevel,iDur,iLuck,iSkill,iExc,iSet,iSock,iOpt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data);

if($addItems) {
return true;
} else {
return false;
}
} else {
return false;
}
}

public function retrieveAccountIPs($username) {
global $dB;
if(check_value($username)) {
if($this->userExists($username)) {
$query = $dB->query_fetch("SELECT IP FROM "._TBL_LOGEX_." WHERE AccountId = '$username' GROUP BY IP");
if(is_array($query)) {
return $query;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}

public function generateAccountRecoveryCode($user_id,$username) {
if(check_value($user_id) && check_value($username)) {
return md5($user_id . $username . config('encryption_hash',true) . date("m-d-Y"));
} else {
return null;
}
}

public function generateAccountRecoveryLink($user_id,$email,$recovery_code) {
if(check_value($user_id) && check_value($recovery_code)) {
$user_id_encoded = Encode($user_id);
$email_encoded = Encode($email);
$build_url = __BASE_URL__;
$build_url .= 'forgotpassword/';
$build_url .= '?ui=';
$build_url .= $user_id_encoded;
$build_url .= '&ue=';
$build_url .= $email_encoded;
$build_url .= '&key=';
$build_url .= $recovery_code;
return $build_url;
} else {
return false;
}
}

public function updateVipTimeStamp($userid,$new_timestamp) {
global $dB,$dB2;
$query = "UPDATE "._TBL_MI_." SET "._CLMN_VIP_STAMP_." = '$new_timestamp' WHERE "._CLMN_MEMBID_." = '$userid'";
if(config('SQL_USE_2_DB',false)) {
$update = $dB2->query($query);
} else {
$update = $dB->query($query);
}
if($update) {
return true;
} else {
return false;
}
}

private function sendWelcomeEmail($username,$email) {
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}');
$email_replace = array($username);
$email_template = emailTemplate('WELCOME_EMAIL');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$mail->AddAddress($email);
$email_titles = config('email_titles',true);
$mail->Subject = $email_titles['WELCOME_EMAIL'];
$mail->MsgHTML($body);
$mail->Send();
}
}

private function createRegistrationVerification($username,$password,$email) {
global $dB;
$key = uniqid();
$query = $dB->query("INSERT INTO WEBENGINE_REGISTER_ACCOUNT (registration_account,registration_password,registration_email,registration_date,registration_ip,registration_key) VALUES (?,?,?,?,?,?)", array($username, Encode($password), $email, time(), $_SERVER['REMOTE_ADDR'], $key));
if($query) {
return $key;
}
}

private function sendRegistrationVerificationEmail($username,$email,$key) {
$verificationLink = __BASE_URL__.'verifyemail/?op='.Encode_id(2).'&user='.Encode($username).'&key='.$key;
$mail = new PHPMailer();
$smtpCONF = gconfig('smtp',true);
if($smtpCONF['active']) {
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $smtpCONF['smtp_host'];
$mail->Port = $smtpCONF['smtp_port'];
$mail->Username = $smtpCONF['smtp_user'];
$mail->Password = $smtpCONF['smtp_pass'];
}
$email_strings = array('{USERNAME}','{LINK}');
$email_replace = array($username,$verificationLink);
$email_template = emailTemplate('WELCOME_EMAIL_VERIFICATION');
if($email_template) {
$build_template = replaceMultiTextStrings($email_template,$email_strings,$email_replace);
$body = $build_template;
$mail->SetFrom(config('email_send_from',true), config('email_send_from_name',true));
$mail->AddAddress($email);
$email_titles = config('email_titles',true);
$mail->Subject = $email_titles['WELCOME_EMAIL_VERIFICATION'];
$mail->MsgHTML($body);
$mail->Send();
}
}

public function verifyRegistrationProcess($username,$key) {
global $dB,$dB2;
$verifyKey = $dB->query_fetch_single("SELECT * FROM WEBENGINE_REGISTER_ACCOUNT WHERE registration_account = ? AND registration_key = ?", array($username,$key));
if($verifyKey && is_array($verifyKey)) {
// create account
$info = array($verifyKey['registration_account'], Decode($verifyKey['registration_password']), 'test', '111111111111', '0', '0', '1', $verifyKey['registration_email'], date('m/d/Y'), date('m/d/Y'), '2005-01-03', '2005-01-03', '1', md5($verifyKey['registration_account']));
$query = "INSERT INTO "._TBL_MI_." (memb___id, memb__pwd, memb_name, sno__numb, bloc_code, ctl1_code, mail_chek, mail_addr, appl_days, modi_days, out__days, true_days, confirmed, activation_id) VALUES ('".$info[0]."', [dbo].[fn_md5]('".$info[1]."','".$info[0]."'), '".$info[2]."', '".$info[3]."', '".$info[4]."', '".$info[5]."', '".$info[6]."', '".$info[7]."', '".$info[8]."', '".$info[9]."', '".$info[10]."', '".$info[11]."', '".$info[12]."', '".$info[13]."')";
if(config('SQL_USE_2_DB',false)) {
$register_account = $dB2->query($query);
} else {
$register_account = $dB->query($query);
}
if($register_account) {
// delete verification
$this->deleteRegistrationVerification($username);

// send welcome email
$this->sendWelcomeEmail($verifyKey['registration_account'],$verifyKey['registration_email']);

// success message
message('success', 'welcome!');
redirect(2,'login/',5);
} else {
message('error', 'some error');
}
} else {
redirect();
}
}

private function deleteRegistrationVerification($username) {
global $dB;
$delete = $dB->query("DELETE FROM WEBENGINE_REGISTER_ACCOUNT WHERE registration_account = ?", array($username));
if($delete) {
return true;
}
}

// Check if an username exists in the email verification system
private function checkUsernameEVS($username) {
global $dB;
$result = $dB->query_fetch_single("SELECT * FROM WEBENGINE_REGISTER_ACCOUNT WHERE registration_account = ?", array($username));
if($result && is_array($result)) {
loadModuleConfigs('register');
$timelimit = $result['registration_date']+mconfig('verification_timelimit')*60*60;
if($timelimit < time()) {
$this->deleteRegistrationVerification($username);
return false;
} else {
return true;
}
}
}

// Check if an email exists in the email verification system
private function checkEmailEVS($email) {
global $dB;
$result = $dB->query_fetch_single("SELECT * FROM WEBENGINE_REGISTER_ACCOUNT WHERE registration_email = ?", array($email));
if($result && is_array($result)) {
loadModuleConfigs('register');
$timelimit = $result['registration_date']+mconfig('verification_timelimit')*60*60;
if($timelimit < time()) {
$this->deleteRegistrationVerification($result['registration_account']);
return false;
} else {
return true;
}
}
}

public function isIpBlocked($ip) {
global $dB;
if(Validator::Ip($ip)) {
$check = $dB->query_fetch_single("SELECT * FROM WEBENGINE_BLOCKED_IP WHERE block_ip = ?", array($ip));
if($check && is_array($check)) {
return true;
}
}
}

public function blockIpAddress($ip,$user) {
global $dB;
if(!check_value($user)) { return; }
if(!$this->isIpBlocked($ip)) {
$block = $dB->query("INSERT INTO WEBENGINE_BLOCKED_IP (block_ip,block_by,block_date) VALUES (?,?,?)", array($ip,$user,time()));
if($block) {
return true;
}
}
}

public function retrieveBlockedIPs() {
global $dB;
return $dB->query_fetch("SELECT * FROM WEBENGINE_BLOCKED_IP ORDER BY id DESC");
}

public function unblockIpAddress($id) {
global $dB;
$unblock = $dB->query("DELETE FROM WEBENGINE_BLOCKED_IP WHERE id = ?", array($id));
if($unblock) {
return true;
}
}
}


?>

As could remove MD5 registry? :?:
 
Back
Top