We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    Quote from: Konsum at Aug 17, 2007, 03:58 PM

    What about adding a field to easily insert custom Terms of use? A user should need to accept the Terms upon registering.
    Excellent Point!
    I totally agree and I think this will should end up in the default registration template.

    Thanks Konsum,

    -sD-
    Dr. Scotty Delicious, Scientist.
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
    • Bravo!

      Ideally, this param would accept doc_id or chunk name, else ignore. The "I Accept" checkbox should be either [pre|app]ended to the user defined agreement copy by WebLoginPE maybe?

      Also, upon reviewing the code in webloginpe.snippet.php, there doesn’t seem to be any error checking for the following:

      [*] Mis-typed or missing chunks (if a user defines a tpl chunk that doesn’t exist, WebLoginPE doesn’t seem to account for this [at least fall back on default TPLs?] )

      	$displayRegisterTpl = isset($registerTpl) ? $modx->getChunk($registerTpl) : $wlpeRegisterTpl;
      


      If
      $modx->getChunk()
      fails as a result of missing chunk, $displayRegisterTpl remains empty... ( this goes for all chunks )

      [*] Language file for non-English ("en") - It doesn’t appear there is error checking for the existence of the corresponding language file.

      	$lang = isset($lang) ? $lang : 'en';
      
      	include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php';
      


      I would recommend use of
      file_exists()
      function and error notification or at least falling back on the default ("en")
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 26435
        • 1,193 Posts
        Quote from: pixelchutes at Aug 17, 2007, 07:23 PM

        Bravo!

        Ideally, this param would accept doc_id or chunk name, else ignore. The "I Accept" checkbox should be either [pre|app]ended to the user defined agreement copy by WebLoginPE maybe?

        Also, upon reviewing the code in webloginpe.snippet.php, there doesn’t seem to be any error checking for the following:

        [*] Mis-typed or missing chunks (if a user defines a tpl chunk that doesn’t exist, WebLoginPE doesn’t seem to account for this [at least fall back on default TPLs?] )

        	$displayRegisterTpl = isset($registerTpl) ? $modx->getChunk($registerTpl) : $wlpeRegisterTpl;
        


        If
        $modx->getChunk()
        fails as a result of missing chunk, $displayRegisterTpl remains empty... ( this goes for all chunks )
        Nice catch! Looks like i need to wrap those in if blocks, unless you have a more efficient way of checking all the chunks to verify existence

        Quote from: pixelchutes at Aug 17, 2007, 07:23 PM

        [*] Language file for non-English ("en") - It doesn’t appear there is error checking for the existence of the corresponding language file.

        	$lang = isset($lang) ? $lang : 'en';
        
        	include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php';
        


        I would recommend use of
        file_exists()
        function and error notification or at least falling back on the default ("en")
        Oops, now that was just stupid of me. I had this snippet all ready to be shared before I realized I had hard coded, language specific strings in both the class and the snippet. the last thing I did before I uploaded this to the repository was strip out those strings and put them in a language file. I totally missed this sloppy error. thank you pixelchutes. I will implement your file_exists suggestion.

        -sD-
        Dr. Scotty Delicious, Scientist DFPA.
          Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
          All of the above... in no specific order.


          I send pointless little messages
        • Well, I am pretty sure that if a getChunk call fails, the resulting value of $displayRegisterTpl would be "" (empty)

          Of course you could just check if it’s empty and then re-map to default value. Through a nested tertiary if clause you could do this in one line smiley
            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 26435
            • 1,193 Posts
            I have updated this snippet to version 1.0.1
            Get it in the MODx Repository.

            Change Log:
            08/19/2007 v. 1.0.1
            1. Added parameter &regRequired to specify required input fields by name attribute.
            2. Added sanity checks for chunk templates.
            3. Added file_exists check for language file. Falls back to English (default) if language file is not found.
            4. Added a cookie for persistent login. can be a checkbox named "rememberme" or a select named "stayloggedin".

            08/14/2007 v. 1.0
            1. Initial Public Release.

            TODO.
            1. Fix DOB and Last Login so the unset value is not the UNIX epoch.
            2. Add TOS agreement which can now be set as "REQUIRED" with the new &regRequired parameter.

            We’ll see about finishing those tomorrow, I just forgot about them and didn’t remember until after I posted the update and looked at this thread again.

            -sD-
            Dr. Scotty Delicious, Scientist DFPA.
              Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
              All of the above... in no specific order.


              I send pointless little messages
              • 10449
              • 956 Posts
              Looks great!
                • 26435
                • 1,193 Posts
                There is an updated version (1.0.2) in the MODx Repository
                Full Documentation is attached to the first post of this thread.

                08/20/2007 v. 1.0.2
                1. Added parameter &notify to specify email addresses to be notified of new user registrations.
                2. Added parameter &notifyTpl to specify notification email message body.
                3. Added parameter &notifySubject to specify notification email subject line.
                4. Converted all PHP mail() function calls to use the PHPMailer class included with MODx.
                5. Added "Terms of Service" agreement and checkbox to the default instant registration template.
                6. Fixed placeholders [+user.dob+] and [+user.lastlogin+]. If they are empty or "0", the placeholder is set to "Unknown".
                7. Fixed the Instant Login Form so that if there is an error, the fields are filled with the $_POST values so the user doesn’t have to fill in all the fields again.

                http://www.bennadel.com/index.cfm?dax=coldfusion.privacypolicy will help you create a TOS/Privacy Policy for your own website.

                I think that takes care of all the feature requests I had so far.
                Please keep the suggestions coming.

                -sD-
                Dr. Scotty Delicious, Scientist DFPA.

                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 4095
                  • 372 Posts
                  Thanks Scotty, sounds like a great Snippet.

                  Tried to install it but got the following error.... prob something I did (didn’t) do, but got any suggestions?

                  Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/**********/**********/html/assets/snippets/webloginpe/webloginpe.class.php on line 20
                  
                  Fatal error: Cannot instantiate non-existent class: webloginpe in /home/**********/**********/html/manager/includes/document.parser.class.inc.php(748) : eval()'d code on line 58
                    [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                    Admin Sandbox Login: sandbox Password: castle
                    • 26435
                    • 1,193 Posts
                    Quote from: Briggsy at Aug 20, 2007, 11:07 PM

                    Thanks Scotty, sounds like a great Snippet.

                    Tried to install it but got the following error.... prob something I did (didn’t) do, but got any suggestions?
                    It looks like maybe you are trying to run it on PHP 4.x. WebLoginPE will only run under php5 or above.

                    -sD-
                    Dr. Scotty Delicious, Scientist DFPA.

                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 4095
                      • 372 Posts
                      Ahhh, that would be the reason = PHP Version 4.3.2
                        [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                        Admin Sandbox Login: sandbox Password: castle