Raised This Month: $12 Target: $400
 3% 

Release Donation Control 3.1.0 [over 1000 donations served!]


Post New Thread Reply   
 
Thread Tools Display Modes
Veksi8
Junior Member
Join Date: Apr 2017
Old 05-07-2017 , 13:58   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #671

I cant compile that file idk why?
https://gyazo.com/c446f9d80e985d3e276d23f18a761e83

Last edited by Veksi8; 05-07-2017 at 14:19.
Veksi8 is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-12-2017 , 16:36   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #672

Quote:
Originally Posted by DaRk56 View Post
Read my post ..
I Can not get this to work. It said incorrect Username or Password. I am just now setting this up for the first time. I have setup a few other panels for Sourcemod in the past before.

I setup a Server Group in SourceBans called ServerOwner. I gave my SourceBans account a secure password.

I made the changes you said to make.

Snippet of my Config.php

Code:
<?php

/*
 * Donations Database info
 */

define('DB_HOST', 'localhost');        //set MySQL host
define('DB_USER', 'myusername');             //MySQL username
define('DB_PASS', 'mysupersecurepass');         //MySQL password
define('DONATIONS_DB', 'donations');   //donations database




/*
 * Sourcebans info
 * Sourcebans is required as of 2.x.
 */

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
define('SB_DB', true); //ONLY SET TRUE IF SOURCEBANS IS ON A DIFFERENT MYSQL SERVER
define('SB_SV_HOST', 'localhost');      //set MySQL host ONLY NEEDED IF SOURCEBANS IS ON A DIFFERENT MYSQL SERVER
define('SB_SV_USER', 'myuserename');         //MySQL username ONLY NEEDED IF SOURCEBANS IS ON A DIFFERENT MYSQL SERVER
define('SB_SV_PASS', 'mysecurepassword');       //MySQL password ONLY NEEDED IF SOURCEBANS IS ON A DIFFERENT MYSQL SERVER
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
define('SOURCEBANS_DB', 'sourcebans'); // sourcebans database, this is needed.
define('SB_PREFIX', 'sb'); //Sourcebans database prefix. Only change this value if you changed your database prefix when setting up SourceBans.
//define('SB_SALT', 'SourceBans'); //dont change this unless you changed your salt in sourcebans (if you dont know what salt is, you didnt change it)
define('SB_NEW_SALT', '$5$'); // New Salt 1.6.0 Sourcebans ++  
define('SB_ADMINS', 'ServerOwner'); //name of admin group in sourcebans which has access to the donor panel
///////////////////////////////////////////////////////////////////////////////////////////

Last edited by TrappaTroopa; 05-12-2017 at 18:06.
TrappaTroopa is offline
DaRk56
Senior Member
Join Date: Jul 2009
Location: France
Old 05-14-2017 , 04:31   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #673

Try it (Admin/index.php)
Do you have a database, where are they separated?

