phpRaider :: Raid Management Made Easy!phpRaider :: Raid Management Made Easy!
  phpRaider :: Raid Management Made Easy!
Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   phpRaider :: Raid Management Made Easy! > Support > General English Support

» Navigation
Main
 » Home
 » Forums
 » FAQ
Information
 » Privacy Policy
Tracker
 » Bugs
 » Tasks
Resources
 » Demonstration
 » Free Hosting
 » v1.x.x Source
» Online Users: 21
0 members and 21 guests
No Members online
Most users ever online was 318, 01-01-2008 at 02:57 AM.
» Stats
Members: 26,997
Threads: 2,194
Posts: 11,339
Top Poster: BoaConstrictor (1,691)
Welcome to our newest member, Cortazzo
Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2009, 04:24 PM
fuxxy fuxxy is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
fuxxy is on a distinguished road
Default Trying to get PhP-Nuke integrated with phpRaider 1.0.8a

Hello Everyone!

I have a guild website running on PhP-Nuke 8.0, and just installed phpRaider 1.0.8a with internal authentication..

I would like to get two things working with my setup:

1) Is there a way to get PhP-Nuke to pass authentication to phpRaider, so my users only have to log in once?

2) Is it possible to have phpRaider post a thread in my PhP-Nuke forums (phpbb2) on a new raid scheduled?


Any questions I'll be happpy to answer..

Thanks in advance

Josh.
Reply With Quote
  #2  
Old 05-11-2009, 04:00 AM
BoaConstrictor BoaConstrictor is offline
Administrator
 
Join Date: Mar 2007
Location: Norway
Posts: 1,691
BoaConstrictor is on a distinguished road
Send a message via MSN to BoaConstrictor
Default

Quote:
Originally Posted by fuxxy View Post
1) Is there a way to get PhP-Nuke to pass authentication to phpRaider, so my users only have to log in once?
Nothing out of the box. Guess your best shot is the auth module made by Vlorn
Quote:
Originally Posted by fuxxy View Post
2) Is it possible to have phpRaider post a thread in my PhP-Nuke forums (phpbb2) on a new raid scheduled?
That's not included out of the box either. Check the mod thread where they're trying to add that to phpRaider.
Reply With Quote
  #3  
Old 05-12-2009, 02:18 PM
fuxxy fuxxy is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
fuxxy is on a distinguished road
Default

Working on PHP-Nuke authentication using the Vlorn module.

I wiped my install of phpraider completely, and removed all the phpraider_* tables from the database

I only have one database containing my Nuke tables as well as the phpraider tables.

I followed the "New Install" instructions, and configured everything correctly (I think)

Upon first attempt to access the actual phpraider page (not the install page, that went fine) I get this error:
Quote:
Error executing SQL statement

Details: SELECT user_email, user_id FROM nukeusers WHERE username='fuxxy' AND user_password='1de5bd9a6458134c72bbae6ecf00f879'

Error: No database selected
Anyone have any suggestions why it's not selecting a database?
Reply With Quote
  #4  
Old 05-12-2009, 04:00 PM
fuxxy fuxxy is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
fuxxy is on a distinguished road
Default

Found one problem. The phpnuke_prefix line in table phpraider_config_auth needs to have the trailing underscore for my database.

I'm still getting the error regarding "no database selected", although the table it's trying to access is correct.
Reply With Quote
  #5  
Old 05-13-2009, 04:21 AM
BoaConstrictor BoaConstrictor is offline
Administrator
 
Join Date: Mar 2007
Location: Norway
Posts: 1,691
BoaConstrictor is on a distinguished road
Send a message via MSN to BoaConstrictor
Default

I think you need to modify the phpNuke.functions.php file.
Change all the queries to add "$pConfig['db_name'].'.'" before the ".$pConfig_auth['phpnuke_prefix']" part of the queries, like this:
Old:
Code:
$sql = "SELECT user_email, user_id FROM ".$pConfig_auth['phpnuke_prefix']."users WHERE username='".$tmpuser."' AND user_password='".$tmppass."'";
new:
Code:
$sql = "SELECT user_email, user_id FROM `".$pConfig['db_name'].'`.`'.$pConfig_auth['phpnuke_prefix']."users` WHERE username='".$tmpuser."' AND user_password='".$tmppass."'";
Repeat on all the other queries and I think it might work.
Reply With Quote
  #6  
