MrKampf / proxmoxVE

The is a PHP 8 ProxmoxVe API client. With it you can easily and quickly retrieve information from your Proxmox server or cluster.
GNU General Public License v3.0
51 stars 26 forks source link

Login will always fail? #2

Closed Shade634 closed 4 years ago

Shade634 commented 4 years ago

proxmoxVE/src/proxmox/pve.php line 59, i struggle to understand this logic, its also what breaks the code.

if(is_array($json)){ //Is $json are array throw new AuthenticationException('Can\'t login with this data.'); } if(array_key_exists('data',$json)){//Is key 'data' in array throw new AuthenticationException('Can\'t login with this data.'); } $this->CSRFPreventionToken = $json['data']['CSRFPreventionToken']; //Save the CSRF token in class variable

Basically it says, if array throw error, if not, use array: $json['data']['CSRFPreventionToken'] So it will never get there?

MrKampf commented 4 years ago

Thats old code, i have updated this line on the same day, in front of this if params i forgot are "!". https://github.com/MrKampf/proxmoxVE/blob/master/src/proxmox/pve.php#L59 Have a nice day :-)

Shade634 commented 4 years ago

Is this available trough composer already? :) and thanks for the quick response.

MrKampf commented 4 years ago

I dont know why, but the release hasn't used the code, i have created a new version, in this it's work, sorry for this issue :-).