We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10190
    • 187 Posts
    Hello,

    I’ve implemented the WebLoginPE snippet (1.3.0) in my modx 0.9.6.1

    At first sight everything looks fine, but if I try to register a new user, I get the followining error:

    Fatal error: Call to undefined function: issuccess() in /var/www/MODx-0.9.1/manager/includes/document.parser.class.inc.php(745) : eval()’d code on line 65

    I don’t know what’s inside the eval’d code, but as far as can see it (by using grep) the function should maybe be called with an capital S: isSuccess()?

    I found such named funktions in scriptacolous and the mootools, but don’t know if this is connected to webloginpe’s ajax functions?

    Can anyone help me getting webloginpe running?

    Cheers
    Frisco
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      PHP automatically converts function names to lowercase. The eval()d code is the snippet or plugin that’s being run at that moment, so if you look in the snippet at that line number you’ll see the error. This means that something is wrong with your paths, and the main webloginpe snippet can’t find its library functions.
        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
        • 10190
        • 187 Posts
        Hi Susan,

        thanks for your answer. I tried to track the error down with the help you provided, but I can’t figure it out completly. Maybe you could help me again?

        I put echo __LINE__; print_r($pluginCode); // Frisco

        in manager/includes/document.parser.class.inc.php, to see what is eval’d, as I couldn’t find s.th. in the webloginpe files. I also looked at my configuration for wrong path’s, but it looks well, and everything else works fine.

        A look in the manager showed me, that all webusers were registered, so the error message seems to be wrong, it works. Now the question remains, why the error is raised.

        "Grep -iR issuccess *" and the print_r($pluginCode); show me, that isSuccess() seems to belong to a Gallery module I use (Gallery2 for Menalto Gallery). This module offers possibilities to import and export users, which could have s.th. to do with the registration process of webloginpe.

        The output of $pluginCode (only the last part) is:

        744/** * Gallery Plugin for MODx * Written by Raymond Irving, Sept 2005 * Modyfied by Hisanori Muramoto, Feb, 2007 * Integrates Gallery2 with MODx * * Events: * OnWebChangePassword,OnWebDeleteUser,OnWebSaveUser,OnWebLogout * * Version: 1.1 * */ $e = &$modx->event; # build mod path $modpath = $modx->config["base_path"].($mpth ? $mpth:"assets/modules/gallery/"); # include main class include_once $modpath."g2cms.base.class.inc.php"; $g2base = new G2CMS_Base(); // include Gallery API require_once($g2base->g2Path.'embed.php'); $ret = GalleryEmbed::init(array( 'embedUri' => $g2base->embedUri, 'g2Uri' => $g2base->g2Uri, 'activeUserId' => $modx->getLoginUserName() )); if ($ret) { $modx->logEvent(0,2,$ret->getAsHtml(),'Gallery'); exit; } // Event switch switch($e->name) { case "OnWebLogout": $ret = GalleryEmbed::logout(array( 'embedUri' => $g2base->embedUri, 'embedPath' => $g2base->embedPath )); if ($ret) { $modx->logEvent(0,2,$ret->getAsHtml(),'Gallery'); exit; } break; case "OnWebSaveUser": $uid = $username; $args = array( 'username' => $username, 'fullname' => $userfullname, 'email' => $useremail, 'hashmethod' => 'md5', 'hashedpassword' => md5($userpassword) ); if($mode=="new") { $ret = GalleryEmbed::createUser($uid,$args); if (!$ret->isSuccess()) { $modx->logEvent(0,2,"Unable to create Gallery user account ($username)
        
        ".$ret->getAsHtml(),"Gallery"); } } else if($mode=="upd"){ $uid=($oldusername ? $oldusername:$username); if(GalleryEmbed::isExternalIdMapped($uid,'GalleryUser')==null) { $ret = GalleryEmbed::updateUser($uid,$args); if (!$ret->isSuccess()) { $modx->logEvent(0,2,"Unable to update Gallery user account ($username)
        
        ".$ret->getAsHtml(),"Gallery"); } } } break; case "OnWebChangePassword": if(GalleryEmbed::isExternalIdMapped($username,'GalleryUser')==null) { $ret = GalleryEmbed::updateUser($username,array( 'username'=>$username, 'password'=>$userpassword, )); if (!$ret->isSuccess()) { $modx->logEvent(0,2,"Unable to update Gallery user ($username) password
        
        ".$ret->getAsHtml(),"Gallery"); } } break; case "OnWebDeleteUser": if(strpos(strtolower($ondel),'delete')!==false) {; if(GalleryEmbed::isExternalIdMapped($username,'GalleryUser')==null) { $ret = GalleryEmbed::deleteUser($username); if (!$ret->isSuccess()) { $modx->logEvent(0,2,"Unable to update Gallery user ($username) password
        
        ".$ret->getAsHtml(),"Gallery"); } } } break; default: return; break; }
        Fatal error: Call to undefined function: issuccess() in /var/www/modx/manager/includes/document.parser.class.inc.php(746) : eval()'d code on line 65
        


        This is all related to Gallery, not to webloginpe at all.

        But seems to be interconnected anyhow.

        Any clues?

        Cheers
        Frisco
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sorry, I’ve no idea. I’ve never used the Gallery module, and I don’t have that much experience digging in the WebLoginPE internals either. Could it be some kind of conflict in function names, that the Gallery snippet being run for that page thinks the WebLoginPE snippet function is for it? Or vice versa...
            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
            • 10190
            • 187 Posts
            Hi Susan,

            yes, I was thinking of conflicts with namespaces too, as I find it kind of strange that Gallery plugin code is eval’d while using webloginpe.

            The gallery module is separate and only used on one, special subside - at least I thought so.

            Maybe Scotty could help as the author of the webloginpe snippet?

            Cheers
            Frisco