forked from exrat/logoff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
25 lines (20 loc) · 758 Bytes
/
init.php
File metadata and controls
25 lines (20 loc) · 758 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
<?php
eval(FileUtil::getPluginConf("logoff")); // update to work with ruTorrent > 4.x
$me = User::getUser(); // update to work with ruTorrent > 4.x
$users = array();
$dirs = scandir($rootPath . "/share/users/");
if ($dirs && count($dirs) > 0)
foreach ($dirs as $dir)
if ($dir[0] != "." && $dir != $me)
$users[] = $dir;
$allowed = 0;
foreach (explode(",", $allowSwitch) as $as)
if (trim($as) == $me)
$allowed = 1;
$jResult .= "plugin.logoffURL = '" . $logoffURL . "';";
$jResult .= "plugin.me = '" . $me . "';";
$jResult .= "plugin.users = " . json_encode($users) . ";";
$jResult .= "plugin.allowSwitch = " . $allowed . ";";
$jResult .= "plugin.abortMs = " . $abortMs . ";";
$theSettings->registerPlugin("logoff");
?>