<?php /* This is a simple test page to test AD authentication */ include "serverapi.php"; if (!isset($_POST['login'])) { $login = ''; $password = ''; $response = "\n"; } else { $login = $_POST["login"]; $password = $_POST["password"]; $props = array("OpenQwaq.AD.Enabled", "OpenQwaq.AD.ServerName", "OpenQwaq.AD.BaseDN", "OpenQwaq.AD.AuthScript"); $props = getServerConfigProperties("localhost", $props); $enabled = $props['OpenQwaq.AD.Enabled']; $server = $props['OpenQwaq.AD.ServerName']; $basedn = $props['OpenQwaq.AD.BaseDN']; $script = $props['OpenQwaq.AD.AuthScript']; $command = $script . ' -s ' . escapeshellarg($server) . ' -b ' . escapeshellarg($basedn) . ' -u ' . escapeshellarg($login) . ' -p ' . escapeshellarg('********') . ' 2>&1 '; if ($enabled != 'true') { $response = "AD Authentication: DISABLED\n"; } else { $response = "AD Authentication: Enabled\n"; } $response = $response . "\nServer: {$server}\nBase DN: {$basedn}\nLogin (UPN): {$login}\nScript: {$script}\n\n{$command}\n\n"; $command = $script . ' -s ' . escapeshellarg($server) . ' -b ' . escapeshellarg($basedn) . ' -u ' . escapeshellarg($login) . ' -p ' . escapeshellarg($password) . ' 2>&1 '; $output = array(); exec($command, $output, $result); if ($result != 0) { $response = $response . "Script failed: Return value: {$result}\n\n"; } $response = $response . htmlspecialchars(implode("\n", $output));
function printFeatureInfo() { @($response = file_get_contents("http://localhost/admin/license.php", 0)); if (!$response) { $response = "Unable to retrieve license file"; } else { try { $features = @new SimpleXMLElement($response); } catch (Exception $e) { // nuttin } } if (!isset($features)) { printFeature("License", false, $response); return; } printFeature("Registered To", true, $features->RegisteredTo); $expressMax = $features->Express; $spMax = $features->ServiceProvider; $routerMax = $features->Router; $appMax = $features->AppServer; $videoMax = $features->VideoServer; $rtspMax = $features->WebcastServer; $expDate = strtotime($features->ContractEndDate); $curDate = strtotime("now"); # Assume license is outdated $valid = false; if ($expDate >= $curDate) { $valid = true; } printFeature("Expiration Date", $valid, date('d M Y', $expDate)); $expressCount = 0; $spCount = 0; $routerCount = 0; $appCount = 0; $videoCount = 0; $rtspCount = 0; foreach (listServers() as $server) { if ($server['status'] == 'active') { switch ($server['role']) { case 'allInOne': $expressCount++; break; case 'spHost': $spCount++; break; case 'routerHost': $routerCount++; break; case 'appHost': $appCount++; break; case 'videoHost': $videoCount++; break; case 'rtspHost': $rtspCount++; break; case 'webcastHost': $rtspCount++; break; } } } $namedSeats = totalUserCount(); $props = getServerConfigProperties('localhost', array("OpenQwaq.AD.Enabled")); $hasAD = $props['OpenQwaq.AD.Enabled'] == 'true'; $roles = array(array("Named Seats", $namedSeats, $features->NamedSeats), array("Express Edition", $expressCount, $expressMax), array("Service Provider", $spCount, $spMax), array("Router / Balancer", $routerCount, $routerMax), array("Application Server", $appCount, $appMax), array("Video Server", $videoCount, $videoMax), array("Webcast Server", $rtspCount, $rtspMax)); foreach ($roles as $role) { if ($role[1] > 0 or $role[2] > 0) { printFeature($role[0], $role[1] <= $role[2], $role[1] . " / " . $role[2]); } } }
<?php include "serverapi.php"; $props = getServerConfigProperties("localhost", array("OpenQwaq.SP.SupportEmail")); $email = $props["OpenQwaq.SP.SupportEmail"]; $hostname = `/bin/hostname`; $hostname = rtrim($hostname); function newDataSet() { return array("logins" => 0, "newForums" => 0, "forums" => array(), "appsLaunched" => 0, "apps" => array(), "webDownloads" => 0, "webUploads" => 0, "maxConcurrentUsers" => 0, "soloTime" => 0, "groupTime" => 0, "meetingCount" => 0, "present" => array()); } function sortByDate($a, $b) { return strcasecmp($a['date'], $b['date']); } function analyzeData($logStart, $logStop) { $forumData = array(); $orgData = array(); $userData = array(); $globalData = newDataSet(); $meetingPlace = array(); $odbc = odbcConnect(); $start = time(); echo "\nCounting Total Users"; flush(); $rs = odbc_exec($odbc, "SELECT count(*) from users"); $count = odbc_result($rs, 1); odbc_close($odbc); $globalData["totalUsers"] = $count; $where = "WHERE ";
function makePropSection($server, $label, $props) { echo "<fieldset><legend>{$label}</legend>"; echo '<table style="border: 0px none ;">'; $values = getServerConfigProperties($server, array_keys($props)); foreach ($props as $key => $name) { $value = $values[$key]; echo "<tr>"; echo "<td width=\"200px\" style=\"background: white ;\">{$name}</td>"; echo "<td style=\"background: white ;\">"; if (stripos($key, "Template") !== False) { // This is an email template field echo "<input type=\"text\" name=\"{$key}\" value=\"{$value}\" size=\"50\" disabled>"; echo " <a href=\"edittemplate.php?server={$server}&key={$key}\">Edit Template</a>"; echo "</td></tr>\n"; continue; } if (stripos($key, ".password") !== False) { // Password field echo "<input type=\"password\" name=\"{$key}\" value=\"{$value}\" size=\"50\">"; echo "</td></tr>\n"; continue; } if ($value == 'true' or $value == 'false') { // Checkbox field $on = $off = ''; if ($value == 'true') { $on = 'selected'; } else { $off = 'selected'; } echo "<select name=\"{$key}\">"; echo "<option value=\"true\" {$on}>Enabled</option>"; echo "<option value=\"false\" {$off}>Disabled</option>"; echo "</select>"; echo "</td></tr>\n"; continue; } // Default text input field echo "<input type=\"text\" name=\"{$key}\" value=\"{$value}\" size=\"50\">"; echo "</td></tr>\n"; } echo "</table><p>\n"; echo "</fieldset>"; }