XenAPI - XenForo PHP REST API

XenAPI - XenForo PHP REST API 1.4.2

No permission to download
Im having a strange issue with the API where account confirmation emails are not being sent to users who I register using the 'register' action.

I know emails are working fine since they are sent via SendGrid and there are no logs of a message getting send, also other emails (such as test emails) work fine.

I should also note that the emails are received when I register a user directly via the site itself.

Any thoughts/feedback to a solution would be appreciated,

Thanks!
 
Im having a strange issue with the API where account confirmation emails are not being sent to users who I register using the 'register' action.

I know emails are working fine since they are sent via SendGrid and there are no logs of a message getting send, also other emails (such as test emails) work fine.

I should also note that the emails are received when I register a user directly via the site itself.

Any thoughts/feedback to a solution would be appreciated,

Thanks!
I'll do some testing when I get home tonight, I can't recall if I implemented that or not, I'll get back to you later tonight.
 
Ah thats a shame, it probably would involve storage but wouldn't xenforo have to do that anyway when they are uploaded?
Of course, but I have always prefered not to allow remote resources (like storing an image). If something breaks and someone uploads a PHP shell, that'd be my fault.

Either way, I'll take a look when I have some time, could you open an issue on GitHub for it?
 
Of course, but I have always prefered not to allow remote resources (like storing an image). If something breaks and someone uploads a PHP shell, that'd be my fault.

Either way, I'll take a look when I have some time, could you open an issue on GitHub for it?
Yeah sure thanks!
 
You should always encode the parameters before sending a http request. See urlencode() if you're using PHP.
Im not using php, i'm using C#. I tried System.Web.HttpUtility.UrlEncode and it doesn't seem to work.
edit:managed to get around it by sending the password to a php file to be encoded and use that encoded password for the api
 
Last edited:
@Contex Any chance of making an auth for email/password?
That should already be possible?

PHP:
/**
* Returns the User class of the $input parameter.
*
* The $input parameter can be an user ID, username or e-mail.
* Returns FALSE if $input is NULL.
*/
public function getUser($input, $fetchOptions = array()) {
    if (!empty($fetchOptions['custom_field'])) {
        $results = $this->getDatabase()->fetchRow("SELECT `user_id` FROM `xf_user_field_value` WHERE `field_id` = '" . $fetchOptions['custom_field'] . "' AND `field_value` = '$input'");
        if (!empty($results['user_id'])) {
            $input = $results['user_id'];
        }
    }
    if ($input == FALSE || $input == NULL) {
        return FALSE;
    } else if (is_numeric($input)) {
        // $input is a number, grab the user by an ID.
        $user = new User($this->models, $this->models->getUserModel()->getUserById($input, $fetchOptions));
        if (!$user->isRegistered()) {
            // The user ID was not found, grabbing the user by the username instead.
            $user = new User($this->models, $this->models->getUserModel()->getUserByName($input, $fetchOptions));
        }
    } else if ($this->models->getUserModel()->couldBeEmail($input)) {
        // $input is an e-mail, return the user of the e-mail.
        $user = new User($this->models, $this->models->getUserModel()->getUserByEmail($input, $fetchOptions));
    } else {
        // $input is an username, return the user of the username.
        $user = new User($this->models, $this->models->getUserModel()->getUserByName($input, $fetchOptions));
    }
    if ($user->isRegistered()) {
        $this->getModels()->checkModel('user_field', XenForo_Model::create('XenForo_Model_UserField'));
        $user->data['custom_fields'] = $this->getModels()->getModel('user_field')->getUserFieldValues($user->getID());
    }
    return $user;
}
 
Hello,

any (stupid?) question:

I use the AppGini database generator to create certain mysql based tables. At this time every user have to register on every table site new.

Can we with your addon the things made easy and use on the external AppGini pages the authentication (logged in oder off) from xenforo so the members dont have to register new?
And if thats possible - is there a demo to look?

Regards
 
Top Bottom