Jump to content

Mr World

Members
  • Posts

    45
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Mr World

  1. here is the class that communicates with the InvisionAPI. It has been curated to avoid any sensitive info exposed

     

    <?php
    /**
     * Here is the full class that communicates with the InvisionAPI
     * 
     */
    class InvisionAPI {
    
        private static $instance;
    
        public static function getInstance() {
            if (self::$instance == null) {
                self::$instance = new InvisionAPI();
            }
            return self::$instance;
        }
    
        private $settings;
        private $database;
        private $session;
    
        public function __construct() {
            $this->refreshSession();
    
            $this->session  = \IPS\Session\Front::i();
            $this->database = \IPS\Db::i();
            $this->settings = \IPS\Settings::i();
        }
    
        /**
         * Refreshes our IPS session, if we ever had one.
         * Required if for some reason our session has timed out and we have yet to revisit the suite.
         */
        public function refreshSession() {
            $this->requireIPS();
            \IPS\Session\Front::i();
        }
    
        public function isGuest($member) {
            return $member->member_group_id == $this->settings->guest_group;
        }
    
        /**
         * Returns the current logged in user
         * This method is called when I access after login form, it always returns Guest!
         * @return null
         */
        public function getCachedMember() {
            $this->refreshSession();
            $member = \IPS\Member::loggedIn();
           
            if ($this->isGuest($member)) {
                return null;
            }
            return new InvisionMember($member);
        }
    
        public function loadMember($username) {
            $member = \IPS\Member::load($username, 'name');
            if ($this->isGuest($member)) {
                return null;
            }
    
            return $member;
        }
    
        /**
         * This returns true when user/pass is OK so I know it works!
         */
        public function login($username, $password, $rememberMe = false) {
            $member = $this->loadMember($username);
            if ($member == null) {
                return null;
            }
            
            if (!$this->verifyPassword($member, $password)) {
                return false;
            }
            
            $this->setSession($member, $rememberMe);
            return true;
        }
    
        public function logout() {
            $member = $this->getCachedMember();
    
            if ($member == null) {
                return; // We are already logged out
            }
    
            session_destroy();
    
            \IPS\Request::i()->clearLoginCookies();
            $member->memberSync('onLogout', array(\IPS\Http\Url::internal('')));
        }
    
        /**
         * Sets the user session after use has been verified.
         * @param $member
         * @param $rememberMe
         */
        public function setSession($member, $rememberMe) {
            $this->session->setMember($member);
    
            $device = \IPS\Member\Device::loadOrCreate($member);
    
            $member->last_visit = $member->last_activity;
            $member->save();
    
            $device->anonymous = false;
            $device->updateAfterAuthentication($rememberMe, null);
    
            $member->memberSync('onLogin');
            $member->profileSync();
            
            /**
             * If I do a test here, it fails, I get guest!
             * $member = \IPS\Member::loggedIn();
             */
        }
    
     
        public function verifyPassword($member, $password) {
            return password_verify($password, $member->members_pass_hash) === true;
        }
    
    
        private function requireIPS() {
          
            require_once FORUM_PATH . 'init.php';
        }
    
    }

     

  2. A bit of API testing first to know it's working:

    \IPS\Member::load('some_username', 'name'); //works as expected, I get the user
    \IPS\Member::load($member_id, 'member_id'); //works as expected, I get the user

    Authenticating a user via the API:
    $session = \IPS\Session\Front::i();
    $session->setMember($member);
    $member = \IPS\Member::load('username', 'name');
    $device = \IPS\Member\Device::loadOrCreate($member);
    $device->anonymous = false;
    $device->updateAfterAuthentication($rememberMe, null);

    $member->memberSync('onLogin');
    $member->profileSync();

    At this point, if I visit the forum, I see that I am logged in as the user so the authentication works.
    But, if I do a $member = \IPS\Member::loggedIn(); I get guest, regardless if I do the call right after authentication or after page refresh.

    Any idea on what am I missing here?
     

  3. 1 minute ago, Adriano Faria said:

    Disable ALL 3rd-party resources you have and see if it works. If it works, enable one by one and you will see the one causing the error.

    Yesterday you had same error with an outdated resource.

     

    I can't log into the admin control forums to disable it how to disable all plugins via PHP likely in constants or conf_global?

  4. 4 hours ago, Adriano Faria said:

    You are using an outdated version of Links Directory. Version for IPS 4.6 doesn't has this issue.

    You don't even show as purchaser of this app! 🤷‍♀️

    Cause I can't go into upgrade and add the license... 

    4 hours ago, Adriano Faria said:

    You are using an outdated version of Links Directory. Version for IPS 4.6 doesn't has this issue.

    You don't even show as purchaser of this app! 🤷‍♀️

    I uploaded this brand new as well all old files replaced, what to do?

  5. 40 minutes ago, Marc Stridgen said:

    Please would you update your access details on file? We can then get that looked at for you

    home/runesu/public_html/applications/links/sources/Link/Link.php on line 1569, referer: https://runesuite.io/admin/upgrade/?controller=upgrade&key=
    [Wed Sep 29 13:30:06.492184 2021] [:error] [pid 13639:tid 139695933540096] [client 156.146.34.35:57468] PHP Fatal error:  Declaration of IPS\\links\\_Link::contentImages($limit = null) must be compatible with IPS\\Content\\_Item::contentImages($limit = null, $ignorePermissions = false) in /home/runesu/public_html/applications/links/sources/Link/Link.php on line 1569, referer: https://runesuite.io/admin/upgrade/?controller=upgrade&key=

     

     

    Any ideas on this at all?

  6. [Tue Sep 28 13:45:59.307545 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] PHP Fatal error:  Declaration of IPS\\Http\\Url\\cms_hook_FriendlyUrl::setFriendlyUrlData($seoTemplate, $seoTitles, $matchedParams, $friendlyUrlComponent) must be compatible with IPS\\Http\\Url\\_Friendly::setFriendlyUrlData($seoTemplate, $seoTitles, $matchedParams = [], string $friendlyUrlComponent = '') in /home/runesu/public_html/init.php(902) : eval()'d code on line 120
    [Tue Sep 28 13:45:59.307630 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] PHP Fatal error:  Uncaught Error: Class "IPS\\Http\\Url\\Friendly" not found in /home/runesu/public_html/system/Http/Url.php:274
    [Tue Sep 28 13:45:59.307639 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] Stack trace:
    [Tue Sep 28 13:45:59.307678 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #0 /home/runesu/public_html/init.php(902) : eval()'d code(25): IPS\\Http\\_Url::createFromString()
    [Tue Sep 28 13:45:59.307718 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #1 /home/runesu/public_html/system/Request/Request.php(275): IPS\\Http\\cms_hook_Url::createFromString()
    [Tue Sep 28 13:45:59.307754 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #2 /home/runesu/public_html/system/Session/Front.php(363): IPS\\_Request->url()
    [Tue Sep 28 13:45:59.307776 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #3 [internal function]: IPS\\Session\\_Front->write()
    [Tue Sep 28 13:45:59.307797 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #4 [internal function]: session_write_close()
    [Tue Sep 28 13:45:59.307803 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150] #5 {main}
    [Tue Sep 28 13:45:59.307832 2021] [:error] [pid 9096:tid 139755677214464] [client 223.206.220.233:33150]   thrown in /home/runesu/public_html/system/Http/Url.php on line 274

  7. 25 minutes ago, Linux-Is-Best said:

     

    Hello @giovanny castro

    I can see you are upset. No one particularly likes or wishes to experience downtime and general administrative issues. It can be a very frustrating time, especially if you do not know the cause of the problems you are facing or have been provided a possible cause yet have no clue where to begin addressing them. Please be believe when I say 'we have all been there.' After all, everyone starts someplace, somewhere. What can even be more frustrating is when you identify the cause and the solution, and you realize the time it may take to implement a working solution.

     

    I guess my point is, I and I am sure many other people here do sympathize. We have all experienced the rewards of owning and managing our site(s), just as we have experienced how frustrating it can be. But during those more troubling times, it is essential not to lose focus and not direct your frustration toward anyone individual(s). There are people here, both personally and professionally, who wish to help you. Taking out your frustration will not help in that regard.

     

    You said in your reply that the issue is related to SSL. Did you understand what was said and how it was caused? Do you know how to resolve it? If the answer is "no" to either of these questions, perhaps if you share with the community the explained cause, someone can better try to explain things.

    Edit, He has fixed the issue. Awaiting response on what magic he used

  8. 5 minutes ago, Marc Stridgen said:

    We can take a look  at this in your ticket as we go through. Note however this is not related to your issue. Take a look at the list, and you will notice there is actually a 3rd party item which is referenced before each of those. Thats what is causing this particular error. 

     

    Again you aren't even paying attention to the ticket. It clearly is the issue. If you edit the thread I listed in the ticket it causes this exact error. And if you even looked through the applications you would see they are all disabled? I am at 3 days almost 4 days downtime. I can not afford another day. Paying for any useful advice at this point. 

     

    spacer.png

  9. Found the core error 

     

    Error: ErrorException: template_store_missing in /home/dreamsca/public_html/forum/system/Theme/Theme.php:838
    Stack trace:
    #0 /home/dreamsca/public_html/forum/system/Theme/Theme.php(860) : eval()'d code(2522): IPS\_Theme->getTemplate()
    #1 /home/dreamsca/public_html/forum/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_forums_front_topics->postContainer()
    #2 /home/dreamsca/public_html/forum/system/Theme/Theme.php(860) : eval()'d code(4856): IPS\Theme\_SandboxedTemplate->__call()
    #3 /home/dreamsca/public_html/forum/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_forums_front_topics->topic()
    #4 /home/dreamsca/public_html/forum/applications/forums/modules/front/forums/topic.php(459): IPS\Theme\_SandboxedTemplate->__call()
    #5 /home/dreamsca/public_html/forum/system/Dispatcher/Controller.php(101): IPS\forums\modules\front\forums\_topic->manage()
    #6 /home/dreamsca/public_html/forum/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #7 /home/dreamsca/public_html/forum/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
    #8 /home/dreamsca/public_html/forum/system/Dispatcher/Dispatcher.php(152): IPS\forums\modules\front\forums\_topic->execute()
    #9 /home/dreamsca/public_html/forum/index.php(13): IPS\_Dispatcher->run()
    #10 {main} in /home/dreamsca/public_html/forum/system/Theme/SandboxedTemplate.php:65
    Stack trace:
    #0 /home/dreamsca/public_html/forum/system/Theme/Theme.php(860) : eval()'d code(4856): IPS\Theme\_SandboxedTemplate->__call()
    #1 /home/dreamsca/public_html/forum/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_forums_front_topics->topic()
    #2 /home/dreamsca/public_html/forum/applications/forums/modules/front/forums/topic.php(459): IPS\Theme\_SandboxedTemplate->__call()
    #3 /home/dreamsca/public_html/forum/system/Dispatcher/Controller.php(101): IPS\forums\modules\front\forums\_topic->manage()
    #4 /home/dreamsca/public_html/forum/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #5 /home/dreamsca/public_html/forum/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
    #6 /home/dreamsca/public_html/forum/system/Dispatcher/Dispatcher.php(152): IPS\forums\modules\front\forums\_topic->execute()
    #7 /home/dreamsca/public_html/forum/index.php(13): IPS\_Dispatcher->run()
    #8 {main}

     

  10. On 2/6/2021 at 2:55 PM, Linux-Is-Best said:

    Hello giovanny castro

     

    Since you are inquiring about someone from within Invision to review your ongoing site issue personally, it may be best to reach them through ticket support. The community forums here are designed for peer to peer support. I am not suggesting that no one at Invision will see your post, only that usually for faster and direct service support, contacting Invision through the client area is often the way to go. https://www.invisioncommunity.com/clientarea/

     

     

    In the meantime, as a fellow customer who is online, I and others could provide some clues if you noticed any error messages? 

     

    I went through PHP error logs nothing.

    If I do the following;

     

    • Edit a large thread
    • Change the theme
    • Edit the CSS of a theme

     

    This page isn’t working dreamscape317.net didn’t send any data.
    ERR_EMPTY_RESPONSE

    This error happens every time these actions are performed. I have made uploads writable, nothing in error php logs IPS shows this logs, all plugins, app disabled. Importing ISP default theme cause of the 504/520 error it's throwing the theme settings aren't loading (font size/colours and a few others causing the issues)

     

    spacer.png

  11. I have priority support and a high traffic forum. I have waited almost three days for a response. I am at my limit. I think I might move to xenforo this is beyond a joke. 
     

     

    I pretty much represent a huge gaming scene. I know if I moved at least 300 will follow due to the fact they want to follow the biggest. That’s a lot of income to lose for a business. 
     

    if you are listening please help me I can’t afford to lose more downtime. Three days is to much!!!!

×
×
  • Create New...