1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

User Signin 1.2

User login and registration

  1. robin007

    robin007 Well-Known Member

    2018-03-11 18_35_37-New message from Hotaru CMS - robinblogspot@gmail.com - Gmail.png
    When i send private message to a user they got email notification with reply link. When they click the link without login they got "page not found" error.

    it could be redirect to login page
    Last edited: Mar 11, 2018
  2. valMETNG

    valMETNG Administrator Staff Member Admin

    There really should be a global function in Hotaru that checks if a login is required before accessing a plugin page. This is a bit of a quick kludge but please add to Hotaru.php after line 3121 (right before the last squiggly bracket):
    public function checkLoggedIn($check_pages = array())
        if (!$check_pages || !isset($this->pageName) || !$this->pageName || !in_array($this->pageName, $check_pages)) { return false; }
        if (!$this->currentUser->loggedIn)
            // determine where to return the user to after logging in:
            if (!$this->cage->get->keyExists('return'))
                $host = $this->cage->server->sanitizeTags('HTTP_HOST');
                $uri = $this->cage->server->sanitizeTags('REQUEST_URI');
                $return = 'http://' . $host . $uri;
                $return = urlencode(htmlentities($return, ENT_QUOTES,'UTF-8'));
            } else // use existing return parameter
            { $return = urlencode($this->cage->get->testUri('return')); }
            header("Location: " . BASEURL . 'index.php?page=login&return=' . $return);
        return true;
    Now you should be able to add the following to the beginning of the function theme_index_top in any plugin which requires the user be logged in before continuing (in your case, add after line 50 of /plugins/messaging/messaging.php), which will check the specified page names and redirect to a login page:
    if (!$h->checkLoggedIn(array('inbox', 'outbox', 'compose', 'show_message'))) { return false; }
    Please let us know if that works for you.
  3. robin007

    robin007 Well-Known Member

  4. robin007

    robin007 Well-Known Member

    Give options to login with username or Email address. If it is secure
    Last edited: Mar 15, 2018

Share This Page