forked from Spoje-NET/php-abraflexi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetContactAuth.php
More file actions
33 lines (28 loc) · 893 Bytes
/
SetContactAuth.php
File metadata and controls
33 lines (28 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/php -f
<?php
/**
* AbraFlexi - Example how to set up authentification
*
* @author Vítězslav Dvořák <info@vitexsofware.cz>
* @copyright (G) 2017 Vitex Software
*/
namespace Example\AbraFlexi;
include_once './config.php';
include_once '../vendor/autoload.php';
$kontakter = new \AbraFlexi\Kontakt();
$first = $kontakter->getColumnsFromFlexibee(['id'], ['limit' => 1]);
$kontakter->setData([
'id' => $first[0]['id'],
'username' => 'login',
'password' => 'heslo',
// 'password@hash' => 'sha256',
// 'password@salt' => 'osoleno',
'email' => 'example@flexibee.eu',
'poznam' => 'auth']);
$kontakter->insertToFlexiBee();
if ($kontakter->lastResponseCode == 201) {
$kontakter->addStatusMessage('Password set', 'success');
$kontakter->loadFromAbraFlexi();
} else {
$kontakter->addStatusMessage('Password set failed', 'warning');
}