Intranet Journal

Go Back   IT Management Forum > Intranet Journal

Intranet Journal The new discussion forum for Intranet Journal readers. Leave comments and questions for IJ authors. Suggest story ideas and provide feedback.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-08-2009, 06:12 PM
q5host q5host is offline
Registered User
 
Join Date: Dec 2009
Posts: 5
Fatal error: Call to undefined method DbConnector::getNumRows()

Fatal error: Call to undefined method DbConnector::getNumRows() I`m getting this error and the last post about that guy dat fixed It doesnt work for me when I`m adding those 2 lines of missing code It`s redirecting me to the failed.php so I`m asking you wots the problem

Fatal error: Call to undefined method DbConnector::getNumRows() in /home/username/public_html/cms/includes/Sentry.php on line 65
Reply With Quote
  #2 (permalink)  
Old 12-08-2009, 06:16 PM
q5host q5host is offline
Registered User
 
Join Date: Dec 2009
Posts: 5
I forgot to add sentry.php code

PHP Code:
<?php
////////////////////////////////////////////////////////////////////////////////////////
// Class: sentry
// Purpose: Control access to pages
///////////////////////////////////////////////////////////////////////////////////////
class sentry {
    
    var
$loggedin = false;    //    Boolean to store whether the user is logged in
    
var $userdata;            //  Array to contain user's data
    
    
function sentry(){
        
session_start();
        
header("Cache-control: private");
    }
    
    
//======================================================================================
    // Log out, destroy session
    
function logout(){
        unset(
$this->userdata);
        
session_destroy();
        return
true;
    }

    
//======================================================================================
    // Log in, and either redirect to goodRedirect or badRedirect depending on success
    
function checkLogin($user = '',$pass = '',$group = 10,$goodRedirect = '',$badRedirect = ''){

        
// Include database and validation classes, and create objects
        
require_once('DbConnector.php');
        require_once(
'Validator.php');
        
$validate = new Validator();
        
$loginConnector = new DbConnector();
        
        
// If user is already logged in then check credentials
        
if ($_SESSION['user'] && $_SESSION['pass']){

            
// Validate session data
            
if (!$validate->validateTextOnly($_SESSION['user'])){return false;}
            if (!
$validate->validateTextOnly($_SESSION['pass'])){return false;}

            
$getUser = $loginConnector->query("SELECT * FROM cmsusers WHERE user = '".$_SESSION['user']."' AND pass = '".$_SESSION['pass']."' AND thegroup <= ".$group.' AND enabled = 1');

            if (
$loginConnector->getNumRows($getUser) > 0){
                
// Existing user ok, continue
                
if ($goodRedirect != '') {
                    
header("Location: ".$goodRedirect."?".strip_tags(session_id())) ;
                }            
                return
true;
            }else{
                
// Existing user not ok, logout
                
$this->logout();
                return
false;
            }
            
        
// User isn't logged in, check credentials
        
}else{    
            
// Validate input
            
if (!$validate->validateTextOnly($user)){return false;}
            if (!
$validate->validateTextOnly($pass)){return false;}

            
// Look up user in DB
            
$getUser = $loginConnector->query("SELECT * FROM cmsusers WHERE user = '$user' AND pass = MD5('$pass')  AND thegroup <= $group AND enabled = 1");
            
$this->userdata = $loginConnector->fetchArray($getUser);

            [
b]if ($loginConnector->getNumRows($getUser) > 0){[/b]
                
// Login OK, store session details
                // Log in
                
$_SESSION["user"] = $user;
                
$_SESSION["pass"] = $this->userdata['pass'];
                
$_SESSION["thegroup"] = $this->userdata['thegroup'];
                                
                if (
$goodRedirect) {
                    
header("Location: ".$goodRedirect."?".strip_tags(session_id())) ;
                }
                return
true;

            }else{
                
// Login BAD
                
unset($this->userdata);
                if (
$badRedirect) {
                    
header("Location: ".$badRedirect) ;
                }        
                return
false;
            }
        }            
    }
}    
?>
Reply With Quote
Reply

Bookmarks

Tags
error , fatal , fatal error , sentry.php , sentry.php on line 65

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 09:17 PM.





Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0