Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
User Login Redirect to Page [Solved]
  • Posted: 09.11.2005, 08:37
     
    jaalex
    rank:
    Freshman Freshman
    registered:
     November 2004
    Status:
    offline
    last visit:
    31.07.08
    Posts:
    33
    Hello everyone,

    I'm working on a new site for our yacht club. But I'm having some problems getting some things to work that I want to. First of all the site is at

    http://www.jasonalexander.us/RYC It protected to keep the spiders out for now so use l:ryc p:yachtclub

    Ok my first question is I'm using the module ContentExpress as my start page to put up some static pages that explain what the club is about. I have a login box on the right side of the page but when people login with either the Members Login page or the login box they get directed to user.php after they authenticate. I 've looked through the archives looking for the correct answer of how to make the news page the default page after login for all users but I can't find the correct answer.

    Thanks
    Jason
  • Posted: 09.11.2005, 11:40
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    the redirect code is in your user.php in your PN root directory.

    You will see something line $main and $op
  • Posted: 09.11.2005, 17:46
     
    jaalex
    rank:
    Freshman Freshman
    registered:
     November 2004
    Status:
    offline
    last visit:
    31.07.08
    Posts:
    33
    I'm not exactly sure which $op to play with. Are you refering to this section of code becuasue that looks like it could be setting the redirect but I'm not sure. My PHP skill are only so so.


    Code

    // set module and op respective to the different cases

    if (!pnUserLoggedIn() && empty($op)) {
        $module = 'User';
        $op = 'getlogin';
    }

    if (isset($op) && ($op == 'userinfo')) {
        $module = 'User';
    }

    if (pnUserLoggedIn() and (empty($op) or ($op == 'adminMain'))) {
        $module = 'User';
        $op = 'main';
    }
  • Posted: 09.11.2005, 22:33
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    Its the third if statment (last).

    Here is an example of how i have it redirect to the users to their profile page:

    Code

    if (pnUserLoggedIn() and (!isset($op) or ($op == 'adminMain'))) {

        pnRedirect(pnModUrl('advProfile', 'user', 'main', array('uname' => $uname)));

        //$module = 'User';
        //$op     = 'main';
    }
  • Posted: 10.11.2005, 06:14
     
    jaalex
    rank:
    Freshman Freshman
    registered:
     November 2004
    Status:
    offline
    last visit:
    31.07.08
    Posts:
    33
    Very good. Thank you for the pointer. The pnRedirect function works very well.

    Jason
  • Posted: 18.11.2005, 16:04
     
    woodentigger
    rank:
    Freshman Freshman
    registered:
     March 2005
    Status:
    offline
    last visit:
    18.11.05
    Posts:
    13
    Hi i read the posts with interest as I want to redirect the user to the MyAccount and on logout to a page in the root of the site called index.html.

    the code is slightly different being: -

    // New module way
    // $module / $op control
    if (pnUserLoggedIn() and (!isset($op) or ($op == 'adminMain'))) {
    $module = 'NS-User';
    $op = 'user';

    How do I
    A)get on logout the site to load index.html
    B alter this line correctly (in the login block) to redirect to the user.php page (My Account) Currently I have it commeted out (which works)

    // get the current uri so we can return the user to the correct place
    $path = pnGetCurrentURI(what is the syntax I place in here?);

    I figured that this is the code in the NS_User user.php file that logs the user out, not sure how to edit it, to point the user to index.html

    function user_user_logout($var)
    {
    pnUserLogOut();

    redirect_index(_YOUARELOGGEDOUT);
    }


    Any asssistance would be greatly appreciated

    Many Thanks

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula