Example #1
0
}
while ($logdata = $sql->fetch_array()) {
    print "<tr>";
    print "<td>" . $logdata["timestamp"] . "</td>";
    if ($logdata["activity"] == "1") {
        print "<td>" . idtoadmin($logdata["adminid"]) . " added " . $logdata["data"] . " (userid: " . $logdata["userid"] . ")</td>";
    }
    if ($logdata["activity"] == "2") {
        print "<td>" . idtoadmin($logdata["adminid"]) . " edited " . $logdata["data"] . " (userid: " . $logdata["userid"] . ")</td>";
    }
    if ($logdata["activity"] == "3") {
        print "<td>" . idtoadmin($logdata["adminid"]) . " deleted " . $logdata["data"] . " (userid: " . $logdata["userid"] . ")</td>";
    }
    if ($logdata["activity"] == "4") {
        print "<td>" . idtoadmin($logdata["adminid"]) . " enabled " . $logdata["data"] . " (userid: " . $logdata["userid"] . ")</td>";
    }
    if ($logdata["activity"] == "5") {
        print "<td><" . idtoadmin($logdata["adminid"]) . " disabled " . $logdata["data"] . " (userid: " . $logdata["userid"] . ")</td>";
    }
    print "</tr>";
}
mysqli_close($mysqli);
?>
				</tbody>
			</table>
		</div>
		<div class="control-group">
			<div class="controls">
			</div>
		</div>
	</form>
Example #2
0
function expusrcsv($usrgrp)
{
    if (file_exists("config.php")) {
        require "config.php";
    } else {
        require "../config.php";
    }
    $csvout = "";
    $profvalues = "";
    $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
    if (isset($usrgrp) && $usrgrp != "") {
        $usql = $mysqli->query("SELECT * FROM users WHERE usrgroup='" . $usrgrp . "'");
    } else {
        $usql = $mysqli->query("SELECT * FROM users");
    }
    while ($usrdata = $usql->fetch_array()) {
        $profiles = "";
        if ($usrdata["profiles"] == "") {
            $profiles = "";
        } else {
            $dbprof = unserialize($usrdata["profiles"]);
            if ($dbprof != "" && $dbprof != "N;") {
                foreach ($dbprof as $useprof) {
                    $psql = $mysqli->query("SELECT cspvalue FROM profiles WHERE id='" . $useprof . "'");
                    $profdata = $psql->fetch_array();
                    $profvalues .= $profdata["cspvalue"] . " ";
                }
                $profiles = trim($profvalues);
                $profdata = "";
                $profvalues = "";
            } else {
                $profiles = "";
            }
        }
        if ($usrdata["comment"] != "") {
            $comment = str_replace("\n", " ", $usrdata["comment"]);
            $comment = str_replace("\r", " ", $comment);
            $comment = preg_replace("/\\s+/", " ", $comment);
        } else {
            $comment = $usrdata["comment"];
        }
        $csvout .= $usrdata["user"] . ";" . $usrdata["password"] . ";" . $usrdata["displayname"] . ";" . $usrdata["ipmask"] . ";" . $profiles . ";" . $usrdata["maxconn"] . ";" . $usrdata["admin"] . ";" . $usrdata["enabled"] . ";" . $usrdata["mapexclude"] . ";" . $usrdata["debug"] . ";" . $comment . ";" . $usrdata["email"] . ";" . htmlspecialchars($usrdata["customvalues"]) . ";" . $usrdata["ecmrate"] . ";" . $usrdata["startdate"] . ";" . $usrdata["expiredate"] . ";" . idtogrp($usrdata["usrgroup"]) . ";" . $usrdata["boxtype"] . ";" . $usrdata["macaddress"] . ";" . $usrdata["serialnumber"] . ";" . $usrdata["added"] . ";" . idtoadmin($usrdata["addedby"]) . ";" . $usrdata["changed"] . ";" . idtoadmin($usrdata["changedby"]) . ";\n";
    }
    mysqli_close($mysqli);
    return trim($csvout);
}
Example #3
0
?>
										</div>
									</div>
								</div>
								<div class="span5">
									<div class="control-group">
										<div class="controls">
											Last changed: <?php 
if ($usrres["changed"] != "0000-00-00 00:00:00") {
    print $usrres["changed"];
}
?>
												<br>
											Last changed by: <?php 
if ($usrres["changedby"] != "") {
    print idtoadmin($usrres["changedby"]);
}
?>
										</div>
									</div>
								</div>
							</div>
						</form>
							<button class="btn" name="bedit" value="Save" onclick="checkeditusername();">Save</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php 
require "includes/footer.php";
Example #4
0
 $usrexp = checkstartexpire($res["startdate"], $res["expiredate"], $res["enabled"]);
 print "<tr>";
 if ($res["admin"] == "1") {
     print "<td>" . $res["user"] . " <span class=\"label label-warning\">A</span></td>";
 } else {
     print "<td>" . $res["user"] . "</td>";
 }
 print "<td>" . $res["displayname"] . "</td>";
 if ($setres["extrausrtbl"] == "1") {
     print "<td>" . $res["password"] . "</td>";
 } elseif ($setres["extrausrtbl"] == "2") {
     print "<td>" . printdate($res["startdate"]) . "</td>";
 } elseif ($setres["extrausrtbl"] == "3") {
     print "<td>" . printdate($res["expiredate"]) . "</td>";
 } elseif ($setres["extrausrtbl"] == "4") {
     print "<td>" . idtoadmin($res["addedby"]) . "</td>";
 }
 print "<td>" . idtogrp($res["usrgroup"]) . "</td>";
 if ($usrexp == "0") {
     print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-important\">Disabled</span></div></a></td>";
 } elseif ($usrexp == "1") {
     print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"disableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-success\">Enabled</span></div></a></td>";
 } elseif ($usrexp == "2") {
     print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-warning\">Not Started</span></div></a></td>";
 } elseif ($usrexp == "3") {
     print "<td><a id=\"usrlnkenabled-" . $res["id"] . "\" href=\"javascript:void(0);\" onclick=\"enableuser('" . $res["id"] . "','" . $_SESSION[$secretkey . "userlvl"] . "','" . $_SESSION[$secretkey . "usergrp"] . "','" . $_SESSION[$secretkey . "userid"] . "');\"><div id=\"usrenabled-" . $res["id"] . "\"><span class=\"label label-warning\">Expired</span></div></a></td>";
 } else {
     print "<td></td>";
 }
 if ($_SESSION[$secretkey . "fetchcsp"] == "1" && $cspconnstatus == "1") {
     if (isset($cspuserlist[$res["user"]])) {