Example #1
0
<?php

if (include "login.php") {
    $importBase = array_read_key("importBase", $_GET, false);
    if (in_array($importBase, $config->IMPORT_BASES) && file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "import" . DIRECTORY_SEPARATOR . $importBase . ".php")) {
        include dirname(__FILE__) . DIRECTORY_SEPARATOR . "import" . DIRECTORY_SEPARATOR . $importBase . ".php";
    } else {
        $temp->content .= "<h1>Choose import base</h1><ul>";
        foreach ($config->IMPORT_BASES as $importName => $importBase) {
            $temp->content .= "<li><a href=\"?action=import&importBase=" . $temp->html($importBase) . "\">" . $temp->html($importName) . "</a></li>";
        }
    }
}
Example #2
0
$temp->addScript("/kkjs/modules/kkjs.load.js?modules=parser,date,table", false, true);
$temp->addScript("currentTimestamp.js", true, true);
$temp->addScript("csvFile.js", true, true);
$temp->addScript("enableTableColumnModifications.js", true, true);
$db = DB::getInstance();
$db->setAttribute(DB::ATTR_ERRMODE, DB::ERRMODE_EXCEPTION);
// $ldap = LDAP::createFromConfigFile(new ConfigFile("ldapConfig.ini", true));
$config = new ConfigFile("config.ini", true);
$class = array_read_key("class", $_POST, false);
if ($class === false) {
    $class = array_read_key("class", $_GET, false);
}
if (!in_array($class, $config->DB_ITEMS)) {
    $class = false;
}
$action = array_read_key("action", $_GET, false);
if (!in_array($action, $config->ACTIONS) && !in_array($action, $config->HIDDEN_ACTIONS)) {
    $action = $config->DEFAULT_ACTION;
    if (!$class) {
        $class = $config->DEFAULT_CLASS;
    }
}
if (in_array($action, $config->CLASS_ACTIONS) && $class === false) {
    include "./actions/chooseClass.php";
} else {
    if (is_file("./actions/" . $action . ".php")) {
        include "./actions/" . $action . ".php";
    }
}
include "./navigation.php";
$temp->write();
Example #3
0
<?php

/*
 * Checks if the user is logged in or performs a loggin at the moment
 *
 * returns true if a user is logged in and false if not
 */
/* @var $ldap LDAP */
return true;
if ($ldap->isBound()) {
    $ldap->cd("cn=users,");
    $userID = array_read_key("userID", $_SESSION, false);
    $username = array_read_key("username", $_POST, "");
    $password = array_read_key("password", $_POST, "");
    $user = false;
    if ($userID) {
        $user = $ldap->getUserById($userID);
    } else {
        if ($username) {
            $searchName = preg_replace("/^.*\\\\/", "", $username);
            if (strpos($username, "@") === false && strpos($username, "\\") === false) {
                $username = $config->DOMAIN . "\\" . $username;
            }
            if ($ldap->bind($username, $password)) {
                $search = $ldap->search($ldap->resolvePath($ldap->userDN), "(&(memberof=" . $ldap->defaultGroup->dn . ")(|" . "(sAMAccountName={$searchName})" . "(mail={$searchName})" . "(cn={$searchName})" . "(uid={$searchName})" . "))", LDAP::SCOPE_ONE_LEVEL, array("cn", "uidNumber"));
                if ($search && ($user = $search->getFirstEntry())) {
                    $_SESSION["userID"] = $user->uidNumber[0];
                    $user = $ldap->getUserByDN($user->dn);
                }
            }
        }
Example #4
0
">
	<div class="name" style="<?php 
echo $this->html("line-height: " . $displayHeight . "px;");
?>
">
		<?php 
$this->view("link", true);
?>
	</div>
	<?php 
if ($this->storages->count()) {
    ?>
	<ul class="storages">
		<?php 
    $storageDisplays = array();
    $markedStorage = $args && is_array($args) ? array_read_key("storage", $args, false) : false;
    foreach ($this->storages as $storage) {
        $foundDisplayIdx = false;
        foreach ($storageDisplays as $i => $display) {
            if ($display["width"] === $storage->width && $display["height"] === $storage->height && $display["left"] === $storage->left && $display["top"] === $storage->top) {
                $storageDisplays[$i]["storages"][] = $storage;
                $foundDisplayIdx = $i;
                break;
            }
        }
        if ($foundDisplayIdx === false) {
            $foundDisplayIdx = count($storageDisplays);
            $storageDisplays[] = array("storages" => array($storage), "width" => $storage->width, "height" => $storage->height, "left" => $storage->left, "top" => $storage->top, "marked" => false);
        }
        if ($storage === $markedStorage) {
            $storageDisplays[$foundDisplayIdx]["marked"] = true;