-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
27 lines (23 loc) · 842 Bytes
/
index.php
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
<?php
require_once dirname(__DIR__).'/gitlabber/vendor/autoload.php';
error_reporting(E_ALL);
ini_set("display_errors", 1);
// api User
//var_dump($client->api('users')->me());
if(isset($_GET['u']) && isset($_GET['p'])){
$accessToken = '';
$apiUrl = '';
$client = new \Gitlab\Client($apiUrl); // change here
$client->authenticate($accessToken, \Gitlab\Client::AUTH_URL_TOKEN); // change here
try{
$loggedInUser = $client->api('users')->login((string)$_GET['u'], (string)$_GET['p'], (string)$_GET['u']);
echo "<pre>";
var_dump($loggedInUser);
echo "</pre>";
}catch (Exception $exception){
echo 'Fehler: ', $exception->getMessage(), "\n";
//var_dump($exception);
}
}else {
echo "please add ?u=username&p=password";
}