How to access the details of a logged in user












0















Our Society wishes to have some web pages outside Magento (1.9) but on the same web server and to control access to those pages according to the credentials of a person logged in to Magento.



Initially, we would like a page that is only visible to people logged in and belonging to a specific customer group.



Following on from that we would like to be able to control what features appear on a web page according to the person logged in.



On our previous non-e-commerce site the above was achieved by PHP pages that
1. used the logged-in details from phpBB
2. comparison of the logged-in person's id with authorities recorded in a MySQL database.



So I'm happy to write fairly simple things in PHP and SQL (procedural rather than object-oriented approach) but I have no knowledge of the inner workings of Magento.










share|improve this question





























    0















    Our Society wishes to have some web pages outside Magento (1.9) but on the same web server and to control access to those pages according to the credentials of a person logged in to Magento.



    Initially, we would like a page that is only visible to people logged in and belonging to a specific customer group.



    Following on from that we would like to be able to control what features appear on a web page according to the person logged in.



    On our previous non-e-commerce site the above was achieved by PHP pages that
    1. used the logged-in details from phpBB
    2. comparison of the logged-in person's id with authorities recorded in a MySQL database.



    So I'm happy to write fairly simple things in PHP and SQL (procedural rather than object-oriented approach) but I have no knowledge of the inner workings of Magento.










    share|improve this question



























      0












      0








      0








      Our Society wishes to have some web pages outside Magento (1.9) but on the same web server and to control access to those pages according to the credentials of a person logged in to Magento.



      Initially, we would like a page that is only visible to people logged in and belonging to a specific customer group.



      Following on from that we would like to be able to control what features appear on a web page according to the person logged in.



      On our previous non-e-commerce site the above was achieved by PHP pages that
      1. used the logged-in details from phpBB
      2. comparison of the logged-in person's id with authorities recorded in a MySQL database.



      So I'm happy to write fairly simple things in PHP and SQL (procedural rather than object-oriented approach) but I have no knowledge of the inner workings of Magento.










      share|improve this question
















      Our Society wishes to have some web pages outside Magento (1.9) but on the same web server and to control access to those pages according to the credentials of a person logged in to Magento.



      Initially, we would like a page that is only visible to people logged in and belonging to a specific customer group.



      Following on from that we would like to be able to control what features appear on a web page according to the person logged in.



      On our previous non-e-commerce site the above was achieved by PHP pages that
      1. used the logged-in details from phpBB
      2. comparison of the logged-in person's id with authorities recorded in a MySQL database.



      So I'm happy to write fairly simple things in PHP and SQL (procedural rather than object-oriented approach) but I have no knowledge of the inner workings of Magento.







      magento-1.9 customer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago









      Teja Bhagavan Kollepara

      2,94841847




      2,94841847










      asked Nov 22 '18 at 19:20









      Andrew NummelinAndrew Nummelin

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Hope this helps



          <?php
          //Path to your Magento instance relative to your other page
          require_once('./app/Mage.php');
          umask(0);

          Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend'));

          $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

          $customer_data = Mage::getModel('customer/customer')->$session->id;

          if($session->isLoggedIn()){

          } else {

          } ?>





          share|improve this answer


























          • Many thanks - I'm sure I can work with this.

            – Andrew Nummelin
            Nov 24 '18 at 9:44











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251003%2fhow-to-access-the-details-of-a-logged-in-user%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Hope this helps



          <?php
          //Path to your Magento instance relative to your other page
          require_once('./app/Mage.php');
          umask(0);

          Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend'));

          $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

          $customer_data = Mage::getModel('customer/customer')->$session->id;

          if($session->isLoggedIn()){

          } else {

          } ?>





          share|improve this answer


























          • Many thanks - I'm sure I can work with this.

            – Andrew Nummelin
            Nov 24 '18 at 9:44
















          1














          Hope this helps



          <?php
          //Path to your Magento instance relative to your other page
          require_once('./app/Mage.php');
          umask(0);

          Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend'));

          $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

          $customer_data = Mage::getModel('customer/customer')->$session->id;

          if($session->isLoggedIn()){

          } else {

          } ?>





          share|improve this answer


























          • Many thanks - I'm sure I can work with this.

            – Andrew Nummelin
            Nov 24 '18 at 9:44














          1












          1








          1







          Hope this helps



          <?php
          //Path to your Magento instance relative to your other page
          require_once('./app/Mage.php');
          umask(0);

          Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend'));

          $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

          $customer_data = Mage::getModel('customer/customer')->$session->id;

          if($session->isLoggedIn()){

          } else {

          } ?>





          share|improve this answer















          Hope this helps



          <?php
          //Path to your Magento instance relative to your other page
          require_once('./app/Mage.php');
          umask(0);

          Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend'));

          $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

          $customer_data = Mage::getModel('customer/customer')->$session->id;

          if($session->isLoggedIn()){

          } else {

          } ?>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 23 '18 at 3:34









          Haim

          1,180923




          1,180923










          answered Nov 22 '18 at 19:30









          Dava GordonDava Gordon

          61127




          61127













          • Many thanks - I'm sure I can work with this.

            – Andrew Nummelin
            Nov 24 '18 at 9:44



















          • Many thanks - I'm sure I can work with this.

            – Andrew Nummelin
            Nov 24 '18 at 9:44

















          Many thanks - I'm sure I can work with this.

          – Andrew Nummelin
          Nov 24 '18 at 9:44





          Many thanks - I'm sure I can work with this.

          – Andrew Nummelin
          Nov 24 '18 at 9:44


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251003%2fhow-to-access-the-details-of-a-logged-in-user%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What other Star Trek series did the main TNG cast show up in?

          Berlina muro

          Berlina aerponto