Main Menu / Manage Realms / Edit
+Main Menu / Manage Realms / Edit
.
diff --git a/core/SDL/class.account.php b/core/SDL/class.account.php
index 20168ee..20fc63f 100644
--- a/core/SDL/class.account.php
+++ b/core/SDL/class.account.php
@@ -83,7 +83,7 @@ function check()
}
// Make sure the activation code is NULL in the DB
- if($res['activation_code'] != NULL)
+ if($res['locked'] == 1)
{
$this->setgroup();
return false;
@@ -169,8 +169,8 @@ function login($params)
return 4;
}
- // If the activation code is not NULL, the account is not activated, return 5
- if($res2['activation_code'] != NULL)
+ // If the account is locked or "inactive" then return 5, do not allow login
+ if($res['locked'] == 1)
{
$success = 0;
return 5;
diff --git a/core/SDL/class.rasocket.php b/core/SDL/class.rasocket.php
index 00e381b..c304f5e 100644
--- a/core/SDL/class.rasocket.php
+++ b/core/SDL/class.rasocket.php
@@ -209,16 +209,16 @@ private function writeDebugLog()
Returns 2 if it's not authenticated
@param $command the command to enter on console
*/
- public function executeCommand($type, $shost, $remote, $command)
+ public function executeCommand($type, $host, $port, $user, $pass, $command)
{
if($type == 0)
{
- if(!$this->connect($shost, $remote[1]))
+ if(!$this->connect($host, $port))
{
return 0;
}
- if(!$this->auth($remote[2], $remote[3]))
+ if(!$this->auth($user, $pass))
{
return 2;
}
@@ -272,7 +272,7 @@ public function executeCommand($type, $shost, $remote, $command)
}
else # type is SOAP
{
- $client = $this->soapHandle($shost, $remote);
+ $client = $this->soapHandle($host, $port, $user, $pass);
// If multiple commands
if(is_array($command))
{
@@ -338,29 +338,29 @@ public function executeCommand($type, $shost, $remote, $command)
// ************************************************************
// Setups the Soap Handle
- private function soapHandle($shost, $remote)
+ private function soapHandle($host, $port, $user, $pass)
{
global $mwe_config;
if($mwe_config['emulator'] == 'mangos')
{
$client = new SoapClient(NULL,
array(
- "location" => "http://".$shost.":".$remote[1]."/",
+ "location" => "http://".$host.":".$port."/",
"uri" => "urn:MaNGOS",
"style" => SOAP_RPC,
- "login" => $remote[2],
- "password" => $remote[3]
+ "login" => $user,
+ "password" => $pass
));
}
else
{
$client = new SoapClient(NULL,
array(
- "location" => "http://".$shost.":".$remote[1]."/",
+ "location" => "http://".$host.":".$port."/",
"uri" => "urn:TC",
"style" => SOAP_RPC,
- "login" => $remote[2],
- "password" => $remote[3]
+ "login" => $user,
+ "password" => $pass
));
}
return $client;
@@ -378,17 +378,15 @@ private function soapHandle($shost, $remote)
*/
function send($command, $realm)
{
- global $RDB;
+ global $RDB, $DB;
// Get the remote access information from the realm database
- $get_remote = $RDB->selectRow("SELECT * FROM `realmlist` WHERE id='".$realm."'");
- $remote = explode(';', $get_remote['ra_info']);
- $shost = $get_remote['address'];
-
+ $remote = $DB->selectRow("SELECT ra_type, ra_port, ra_user, ra_pass FROM `mw_realm` WHERE `realm_id`='".$realm."'");
+ $host = $RDB->selectCell("SELECT `address` FROM `realmlist` WHERE `id` = '$realm'");
// Make sure the remote access type is either 1 or 0
- if($remote[0] == 0 || $remote[0] == 1)
+ if((int)$remote['ra_type'] == 0 || (int)$remote['ra_type'] == 1)
{
- $result = $this->executeCommand($remote[0], $shost, $remote, $command);
+ $result = $this->executeCommand($remote['ra_type'], $host, $remote['ra_port'], $remote['ra_user'], $remote['ra_pass'], $command);
if($result != 1)
{
if($result == 0)
diff --git a/core/class.database.php b/core/class.database.php
index 5cf5721..e411054 100644
--- a/core/class.database.php
+++ b/core/class.database.php
@@ -140,7 +140,7 @@ public function count($query)
{
$sql = mysqli_query($this->mysql, $query) or die("Couldnt Run Query: ".$query."
Error: ".mysqli_error($this->mysql)."");
$this->_statistics['count']++;
- return (int)mysqli_fetch_assoc($sql);
+ return mysqli_num_rows($sql);
}
// ************************************************************
diff --git a/core/core.php b/core/core.php
index fe1210a..af5a2d2 100644
--- a/core/core.php
+++ b/core/core.php
@@ -10,8 +10,8 @@
class Core
{
- public $version = '4.1.1';
- public $version_date = '2017-03-29, 13:17';
+ public $version = '4.1.2';
+ public $version_date = '2017-04-02, 15:41';
public $db_version = '4.1.0';
private $conf;
diff --git a/inc/admin/script_files/admin.news.php b/inc/admin/script_files/admin.news.php
index fa9ad40..23ba4d6 100644
--- a/inc/admin/script_files/admin.news.php
+++ b/inc/admin/script_files/admin.news.php
@@ -26,7 +26,7 @@ function addNews($subj,$message,$un)
else
{
$post_time = time();
- $sql = "INSERT INTO mw_news(title, message, posted_by, post_time) VALUES('".$subj."','".$message."','".$un."','".$post_time."')";
+ $sql = "INSERT INTO mw_news(title, message, posted_by, post_time) VALUES('".$DB->real_escape_string($subj)."','".$DB->real_escape_string($message)."','".$un."','".$post_time."')";
$tabs = $DB->query($sql);
output_message('success', $lang['news_add_success']);
@@ -41,7 +41,7 @@ function editNews($idz,$mess)
}
else
{
- $DB->query("UPDATE `mw_news` SET `message`='$mess' WHERE `id`='$idz'");
+ $DB->query("UPDATE `mw_news` SET `message`='".$DB->real_escape_string($mess)."' WHERE `id`='$idz'");
output_message('success', $lang['news_edit_success']);
}
diff --git a/inc/admin/script_files/admin.realms.php b/inc/admin/script_files/admin.realms.php
index f29200c..8f4762d 100644
--- a/inc/admin/script_files/admin.realms.php
+++ b/inc/admin/script_files/admin.realms.php
@@ -40,6 +40,9 @@ function updateRealm()
if(empty($_POST['db_char_port']))
$_POST['db_char_port'] = 0;
+ if(empty($_POST['ra_port']))
+ $_POST['ra_port'] = 0;
+
if($realm > 0)
{
$DB->query("UPDATE `mw_realm` SET
@@ -53,6 +56,10 @@ function updateRealm()
`db_char_port` = '".$_POST['db_char_port']."',
`db_char_user` = '".$_POST['db_char_user']."',
`db_char_pass` = '".$_POST['db_char_pass']."',
+ `ra_type` = '".$_POST['ra_type']."',
+ `ra_port` = '".$_POST['ra_port']."',
+ `ra_user` = '".$_POST['ra_user']."',
+ `ra_pass` = '".$_POST['ra_pass']."',
`site_enabled` = '".$_POST['site_enabled']."'
WHERE `realm_id` = ".$_GET['id']."
");
@@ -70,6 +77,10 @@ function updateRealm()
`db_char_port` = '".$_POST['db_char_port']."',
`db_char_user` = '".$_POST['db_char_user']."',
`db_char_pass` = '".$_POST['db_char_pass']."',
+ `ra_type` = '".$_POST['ra_type']."',
+ `ra_port` = '".$_POST['ra_port']."',
+ `ra_user` = '".$_POST['ra_user']."',
+ `ra_pass` = '".$_POST['ra_pass']."',
`site_enabled` = '".$_POST['site_enabled']."',
`realm_id` = ".$_GET['id'].";
");
diff --git a/inc/admin/template_files/admin.realms.php b/inc/admin/template_files/admin.realms.php
index 72e115b..53215f2 100644
--- a/inc/admin/template_files/admin.realms.php
+++ b/inc/admin/template_files/admin.realms.php
@@ -17,16 +17,14 @@
if(isset($_GET['id']))
{
$rlm = $RDB->selectRow("SELECT * FROM `realmlist` WHERE `id`='".$_GET['id']."'");
- $rlm_ext = $DB->selectRow("SELECT * FROM mw_realm WHERE realm_id = '".$_GET['id']."'");
+ $rlm_ext = $DB->selectRow("SELECT * FROM `mw_realm` WHERE `realm_id` = '".$_GET['id']."'");
- $db_info = explode( ';', $rlm['dbinfo'] ) ;
- $ra_info = explode( ';', $rlm['ra_info'] ) ;
?>
.