Old 05-13-2009, 07:25 AM
fuxxy fuxxy is offline
Junior Member
 
Join Date: Apr 2009
Posts: 4
fuxxy is on a distinguished road
Default

It Works!

Thank you so much BoaConstrictor!

There were three or so lines I had to change, but the end result is exactly as I had hoped.

For those running phpraider 1.0.8a with php-Nuke 8.0, here's the updated phpNuke.functions.php
PHP Code:
<?php


function pLogin() {
    global 
$pConfig_auth;
    
    
// clear menu
    
unset($_SESSION['SMARTYMENU']);
    
    
// handle redirection because we're not using login_form
    
pRedirect($pConfig_auth['login_url']);
    exit;    
}

function 
pLogout() {
    global 
$pConfig_auth;
    
    
// clear menu
    
unset($_SESSION['SMARTYMENU']);
    
//may need some work here need to test -Vlorn
    
pRedirect($pConfig_auth['logout_url']);
    exit;    
}



function 
pVerify($userdata){
    global 
$db_raid,$user_email,$user_pronum,$group_id,$pConfig,$pConfig_auth;
    
$tmpuser $userdata[1];
    
$tmppass $userdata[2];
    
$sql "SELECT user_email, user_id FROM `".$pConfig['db_name'].'`.`'.$pConfig_auth['phpnuke_prefix']."users` WHERE username='".$tmpuser."' AND user_password='".$tmppass."'";
    
$result $db_raid->sql_query($sql) or sqlError($sql);
    
  
  
  
  if((
$db_raid->sql_numrows($result) > 0) && $tmpuser != 'Anonymous'){
        
$data $db_raid->sql_fetchrow($result);
        
$user_email=$data['user_email'];
        
$user_pronum=$data['user_id'];
  
    
//Check for existing proflie
//josh        $sql = sprintf("SELECT * FROM ".$pConfig['db_prefix']."profile WHERE user_email=%s", $db_raid->quote_smart($user_email));
        
$sql sprintf("SELECT * FROM `".$pConfig['db_name'].'`.`'.$pConfig['db_prefix']."profile` WHERE user_email=%s"$db_raid->quote_smart($user_email));
        
$result $db_raid->sql_query($sql) or sqlError($sql);
        
// if nothing returns we need to create profile
        // otherwise they have a profile so let's set their ID
        // we'll just use the phpBB user id as the profile ID to simplify things
        
if(($db_raid->sql_numrows($result) == 0) && $tmpuser != 'Anonymous') {
            
$sql2["SELECT"] = "*";
          
$sql2["FROM"] = "profile";
          
$sql2["WHERE"] = "`profile_id`>0";
      
$check $db_raid->set_query('select'$sql2__FILE____LINE__);

          if(
$db_raid->sql_numrows($check) == 0) {
      
      
// nothing returned, create first profile as superuser
//josh            $sql = sprintf("INSERT INTO ".$pConfig['db_prefix']."profile (`profile_id`, `user_email`, `password`, `group_id`, `username`, `join_date`) VALUES (%s, %s, %s, %s, %s, %s)", $db_raid->quote_smart($user_pronum), $db_raid->quote_smart($user_email), $db_raid->quote_smart(''),$db_raid->quote_smart('1'), $db_raid->quote_smart($tmpuser), $db_raid->quote_smart(time()));
            
$sql sprintf("INSERT INTO `".$pConfig['db_name'].'`.`'.$pConfig['db_prefix']."profile` (`profile_id`, `user_email`, `password`, `group_id`, `username`, `join_date`) VALUES (%s, %s, %s, %s, %s, %s)"$db_raid->quote_smart($user_pronum), $db_raid->quote_smart($user_email), $db_raid->quote_smart(''),$db_raid->quote_smart('1'), $db_raid->quote_smart($tmpuser), $db_raid->quote_smart(time()));
            
$db_raid->sql_query($sql) or sqlError($sql);
            
$_SESSION['group_id'] = '1';
            }else{
      
// Users exsist create profile in default group
//josh      $sql = sprintf("INSERT INTO ".$pConfig['db_prefix']."profile (`profile_id`, `user_email`, `password`, `group_id`, `username`, `join_date`) VALUES (%s, %s, %s, %s, %s, %s)", $db_raid->quote_smart($user_pronum), $db_raid->quote_smart($user_email), $db_raid->quote_smart(''),$db_raid->quote_smart($pConfig['default_group']), $db_raid->quote_smart($tmpuser), $db_raid->quote_smart(time()));
          
$sql sprintf("INSERT INTO `".$pConfig['db_name'].'`.`'.$pConfig['db_prefix']."profile` (`profile_id`, `user_email`, `password`, `group_id`, `username`, `join_date`) VALUES (%s, %s, %s, %s, %s, %s)"$db_raid->quote_smart($user_pronum), $db_raid->quote_smart($user_email), $db_raid->quote_smart(''),$db_raid->quote_smart($pConfig['default_group']), $db_raid->quote_smart($tmpuser), $db_raid->quote_smart(time()));
            
$db_raid->sql_query($sql) or sqlError($sql);
            
$_SESSION['group_id'] = $pConfig['default_group'];
      }
              } else {
            
// profile exists set group
            
$data $db_raid->sql_fetchrow($result);
            
$_SESSION['group_id'] = $data['group_id'];
        }
        return 
true;
    }else{
        return 
false;
    }
}
// setup phpNuke information
define("IN_PHPBB"1);
define("PHPNUKE_INSTALLED"1);
$phpnuke_root_path $pConfig_auth['phpnuke_path'];
include(
$phpnuke_root_path.'config.php');
//include($phpnuke_root_path.'mainfile.php');
// set session defaults
if (isset($_COOKIE['user'])) {
    
// verify profile exists in local db
    
$tmpuserdata explode(":",base64_decode($_COOKIE['user']));
    if(
pVerify($tmpuserdata)){    
        
// setup session information
        
$_SESSION['profile_id'] = $user_pronum;
        
$_SESSION['session_logged_in'] = 1;
        
$_SESSION['username'] = $tmpuserdata['1'];
        
$_SESSION['email'] = $user_email;
        
        
// get timezone setting
    
$sql["SELECT"] = "*";
    
$sql["FROM"] = "profile";
    
$sql["WHERE"] = "`profile_id`>0 AND `profile_id`=$user_pronum";
//    $sql["WHERE"] = " AND `profile_id`={$userdata['user_id']}";
//    $sql["WHERE"] = " AND `profile_id`=$user_pronum";
//    $db_raid->set_query($sql);
$db_raid->set_query('select'$sql__FILE____LINE__);

    
$data $db_raid->fetch();

    
$_SESSION['timezone'] = $data['timezone'];
    
$_SESSION['dst'] = $data['dst'];
    }else{
        
$_SESSION['profile_id'] = -1;
        
$_SESSION['session_logged_in'] = 0;
    }
} else {
    
$_SESSION['profile_id'] = -1;
    
$_SESSION['session_logged_in'] = 0;
}
?>
Reply With Quote
  #7  
Old 01-20-2010, 04:51 AM
Gordaxl Gordaxl is offline
Junior Member
 
Join Date: Jan 2010
Location: Denmark
Posts: 2
Gordaxl is on a distinguished road
Default

Got this working on phpnuke 8.1 patch 3.5 it works like a charm as long as people use IE, it doesnt work with firefox... anyone else experienced this ?? if so how do you fix it ??
Reply With Quote
Reply

Bookmarks

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

Powered by vBadvanced CMPS v3.2.1

All times are GMT -6. The time now is 04:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

© 2006-2008 Kyle Spraggs. All Rights Reserved.Ad Management plugin by RedTyger