[Work ON] User Control Panel

10/23/2015 20:23 DevilOfSun#1
Hello Guys :D
Today i will present you what i am work on.
Sorry for my bad english in this post but i am german :D

I am Working on a User Control Panel that is Homepage based.
This User Control Panel will give the user the chance to configurate them Accounts by themselfs.
By the way it took the work from the Admin away :)
And it will clean up some Homepages. (In the truth the most are in a mess)

In this ucp (user control Panel) the user can edit them Passwords, choose 1 of 4 Gear Designs, do a faction change by paying 5k DP (customizable), and move theyr kills from one char to another.
Then i will make a counter who tells the User how mutch kills he doing in this week.

So i am still working on it so if you had ideas or want to help for better performance or security... you are welcome :D

Here is a little Screenshot of it :

[Only registered and activated users can see links. Click Here To Register...]


Please tell me what you think of it :)
10/23/2015 21:11 hatwas#2
Sieht gut aus
10/23/2015 22:21 DevilOfSun#3
Wenn es fertig ist wird es nen free release sein denk ich mal ^^ :D
10/24/2015 00:31 [ADM]_Dephisio#4
Some scripts already exists,take them and make some modifications ;)
10/24/2015 02:50 DevilOfSun#5
But the most are not with the code i need.
I´ve find a script for faction change but in it you must only put the charname and then the scripts take the account to other faction. Now i will modify it to something like : Put Accountname and Passwort and then the Script Change the Faction but also clean the Chars Inventory because of Character Load Error if they had Light gear on or am i wrong ?
10/24/2015 03:10 [ADM]_Dephisio#6
If you have login on your website (with the account of the server) you can try to make something like this:
Player need to login to the website > he goes on the panel and then he can choose the character for change his faction.
10/24/2015 03:22 DevilOfSun#7
yeah thats what i am thinking too, but the security is higher when the user have to put in the Account and Password i think or ?

So at The moment i use this script :

PHP Code:
<?php

require_once('db.config.php');

$character '';

?>
-- Script From [DEV]Viro

<html>
    <head>
        <title>[Dev]Viro Faction Change</title>
    <style type="text/css">
        h2         {text-align:center; color:yellow;}
        h4         {text-align:center; color:white;}
        div#adminLogin    {background-color:#111111; width:160px; padding:10px;}
        div#formArea    {background-color:#595959; padding:5px; position:relative; left:0px;}
        .submitButton    {position:relative; left:40px;}
        
    </style>
    </head>
    <body>
        <div id="adminLogin">
            
            <div id="factionChange"><h4>Faction Change</h4>

                <div id="formArea">
                    <form action="factionchange.php" method="POST">
                        Account<br/><input type="text" name="character" value="<?php echo $account?>"><br/>
                        Passwort<br/><input type="text" name="password" value="<?php echo $password?>"><br/>
                        <br/><input type="submit" name="formSubmit" value="Submit" class="submitButton">
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>
<?php

if ($_POST['formSubmit'] == "Submit") {
    
$account $_POST['account'];
    
$password $_POST ['Pw'];
    
$dbhost $_ENV['LOCAL_DOMAIN'];

    
$sql "SELECT UserUID FROM PS_UserData.dbo.Users_Master WHERE UserID = ? and Pw = ?";
    
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
    
$args = array($account);
    
$args = array ($password);
    
odbc_execute($stmt,$args,);
    
'<br/>';
    
$userUID odbc_result($stmt,'UserUID');
    
    
$sql "SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = ?";
    
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
    
$args = array($userUID);
    
odbc_execute($stmt,$args);
    
'<br/>';
    
$country odbc_result($stmt,'Country');
    
    if (
$country==0) {
        
$sql "UPDATE PS_GameData.dbo.UserMaxGrow
            SET Country = 1
            WHERE UserUID = ?"
;
        
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
        
$args = array($userUID );
        
odbc_execute($stmt,$args);
        echo 
$character.' was successfully factioned changed from light to fury!';
    }

    if (
$country==1) {
        
$sql "UPDATE PS_GameData.dbo.UserMaxGrow
            SET Country = 0
            WHERE UserUID = ?"
;
        
$stmt odbc_prepare($GLOBALS['dbConn'],$sql);
        
$args = array($userUID );
        
odbc_execute($stmt,$args);
        echo 
$character.' was successfully factioned changed from fury to light!';
    }

    
odbc_close($GLOBALS['dbConn']);
}

?>

but when i submit i become the following error:

Code:
Warning: odbc_execute() [function.odbc-execute]: Not enough parameters (1 should be 2) given in C:\xampp\htdocs\scriptsucp\FactionChange\factionchange.php on line 49

Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification, SQL state 22005 in SQLExecute in C:\xampp\htdocs\scriptsucp\FactionChange\factionchange.php on line 56

Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification, SQL state 22005 in SQLExecute in C:\xampp\htdocs\scriptsucp\FactionChange\factionchange.php on line 66
I dont see what the hell i forgot xD can you help ? ^^
10/24/2015 03:28 [ADM]_Dephisio#8
>On Legacy we do something like what i said and its secure
>i'm not very good in Php sorry
10/24/2015 03:41 DevilOfSun#9
Okay i will do a script like u said and i hope that this will work ^^
I Think the hardest work will the gear change script xD
10/24/2015 12:12 Trayne01#10
You can make a simple PHP login script using
PHP Code:
$_SESSION 
and then, make a check like that to display or not your panel:
PHP Code:
if (!empty($_SSSION['UserName'])) {
              include(
'panel.php')
        else {
        
$msg='You can login <a href="login.php">here</a> to use the panel') }
...... 
PHP Code:
<p>echo($msg)</p
and in your panel.php:

PHP Code:
if (!empty($_SSSION['UserName'])) {
//your script here....

10/25/2015 12:59 SkuulCandy#11
You wrote
Code:
if (!empty($_SSSION['UserName'])) {
not SSSESION just SESSION :mofo:
10/30/2015 02:55 DevilOfSun#12
Yaaaay I'm back :D a few days i was banned but now i am back xD
So cause of the ucp, i will use a script what controls login state from HP (And HP Login is InGame Account Login) This way i dont need a 2nd or 3rd login. But how to put a Inventory Clean into Faction Change Script?
10/30/2015 18:49 SkuulCandy#13
You want to clean char's inventory after used fc ?
10/30/2015 21:29 DevilOfSun#14
Yes, only inventory they can put their gears into warehouse. Its only for not let the gear on from light you know ? xD Because i want fc for take their kills and points with them. Not for take gear to other faction you know?
10/31/2015 08:38 wallerus#15
Something like this is what you'd use to delete Gear, Weapons, Accessories and Capes from inventories and warehouse.
Code:
Delete From PS_GameData.dbo.CharItems -- Inventory
Where UserID = @UserID
and Type IN
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,31,32,33,34,35,36,39,40)

Delete From PS_GameData.dbo.UserStoredItems -- Warehouse
Where UserID = @UserID
and Type IN
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,31,32,33,34,35,36,39,40)
I used "IN" so you can easily add or remove item types from the delete query, if you want to delete ALL items, just remove the "and Type IN ..." part of the query.