Example #1
0
function makeGroupMemberTable($gid, $url)
{
    $accounts = findGroupAccountsByGroupId($gid);
    echo '<table cellpadding="0" cellspacing="0" class="alternate">';
    echo "<thead>";
    echo "<tr>\r\n\t<th>Created</th>\r\n\t<th>Member</th> \r\n\t<th>Status</th>\r\n        <th>Action</th>\r\n  </tr>";
    echo '</thead><tbody>';
    echo "<form method=\"POST\" action=\"{$url}?groupid={$gid}\">";
    echo '<tr><td>';
    echo date("Y-m-d");
    echo '</td>';
    echo '<td><table style="border: 0px none ; border-spacing: 5px;"><tr><td style="background: white;">';
    if (totalUserCount() < 9999) {
        echo '<select id="userName" name="userName" style="width: 250px">';
        echo "<option value=\"\">-- Select User --</option>";
        foreach (findAllUserNames() as $name) {
            echo "<option>{$name}</option>\n";
        }
        echo "</select>";
        echo "</select>";
    } else {
        echo '<input type="text" name="userName" class="text">';
    }
    echo '</td><td style="background: white; "></td></tr></table>';
    echo '<td>Invited</td>';
    echo '<td>
           <div class="button">
           <input type="submit" value="Add Member">
           </div>
        </td>';
    echo '</tr></form>';
    foreach ($accounts as $form) {
        $created = explode(" ", $form["created"]);
        $created = $created[0];
        echo "<tr>\n<td>{$created}</td>\n";
        if ($form['type'] == 'user') {
            echo "<td><a href=\"edituser.php?id={$form['userid']}\">{$form['userName']}</a></td>";
        } else {
            echo "<td><a href=\"editgroup.php?id={$form['userid']}\">{$form['userName']} (Group)</a></td>";
        }
        $isInvited = $isActive = $isDeleted = "";
        if ($form['status'] == "Invited") {
            $isInvited = "selected";
        }
        if ($form['status'] == "Active") {
            $isActive = "selected";
        }
        if ($form['status'] == "Deleted") {
            $isDeleted = "selected";
        }
        echo "<td><select id=\"updateStatus\" name=\"updateStatus\" title=\"User Status\">\r\n  \t<option value=\"{$form['id']}|Invited\" {$isInvited}>Invited</option>\r\n  \t<option value=\"{$form['id']}|Active\" {$isActive}>Active</option>\r\n  \t<option value=\"{$form['id']}|Deleted\" {$isDeleted}>Deactivated</option>\r\n\t</select></td>";
        echo "<td>\r\n            <form method=\"POST\" class=\"slimform\" action=\"deleteacct.php?id={$form['id']}&from=group\">\r\n            <div class=\"button\">\r\n            <input type=\"submit\" value=\"Remove Member\">\r\n            </div></form>\r\n         </td>";
        echo "</tr>";
    }
    echo "</tbody>";
    echo "</table>";
}
Example #2
0
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]);
        }
    }
}