Coder Social home page Coder Social logo

rcurrington / magento_crossareasessions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astorm/magento_crossareasessions

0.0 2.0 0.0 13 KB

Research module providing a manager for accessing admin sessions from the frontend, and vice/versa.

License: MIT License

PHP 100.00%

magento_crossareasessions's Introduction

Magento Cross Area Sessions

Research module providing a manager for accessing adminhtml sessions from the frontend area, and frontend sessions from the adminhtml area.

Can load from file or database session storage, with a simple "drop in" class for other session types. See files in Model/Loader for examples.

Usage

Grabbing adminhtml or frontend session data from either environment.

$adminhtml  = Mage::getModel('pulsestorm_crossareasession/manager')
->getSessionData('adminhtml'); 

$frontend   = Mage::getModel('pulsestorm_crossareasession/manager')
->getSessionData('frontend'); 

var_dump($adminhtml);
var_dump($frontend);

Checking an admin ACL rule from the frontend.

$manager = Mage::getModel('pulsestorm_crossareasession/manager');
$acl = 'system/cache';
if($manager->checkAdminAclRule($acl))
{
    var_dump("Logged in Admin user can access $acl");
}
else
{
    var_dump("Logged in Admin user can NOT access $acl");
}

Additional Storage Engine Support

Right now only the files and db storage types are supported. If you want to use this with Memcache, reddis, etc. you'll to implement your own loader model.

Implementing a loader model is as easy as dropping a new class in the

app/code/community/Pulsestorm/Crossareasession/Model/

folder, named such that is matches the value in the <session_save/> node. For example, <session_save>files</session_save> is Files.php, <session_save>db</session_save> is Db.php, etc.

A loader object should extend the Pulsestorm_Crossareasession_Model_Loader_Abstract class, and implement the single abstract _load method. The _load method should load the raw, serialized session data and return it as a string.

magento_crossareasessions's People

Contributors

astorm avatar aschrammel avatar francosabolo avatar

Watchers

Ryan Currington avatar James Cloos avatar

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.