Results 1 to 6 of 6

Thread: Redirect a user to login page if hes trying to submit without loggin in.

  1. #1
    Member
    Join Date
    May 2010
    Posts
    34
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Redirect a user to login page if hes trying to submit without loggin in.

    Well, as the title says..

    I want the user to be redirected to the login page if he's trying to post an article without being logged in instead of displaying the : You do not have permission message.

    Thanks for you help,

    Math

  2. #2
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,859
    Blog Entries
    88
    Thanks
    482
    Thanked 806 Times in 526 Posts

    Default

    But the "Submit" link only shows if he's logged in.

    If you've got a custom Submit button, maybe do something like this:

    PHP Code:
    <?php if ($h->currentUser->loggedIn) { 
        
    $submit_url $h->url(array('page'=>'submit')); /* logged in so send to submit page */
    } else {
        
    $submit_url $h->url(array('page'=>'login')); /* logged out so send to login page */
    }
    ?>

    <a href="<?php echo $submit_url?>">SUBMIT</a>

  3. #3
    Member
    Join Date
    May 2010
    Posts
    34
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default

    I should have precised that this issue is when someone post a link from an external site. If hes not already logged in on MY website, he's going to be redirected to the "You cannot submit" message, which i think, should be the message + logging or registration form.

    What you think?

  4. #4
    Member
    Join Date
    May 2010
    Posts
    34
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default

    After the user log in, he should be redirected to the submit page with the url field filled in.

    Is it complicated to do?

  5. #5
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,859
    Blog Entries
    88
    Thanks
    482
    Thanked 806 Times in 526 Posts

    Default

    Quote Originally Posted by netnuvo View Post
    What you think?
    I see. Okay, I've opened a ticket for it so it will be addressed eventually.

  6. #6
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,859
    Blog Entries
    88
    Thanks
    482
    Thanked 806 Times in 526 Posts

    Default

    Added in Submit 3.0: http://forums.hotarucms.org/showthre...?54-Submit-3.0

    Thanks for bringing it up.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need help desperately : Unable to submit after Submit page1 - 403 error
    By dreamzsiva in forum How-To and Troubleshooting
    Replies: 14
    Last Post: 05-24-2010, 04:04 PM
  2. Can not login
    By ali127 in forum How-To and Troubleshooting
    Replies: 8
    Last Post: 05-15-2010, 09:36 AM
  3. Registered User unable to login
    By angolanmade in forum How-To and Troubleshooting
    Replies: 2
    Last Post: 03-15-2010, 04:03 AM
  4. After Logging-in User is always redirected to the front/home page
    By nothingman in forum How-To and Troubleshooting
    Replies: 2
    Last Post: 12-03-2009, 08:26 AM
  5. Permalinks, Redirect 301 and Link Structure
    By carlo75 in forum How-To and Troubleshooting
    Replies: 9
    Last Post: 10-21-2009, 07:57 AM

Bookmarks

Posting Permissions

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