PHP Code:
<?php
if (isset($_POST['loginSubmit'])) {
    
define('NineteenEleven'TRUE);
    require_once 
'../includes/config.php';
    require_once 
ABSDIR 'includes/LoggerClass.php';
    
$log = new log;
    
$user_name $_POST['user_name'];
    
//$password = sha1(sha1(SB_SALT . $_POST['password']));
    
$password crypt($_POST['password'], SB_NEW_SALT);


    try {
        
$db = new PDO('mysql:host=' DB_HOST ';dbname=' SOURCEBANS_DB ';charset=utf8mb4'SB_USERSB_PASS);
        
$db->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
        
$db->setAttribute(PDO::ATTR_EMULATE_PREPARESfalse);
    } catch (
Exception $e) {
        die(
'Unable to open connection to MySQL server.');
    }

    try {
        
$stmt $db->prepare("SELECT * FROM " SB_PREFIX "_admins WHERE user=? and password=? and srv_group = '" SB_ADMINS "';");
        
$stmt->execute(array($user_name$password));
        
$row $stmt->fetchAll(PDO::FETCH_ASSOC);
    } catch (
Exception $e) {
        echo 
"<h3>Something went wrong with our system.</h3>";
        
$log->logError($ex->getMessage(), $ex->getFile(), $ex->getLine());
    }
    
$count count($row);
    if (
$count === 1) {
        
$email $row[0]['email'];
        
session_start();
        
$_SESSION['username'] = $user_name;
        
$_SESSION['email'] = $email;
        
$_SESSION['table'] = false;
        
ini_set('default_socket_timeout'10);
        
$json = @json_decode(@file_get_contents('http://1911.expert/dc-version/version.php'));

        if (!empty(
$json) && VERSION_NEW != $json->version) {

            
$_SESSION['message'] = "<div class='alert alert-warning' role='alert'>There is an update available. ";

            if (isset(
$json->msg)) {
                
$_SESSION['message'] .= $json->msg;
            }
            
$_SESSION['message'] .= "</div>";
        }
        print(
"<center><h1 class = 'success'> Welcome back $user_name </h1></center>");
        
$log->logAction("$user_name logged in from " $_SERVER['REMOTE_ADDR']);
        print(
"<script type = 'text/javascript'> setTimeout('reload()', 1000)
                function reload(){
                window.location = 'show_donations.php'
                }</script>"
);
        exit();
    } else {
        print 
"<center><h1 class='error'>Wrong Username or Password</h1></center>";
        
$log->logAction("Failed login attempt for user name: $user_name from " $_SERVER['REMOTE_ADDR']);
    }
}
?>
<div id='login'>
    <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr>
        <form id="loginSubmit" method="POST" action="index.php">
            <td>
                <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                        <td colspan="3"><strong>Admin Login </strong></td>
                    </tr>
                    <tr>
                        <td width="78">Username</td>
                        <td width="6">:</td>
                        <td width="294"><input name="user_name" type="text" id="user_name"></td>
                    </tr>
                    <tr>
                        <td>Password</td>
                        <td>:</td>
                        <td><input name="password" type="password" id="password"></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td><input type="submit" name="loginSubmit" value="Login" form='loginSubmit' /><input type='button' id='hideLogin' value='Cancel' /></td>

                    </tr>
                </table>
            </td>
        </form>
        </tr>
    </table>
</div>

Last edited by DaRk56; 05-14-2017 at 04:32.
DaRk56 is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-14-2017 , 09:47   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #674

Quote:
Originally Posted by DaRk56 View Post
Try it (Admin/index.php)
Do you have a database, where are they separated?
I tried your code. Did not solve my issue unfortunately. See the Screenshot. Same SQL Server. Separate DBs
Attached Images
File Type: jpg phpmyadmin DB.JPG (52.0 KB, 210 views)
TrappaTroopa is offline
DaRk56
Senior Member
Join Date: Jul 2009
Location: France
Old 05-14-2017 , 10:47   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #675

What do you have in the logs? admin / logs
DaRk56 is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-14-2017 , 11:24   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #676

Quote:
Originally Posted by DaRk56 View Post
What do you have in the logs? admin / logs
logs directory is empty.
TrappaTroopa is offline
DaRk56
Senior Member
Join Date: Jul 2009
Location: France
Old 05-14-2017 , 11:37   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #677

Directory chmod 755 and files 644.
Retry login admin.

And look at the logs again

Last edited by DaRk56; 05-14-2017 at 11:37.
DaRk56 is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 05-14-2017 , 17:14   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #678

Quote:
Originally Posted by DaRk56 View Post
Directory chmod 755 and files 644.
Retry login admin.

And look at the logs again
K I just did that. No logs still.
TrappaTroopa is offline
CenT
Senior Member
Join Date: Aug 2009
Location: FRANCE
Old 05-15-2017 , 15:15   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #679

error log webserver ?
CenT is offline
LeetDonkey
Member
Join Date: Dec 2014
Old 05-16-2017 , 03:40   Re: Donation Control 3.1.0 [over 1000 donations served!]
Reply With Quote #680

Remember to grab the full salt from the config.php of sourcebans and not just $5$

For example in sourcebans config.php:
Code:
define('SB_NEW_SALT', '$5$blablabla');
LeetDonkey is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode