Add page 403 error when not logged in.

Discussion in 'Auto Classifieds Script' started by willylions, Sep 21, 2016.

  1. willylions

    willylions New Member

    Hi, we've noticed that if user is not logged in and goes to add page they get ERROR 403. We were wandering if there's a fix for this. the ideal thing would be a redirection to homepage or better yet to register/sing in page. Has anyone found a workaround for this? Thanks
    boracayblue likes this.
  2. olairmarcos

    olairmarcos Member

    Indeed, this message an impression that the site has errors. A more friendly message would be more beautiful, or a text message that can change the control panel.
    boracayblue, oglasi and willylions like this.
  3. boracayblue

    boracayblue New Member

    Well it has been almost a year. Has anyone solved the puzzle as to how, if a user is not logged in and goes to add page, they can automatically trigger the register/sign in pop-up? Thanks in advance.
  4. boracayblue

    boracayblue New Member

    I have now worked out the solution for this:

    Step 1. Change manage.php so the error instruction instead redirects to a page called 'signintoadd'

    Original
    PHP:

                return iaView::accessDenied;
     
    Change to
    PHP:

                iaUtil::go_to(IA_URL . 'signintoadd/');
     
    Step 2. Create page signintoadd via the admin center (content/pages/add page) and give it the following Page Content
    Toggle 'Source' to add it

    HTML:
    <script>
    window.onload=function(){
    if(document.getElementById('test')!=null||document.getElementById('test')!=""){
    document.getElementById('test').click();
    }
    }
    </script>
    <div class="p-Add">
    <div class="title">
    <h1><small>Please <a data-target="#loginModal" data-toggle="modal" href="#" id="test">Login</a> or <a href="/registration">Register</a></small></h1>
    </div>
    </div>
     
    That's it. I hope you find this useful.
    Dayir_A. likes this.

Share This Page