How do I log in my user into mechbunny when using it behind strongbox?
Posted by Konrad Piwowar, Last modified by Konrad Piwowar on 01 November 2018 02:06 PM

To make mechbunny login users automatically (when installing behind strongbox), you must apply the following code changes:

Place this code in admin/functions.custom.php (on older versions place it in admin/db.php near the top after the mysql_connect() part):

if(!$_SESSION[userid]) {
    $thisUser = mysql_real_escape_string($_SERVER[PHP_AUTH_USER]);
    $checkUser = mysql_query("SELECT * FROM users WHERE username = '$thisUser'");
    if(mysql_num_rows($checkUser) > 0) {
        $checkRow = mysql_fetch_array($checkUser);
        $_SESSION[userid] = $checkRow[record_num];
        $_SESSION[username] = $checkRow[username];
    else {
        mysql_query("INSERT INTO users (username, password) VALUES ('$thisUser','asdfasdf')");
        $_SESSION[userid] = mysql_insert_id();
        $_SESSION[username] = $thisUser;

Configuration parameters to work with strongbox (admin/config.php):

$basehttp = ''; //base http path
$mediadomain = '/media'; //lighttpd install domain, usually
$thumb_url = $mediadomain.'/thumbs'; //url to $thumb_path
$video_url = $mediadomain.'/videos'; //url to $flv_path
$ad_url = $mediadomain.'/ads'; //url to $flv_path
$misc_url = $mediadomain.'/misc'; //url to $misc_path
$gallery_url = $mediadomain.'/galleries'; //url to $gallery_path

(2 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).