mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
rename sso test script
This commit is contained in:
parent
a103d9d79e
commit
ae414e9bc5
1 changed files with 0 additions and 0 deletions
26
example-sso-kerberos.php
Normal file
26
example-sso-kerberos.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use Icewind\SMB\KerberosTicket;
|
||||
|
||||
require('vendor/autoload.php');
|
||||
|
||||
if (php_sapi_name() == "cli") {
|
||||
echo "Note: this example shouldn't be called from cli as it expects apache to setup the keberos ticket\n";
|
||||
}
|
||||
|
||||
// dfs paths not working
|
||||
$host = 'krb.domain.test';
|
||||
$share = 'netlogon';
|
||||
|
||||
$auth = new \Icewind\SMB\KerberosAuth();
|
||||
$auth->setTicket(KerberosTicket::fromEnv());
|
||||
$serverFactory = new \Icewind\SMB\ServerFactory();
|
||||
|
||||
$server = $serverFactory->createServer($host, $auth);
|
||||
|
||||
$share = $server->getShare($share);
|
||||
|
||||
$files = $share->dir('/');
|
||||
foreach ($files as $file) {
|
||||
echo $file->getName() . "\n";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue