We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7012
    • 8 Posts
    I’ve created simple plugin with OnWebLogin system event.

    And it doesn’t work. Webuser logs in but plugin seems to be not executed sad

    If I paste that code into a snippet - it works.



    <?php
    
    // Handle event
    $e = & $modx->Event;
    switch($e->name)
    {
        case "OnWebLogin":
            
    		$ourFileName = "file.txt";		
    		$path = $modx->config['base_path'].$ourFileName;
    		
    		$ourFileHandle = fopen($path, 'w');
    		fclose($ourFileHandle);
            
            break;
    
        case "OnWebLogout":
            // code here
        break;
    
    }
    ?>
    

      -------
      regards
      demagy
      • 22303 MODX Staff
      • 10,725 Posts
      What are you using for web login? The default WebLogin snippet, or WebLoginPE, or what? Did you make sure and register the plugin with the event?
        • 7012
        • 8 Posts
        I’m using WebLogin.

        Yes plugin is registered with the event.
          -------
          regards
          demagy