Giter Club home page Giter Club logo

Comments (8)

sollidius avatar sollidius commented on September 24, 2024

I noticed it not working at the moment due to cookies.
Would it be possible if I would let it set cookies for all domains at once? Like with a setcookie.php file and add HTML to get setcookie.php from all domains?

from userapplepie-v4.

davarravad avatar davarravad commented on September 24, 2024

I have not tested this personally. I do use virtual hosts to host many different sites that run UAP. Just never the same install. I am guessing if it does not work by default, that it would be in the cookie settings to do so. Let me take a look and see if I see anything.

from userapplepie-v4.

davarravad avatar davarravad commented on September 24, 2024

Looking at the cookie file, maybe if you remove the domain var from it. I will give it a try and let you know if it still works.

https://github.com/UserApplePie/UserApplePie-v4/blob/master/app/System/Libraries/Auth/Cookie.php

from userapplepie-v4.

davarravad avatar davarravad commented on September 24, 2024

I tested this code on the demo site and it still worked. All I did was removed the domain vars. Try and out and let me know if it works. If not we will come up with a solution together.

Cookie.php location: app/System/Libraries/Auth/Cookie.php

<?php
/**
 * Auth Cookie Class
 *
 * UserApplePie
 * @author David (DaVaR) Sargent <[email protected]>
 * @version 4.0.0
 *
 * @author Jhobanny Morillo <[email protected]>
 */

namespace Libs\Auth;

class Cookie {

    public static function exists($key) {
        if (isset($_COOKIE[$key])) {
            return true;
        } else {
            return false;
        }
    }

    public static function set($key, $value, $expiry = "", $path = "/") {
        $retval = false;
        if (!headers_sent()) {

            $retval = @setcookie($key, $value, $expiry, $path);
            if ($retval)
                $_COOKIE[$key] = $value;
        }
        return $retval;
    }

    public static function get($key, $default = '') {
        return (isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default);
    }

    public static function display() {
        return $_COOKIE;
    }

    public static function destroy($key, $value = '', $path = "/") {
        if (isset($_COOKIE[$key])) {
            unset($_COOKIE[$key]);
            setcookie($key, $value, time() - 3600, $path);
        }
    }

}

from userapplepie-v4.

sollidius avatar sollidius commented on September 24, 2024

hmmm.
I tried changing the file like this.
But after I login, it says "Success! You Have Successfully Logged In!". But apparently it logs me out automatically, because the user dropdown isn't shown and it asks for the login again. This happens on both domains now.

But another solution I'm open to is: copying over all files
so /var/www/UAP1
and /var/www/UAP2
And let them connect to the same database.
That should be possible right?
Can i install UAP2 and just follow the instructions from the auto installer, or would that wipe the existing database?

from userapplepie-v4.

sollidius avatar sollidius commented on September 24, 2024

Installed it in 2 subfolders now.
Had to install modcloudflare to get the real IP address cause it was conflicting.
Now I can login on both sites with the same username/password. However, when I log in to SITE1 it auto logs me out of SITE2.

Would there be an easy fix, like where i copy over the session table.
So SITE1 uses uap4_session
and SITE2 uses uap4_session2
and SITE3 uses uap4_session3 etc
and then edit the auth script to check in the correct table?
so they share the whole database, except the session table. Or would that still have issues when validating ?

from userapplepie-v4.

sollidius avatar sollidius commented on September 24, 2024

Okay so I tried doing this. went into the second folder and changed all "PREFIX"sessions to "PREFIX"sessions2 and edited app/system/libraries/auth addIntoDB("sessions2...) as well.
I can confirm, it works to be logged in on both sites simultaneously. You do need to login twice (1x per site), but the rest works without issues :)
Knowing this, I can continue implementing my current tools into UAP.
PS: good job. I really like it. Just need to figure a bit out how the homepage content stuff works, since I never actually use Libraries from others and use plain PHP code.
Also nice dashboard stats, you're not the only one who likes those ;)
However, it multiplies them by 5 by default (cause of .css and .js etc). So perhaps add a setting to let the dashboard show the logs amount devided by X or make something so .css and .js files aren't counted in the pageviews?

from userapplepie-v4.

davarravad avatar davarravad commented on September 24, 2024

Thanks I will look in to the stats. I will have more time to work on it soon.

I need to get the docs done. I keep putting it off. Lol

from userapplepie-v4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.