Results 1 to 12 of 12

Thread: Require user to sign-in to add link

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

    Default Require user to sign-in to add link

    In the add.php file down toward the bottom and just after

    Code:
    // --------------
    //  main program
    // --------------
    add the following:

    Code:
    // mod
    $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("add.php?cat=$cat");
        header("Location: login.php?f=1&b=$back_url");
      }
    Last edited by esm; 06-18-2003 at 03:25 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 2003
    Posts
    69

    Default

    What file is being modified here?

    Lordkinjo
    Lordkinjo

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

    Default

    ooops , I changed the original to show the file ( add.php )
    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 2003
    Posts
    69

    Default

    hmmm It works...
    But they still will receive 2 different passwords. One when they are forced to sign up and one when their link is approved.
    Also since it is a force register you may want to modify the login page to say. No Account? Register here...with a link to register.php.

    Did you already work out the 1 account thing on your other post? That part will probably have to be done before this add.php mod is made...

    How'd it work for you?

    Lordkinjo
    Lordkinjo

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

    Default

    Originally posted by lordkinjo
    hmmm It works...
    How'd it work for you?

    Lordkinjo
    but of course it works

    but seriously, I only test it for my situation and there are lots of different situations out there. so it good to see that others are able to get it to work.

    it's working ok except I need make a modification to convert the email/username from the idx_user table to lowercase (or convert it to lowercase when the user registers) and I need to get the username from somewhere (environment variable, etc ) so I can pass the username and email to add_from.html to automatically populate those fields ( and make them non-readable probably ).

    I think what you want is here: http://www.nicecoder.com/community/s...&threadid=1411
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  6. #6
    Join Date
    Feb 2004
    Posts
    49

    Default Re: Require user to sign-in to add link

    Originally posted by esm
    In the add.php file down toward the bottom and just after

    Code:
    // --------------
    //  main program
    // --------------
    add the following:

    Code:
    // mod
    $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("add.php?cat=$cat");
        header("Location: login.php?f=1&b=$back_url");
      }
    I did exactly as you advised and when I tried to add a link, it does require me to login but after I click LOGIN, it always arrive at NOT ALLOWED page regardless the category is "editor's permission required" or "no permission required". Anything you missed stating here?

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

    Default Re: Re: Require user to sign-in to add link

    are you in the category that you want to add the link?
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  8. #8
    Join Date
    Feb 2004
    Posts
    49

    Default

    Yes, I am in the very category that I want the link to be added. And, the I have confirmed that this category is configured to add links without requiring permission. Any idea why it doesn't work for me?

  9. #9
    Join Date
    Feb 2004
    Posts
    49

    Default

    Found the problem, ESM. Just need to rearrange the sequence of the codes.

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

    Default

    glad it works for you
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  11. #11
    Join Date
    Feb 2004
    Posts
    49

    Default

    Hi ESM,

    Can you look at the other post that you responded earlier?

    http://www.nicecoder.com/community/s...1&goto=newpost

    Thanks!

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

    Default

    yep, I looked at it...
    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: 4
    Last Post: 08-02-2003, 03:32 PM
  3. INDEXU FEATURES
    By Hart_House in forum Pre-Sales Questions
    Replies: 13
    Last Post: 06-30-2003, 11:57 AM
  4. User login problem
    By webmasterjr in forum v5.x
    Replies: 3
    Last Post: 12-16-2002, 06:03 AM
  5. Replies: 0
    Last Post: 08-29-2001, 07:31 PM

Posting Permissions

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