Results 1 to 5 of 5

Thread: Require user to sign-in to see details

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Lightbulb Require user to sign-in to see details

    toward the bottom of detail.php change
    Code:
    $title = str_replace("<%link_title%>",$link_title,$title);
    
    DisplayTemplate($theme_path."header.html","\$title,\$cat");
    to the following
    Code:
    $title = str_replace("<%link_title%>",$link_title,$title);
    
    $users_obj = new clsUsers;
    $users_obj->InitDB($dbServer,$dbHostname,$dbUsername,$dbPassword,$dbName);
    $users_obj->table_name = "idx_users";
    
    if(!$users_obj->GetUserAuthentication()==0){
            $back_url = urlencode("detail.php?id=$id");
        header("Location: login.php?f=1&b=$back_url");
      }
    DisplayTemplate($theme_path."header.html","\$title,\$cat");
    Last edited by esm; 08-02-2003 at 03:30 PM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #2
    Join Date
    May 2002
    Location
    Brisbane Australia
    Posts
    7

    Default

    esm

    have added your code to detailed.php

    I'm getting the following error now
    Fatal error: Call to a member function on a non-object in ********/*****/****/******/lib/category.class.php on line 309
    after leaving the login page.

    If i stay login and try again calling the detailed page it works, so it seems its losing the id field or something when it goes via the log on page.

    Any ideas ???

    Add

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    can you show me line 309 of the lib/category.class.php file...
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  4. #4
    Join Date
    May 2002
    Location
    Brisbane Australia
    Posts
    7

    Default

    esm

    305 // read name and parent_id
    306 $query = "select parent_id, name from $this->table_name
    where category_id=$cat";
    307 $result = $this->db_connect->Execute($query);
    308
    309 $parent_id = $result->Fields("parent_id");
    310 $name = $result->Fields("name");

    Add
    Last edited by addumb; 08-02-2003 at 10:04 AM.

  5. #5
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    I have made a change to the $back_url

    Code:
        
    $back_url = urlencode("detail.php?id=$id");
    let me know how that works
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Requiring User in Add.php
    By esm in forum v3.2
    Replies: 9
    Last Post: 07-18-2004, 02:09 PM
  2. Replies: 11
    Last Post: 07-18-2004, 04:54 AM
  3. looking up user during add process
    By esm in forum v5.x
    Replies: 3
    Last Post: 06-18-2003, 10:27 PM
  4. User login problem
    By webmasterjr in forum v5.x
    Replies: 3
    Last Post: 12-16-2002, 06:03 AM
  5. User CP questions ???
    By ideavirus in forum v5.x
    Replies: 3
    Last Post: 07-14-2002, 07:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •