We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32241
    • 1,495 Posts
    Guys, I’ve been working on some web user API for our current MODx system. Any input to this will be great. I haven’t tested the code yet, but if somebhody willing to help me out with testing this code and improving this, it will be awesome.

    Thanks
    PS: Sorry for pasting the code in the forum wink
      Wendy Novianto
      [font=Verdana]PT DJAMOER Technology Media
      [font=Verdana]Xituz Media
    • What type of feedback are you looking for?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 32241
        • 1,495 Posts
        I haven’t test the code yet, so anybody willing to do this for me will be great. There might be some problem with the code as well, because I haven’t run this yet, but if someone could point that out for me, that will save me a lot of time.

        Right now I’m working on having a user interface for this, build on top of this class. So before using the API, if it’s being improved, it will be a lot faster for me to do the rest of the front user interface administration page.

        Thanks Ryan
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
        • Ehhh... what all spefically should it allow us to do?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 32241
            • 1,495 Posts
            It’s more to the coder advantage, by having a more public/centralize API in managing web users, then we can easily create a new system based on web user group without having any problem.

            For now I will use this API to include more a graphical interface for administration on the front end, but later I will also include this API on my phorum module integration, which required a more abstraction to acess MODx web user data.

            Hopefully I can finish up with the front interface by tomorow laugh
              Wendy Novianto
              [font=Verdana]PT DJAMOER Technology Media
              [font=Verdana]Xituz Media
            • Thanks Wendy for the clarification. smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 33393
                • 30 Posts
                Excuse my lack of knowledge on this, but could you extend the document parser class (at least that’s where I think those functions are) and use the insert, update, delete etc. within a user management class?

                ### Sorry Wendy, I just started reading the class file, you are using $modx->dbquery etc. I wasn’t sure if that would work without extending the class... (just learning php).
                  "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
                  • 32241
                  • 1,495 Posts
                  Yep, good guess. You won’t be able to use this class without running it inside MODx system.Basically $modx is a public variable, it’s not declared inside a class or function I believe. So if you call this as a snippet/module/plugin inside MODx, then global $modx will actually return the one from modx. So this class can be use on those three form.

                  FYI, I might need to start creating my library classes, but for this class I do really need to use the invoke event to enabled plugin compatibility on MODx. (Time to take a note on that)

                  Thanks for clarifying it for other users zatoichi. (are you from Japan?)
                    Wendy Novianto
                    [font=Verdana]PT DJAMOER Technology Media
                    [font=Verdana]Xituz Media
                    • 33393
                    • 30 Posts
                    Quote from: Djamoer at Feb 07, 2006, 02:27 PM

                    Thanks for clarifying it for other users zatoichi. (are you from Japan?)

                    Nope. I just really like Shintarô Katsu as the Blind Swordsman, Zatoichi. http://www.imdb.com/title/tt0202152/
                      "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
                    • If you want to use it in an external script, you just need to define the mode, include the /manager/includes/config.inc.php file, then the manager/includes/document.parser.class.inc.php file, then create a new instance of $modx, $modx = new DocumentParser(). See the root index.php file for an example of this. Then you have access to all of the $modx variables and functions, as well as the SESSION variable..

                      define("IN_PARSER_MODE", "true");   // or IN_MANAGER MODE if it's an addon for the manager
                      include_once "manager/includes/config.inc.php";
                      startCMSSession(); 
                      include_once($base_path."/manager/includes/document.parser.class.inc.php");
                      $modx = new DocumentParser;
                      


                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org