We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31782
    • 103 Posts
    Tell me, please, php-code which transfer user in a specified group, for example "Premium", and another, back returned user in a common group. The transmitted parameter is the nickname of user. Should be two php-file which will get a third-party service and be on my server.
      • 4172
      • 5,888 Posts
      perhaps this is something you could modify for your needs:
      http://modxcms.com/forums/index.php?topic=33163.0
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 31782
        • 103 Posts
        Thank you Bruno! Now install your module.
        But I need only script in a separate php-file with one parameter (username) who was run to the payment system after receiving the payment from this user.
          • 31782
          • 103 Posts
          I get this error when start the module:

          Warning: require() [function.require]: Unable to access /home/*********/domains/*********.com/public_html/pommo/bootstrap.php in /home/*********/domains/*********.com/public_html/assets/modules/pommoexporter/pommoexporter.php on line 4

          Warning: require(/home/*********/domains/*********.com/public_html/pommo/bootstrap.php) [function.require]: failed to open stream: No such file or directory in /home/*********/domains/*********.com/public_html/assets/modules/pommoexporter/pommoexporter.php on line 4

          Fatal error: require() [function.require]: Failed opening required ’/home/*********/domains/*********.com/public_html/pommo/bootstrap.php’ (include_path=’.:/usr/local/share/pear:/home/*********/domains/*********.com/public_html/manager/includes/’) in /home/*********/domains/*********.com/public_html/assets/modules/pommoexporter/pommoexporter.php on line 4


          But where i can to find the file bootstrap.php?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Well, it’s looking for it in a "pommo" directory in your web root (public_html). Is it there? Does it have permissions that the module code can access it?
              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
              • 31782
              • 103 Posts
              Quote from: sottwell at Mar 13, 2010, 09:17 AM

              Well, it’s looking for it in a "pommo" directory in your web root (public_html). Is it there? Does it have permissions that the module code can access it?
              No, it’s not. I did not know nothing about Pommo service.
                • 31782
                • 103 Posts
                I thought that everything is much easier.
                Service payment run data.php file with the correct nickname (data.php?user=Dr. House).
                The file data.php query to the site database. But I do not know what table and how to determine the user’s group.
                I am not skilled in PHP, excuse me:)
                Please correct the script below for tables MODx.

                <?php
                
                $var = $_GET['user'];
                
                //Send data to DB
                $DBhost = "localhost";
                $DBuser = "****";
                $DBpass = "*****";
                $DBName = "****";
                
                $connect = mysql_connect($DBhost,$DBuser,$DBpass);
                $db = mysql_select_db($DBName,$connect);
                $query = "UPDATE modx_web_users SET group = 'Premium' WHERE username = ".$var;
                $result = mysql_query($query, $connect);
                
                ?>


                  • 4172
                  • 5,888 Posts
                  can everybody run these script and add users with $_GET to your PREMIUM - usergroup?
                  Or how do you secure this script?
                  And where comes these $_GET from?
                  Can you explain in details about what you are after?

                  I think, I would create a snippet and call it on a private modx-resource.


                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 31782
                    • 103 Posts
                    can everybody run these script and add users with $_GET to your PREMIUM - usergroup?
                    Only user subscribe to a site registrator - payment system like ShareIt or Plimus

                    Or how do you secure this script?
                    Yes, this is a problem and I do not know how to solve it.

                    And where comes these $_GET from?
                    From Plimus or ShareIt after payment.
                    This suggests that Plimus:
                    You would have to check if your system/website works with URL posts, here are
                    the details you could use:

                    BuyNow Parameters (to post details to the order page):
                    https://support.plimus.com/html/buynowParameters.html

                    IPN values to be returned to you or your DB after a purchase is completed:
                    https://secure.plimus.com/html/httpNotificationVariable.html

                    Or you could use the following option:
                    -------------------------------------------------------------
                    You can collect all the information (contract ids and quantity) on your site
                    and post it to our server. To do that you will need to create a form (and
                    submit it to our server) as follows:

                    <form action="https://www.plimus.com/jsp/checkout.jsp"
                    method="post">
                    <input type=hidden name=developerId value=AAA>
                    <input type=hidden name=submitAction value="buynow">
                    <input type=hidden name=numberOfContracts value=3>

                    <input type=hidden name=contractId1 value=XXX>
                    <input type=hidden name=quantity1 value=1>

                    <input type=hidden name=contractId2 value=YYY>
                    <input type=hidden name=quantity2 value=2>

                    <input type=hidden name=contractId3 value=ZZZ>
                    <input type=hidden name=quantity3 value=4>
                    </form>

                    Where AAA is your vendor id, XXX, YYY and ZZZ are the contract ids.

                    * Note that you can also post contracts with quantity=0 and it will not be
                    added to the order.
                    * Additional parameters you can post: currency, bCur, couponCode, custom1,
                    custom2, custom3, custom4, custom5

                    And here is a sample script http://home.plimus.com/ecommerce/learning-center/ipn-code-sample

                    Can you explain in details about what you are after?
                    I created a flash app on the FLEX and put it in MODx site. I did that some features of my app access is limited only for users of Premium group. It works fine. Now if a user wants to use the advanced features of my app, he must pay a subscription with help Shareit or Plimus. After payment Registrator runs the script on my server, which transfer user to the Premium group. When payment ends and no subscription renewal, the registrator run another script, which returns the user in the normal group.

                    private modx-resource.

                    What is "private modx-resource"?
                      • 31782
                      • 103 Posts
                      About Security

                      In the example script Plimus only access to the IP of the registrator. It is not enough security?