Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
45 | public function authenticate(SMTPClient $client): void |
||
46 | { |
||
47 | // NOTE: I don't know if any of this is correct or not - it was ported from somewhere else |
||
48 | |||
49 | $auth_str = sprintf("n,a=%s,%shost=%s%sport=%s%sauth=Bearer %s%s%s", |
||
50 | $this->user, |
||
51 | chr(1), |
||
52 | $this->host, |
||
53 | chr(1), |
||
54 | $this->port, |
||
55 | chr(1), |
||
56 | $this->token, |
||
57 | chr(1), |
||
58 | chr(1) |
||
59 | ); |
||
60 | |||
61 | $auth_str = base64_encode($auth_str); |
||
62 | |||
63 | $client->sendCommand("AUTH OAUTHBEARER {$auth_str}", "235"); |
||
64 | } |
||
66 |