We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28376
    • 222 Posts
    I have the following snippet below. Currently it gets a user but I was wondering how do i get all the user fields like Name: Address: etc etc
    
    <?php
    header ("Content-Type:text/xml"); 
    
    $rusr="";
    $rpwd="";
    
    $modx->clearCache();
    
    $rusr=$_GET['username'];
    $rpwd=$_GET['password'];
    
    
    function login($username, $password)
    {
       global $modx, $table_prefix;
       $username = $modx->db->escape($username);
       $password = $modx->db->escape($password);
       $table_prefix="modx";
    
       $xmFail="<response>
    <responseCode>0</responseCode>
     <errorCode>103</errorCode>
    <responseText>Access denied</responseText>
    </response>";
    
    $xmSucess="<response>
    <responseCode>1</responseCode>
    <responseText>OK</responseText>
    </response>";
    
     
         $res = $modx->db->select("id", $table_prefix."_web_users", 
          "username='$username' AND password='".$password."'");
    
       if($modx->db->getRecordCount($res))
       {
          return $xmSucess;
       }
       else
       {
           return $xmFail;
       }
    }
    
    
    echo login($rusr,$rpwd);
    ?>