@@ -39,7 +39,7 @@ class PVE2_API {
39
39
protected $ login_ticket_timestamp = null ;
40
40
protected $ cluster_node_list = null ;
41
41
42
- public function __construct ($ hostname , $ username , $ realm , $ password , $ tokenid , $ tokensecret , $ port = 8006 , $ verify_ssl = false ) {
42
+ public function __construct ($ hostname , $ username , $ realm , $ password , $ port = 8006 , $ verify_ssl = false , $ tokenid = null , $ tokensecret = null , ) {
43
43
if ((empty ($ hostname ) || empty ($ realm )) || (empty ($ username ) && empty ($ password ) && empty ($ tokenid ) && empty ($ tokensecret )) || empty ($ port )) {
44
44
throw new PVE2_Exception ("Hostname/Realm and either Username/Password or TokenId/TokenSecret are required for PVE2_API object constructor. " , 1 );
45
45
}
@@ -56,14 +56,14 @@ public function __construct ($hostname, $username, $realm, $password, $tokenid,
56
56
throw new PVE2_Exception ("verify_ssl must be boolean. " , 7 );
57
57
}
58
58
59
- $ this ->hostname = $ hostname ;
60
- $ this ->username = $ username ;
61
- $ this ->realm = $ realm ;
62
- $ this ->tokenid = $ tokenid ;
63
- $ this ->tokensecret = $ tokensecret ;
64
- $ this ->password = $ password ;
65
- $ this ->port = $ port ;
66
- $ this ->verify_ssl = $ verify_ssl ;
59
+ $ this ->hostname = $ hostname ;
60
+ $ this ->username = $ username ;
61
+ $ this ->realm = $ realm ;
62
+ $ this ->tokenid = $ tokenid ;
63
+ $ this ->tokensecret = $ tokensecret ;
64
+ $ this ->password = $ password ;
65
+ $ this ->port = $ port ;
66
+ $ this ->verify_ssl = $ verify_ssl ;
67
67
// Check if we have a tokenid and tokensecret, if so, we can use API token access.
68
68
if (!empty ($ tokenid ) && !empty ($ tokensecret )) {
69
69
$ this ->api_token_access = true ;
0 commit comments