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

    I read the snippet docs from here, but didi saw any way to register in two steps :

    • the webuser does the registration process and validates,
    • the admin receives a message and he must go to backend to validates the pending registration
    • the webuser receives the password and acknowledgment..


    afaik the registration looks like being instantaneous and cannot be controled ..am I wrong ??

    How the make a registration first agreed by an admin ?

    Thank you

    ps: most of the links into the doc pages leads now to svn.modxcms.com
    but many are dead (?!)
      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      I think that you’d have to write some custom code to make the WebLoginPE Snippet do what you want, but there may be another way....

      On one site I’m working on, we actually use the eForm Snippet to create a user sign-up request form. It sends an email to the site manager, who then adds that user to the database using the manager control panel, and then the manager chooses to have MODx generate the password and email it to the person. It’s a bit time intensive for the site administrator, but it’s a good way to maintain oversight -- no unwanted users are allowed access. For this particular web site, we only anticipate about 100 users, so this solution makes sense. Maybe it could work for you?
        • 4310
        • 2,310 Posts
        You could set the user to be blocked and then notify the admin by email.
        Around line 641 in webloginpe.class.php change from :
        $newUserAttr = "INSERT INTO ".$web_user_attributes.
        		" (internalKey, fullname, email, phone, mobilephone, dob, gender, country, state, zip, fax, photo, comment) VALUES".
        		" ('".$key."', '".$fullname."', '".$email."', '".$phone."', '".$mobilephone."', '".$dob."', '".$gender."', '".$country."', '".$state."', '".$zip."', '".$fax."', '".$photo."', '".$comment."')";
        		$insertUserAttr = $modx->db->query($newUserAttr);
        

        to :
        $newUserAttr = "INSERT INTO ".$web_user_attributes.
        		" (internalKey, fullname, email, phone, mobilephone, dob, gender, country, state, zip, fax, photo, comment, blocked) VALUES".
        		" ('".$key."', '".$fullname."', '".$email."', '".$phone."', '".$mobilephone."', '".$dob."', '".$gender."', '".$country."', '".$state."', '".$zip."', '".$fax."', '".$photo."', '".$comment."', '1')";
        		$insertUserAttr = $modx->db->query($newUserAttr);
        
          • 8790
          • 526 Posts
          Thnak you,

          looks like real professional solution are still needing specific work.

          Asking for an account is quit not serious instead the whole process manage it. Workflow is the key, so the right way would probably be something part of what Bunk58’ said.

          Let the user register himself a blocked account and send a warning to an admin for validation.

          But here there’s 2 pb,
          one, this first email should not be send to the the webuser, but only to the admin. The webuser must receive another mail saying the account is reviewed or something.

          And 2, a module should take care of the rest of the process where the admin must activate, or not ,through it, and such an action would automaticaly send back the right email to the webuser.
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don't pay attention
            http://www.dzi-neo.net
            • 4310
            • 2,310 Posts
            For problem one, just change the Web Signup email via Tools => Configuration => User to say "your request for an account is being reviewed"
            Problem two may require a core hack or better still, a plugin to detect the change of the blocked status from 1 to 0 to trigger an email.