Ejemplo n.º 1
0
             loginGlobalCounter();
             loginGlobalLog('login');
             if ($user_name == 'admin') {
                 $super = 1;
             }
         }
     } else {
         vikingError("User does not exist");
     }
 }
 if ($post_action == 'post_login_super' && $super == 1) {
     echo "bennny<br>";
     $user_name = $_POST['a4_user_name'];
     $id = getObjectIdbyName($sel_db, $user_name);
     if ($id) {
         $temp_name = getObjectName($sel_db, $id);
         if ($temp_name = $user_name) {
             $par['user'] = $user_name;
             $par['user_event'] = 1;
         }
     } else {
         vikingError("User does not exist");
     }
 }
 if ($post_action == 'post_add_user') {
     $user_name = $_POST['a4_user_name'];
     $user_pswd1 = $_POST['a4_user_pswd1'];
     $user_pswd2 = $_POST['a4_user_pswd2'];
     $user_id = createUser($user_name, $user_pswd1, $user_pswd2);
     // 	$id = getObjectIdbyName($sel_db,$user_name);
     // 	if($id == 'void')
 public function getName()
 {
     return getObjectName($this->steam_obj) . ".pyramide";
 }
Ejemplo n.º 3
0
 public function getName()
 {
     return getObjectName($this->steamContainer) . ".wiki";
 }
Ejemplo n.º 4
0
 public function getName()
 {
     return getObjectName($this->steam_obj) . ".forum";
 }
Ejemplo n.º 5
0
 public function getName()
 {
     return getObjectName($this->steam_obj) . ".portal";
 }
Ejemplo n.º 6
0
require_once 'cfg_admin.php';
logincheck();
$arrLogs = $db->select('logs', '1 ORDER BY `utc` DESC');
function getUsername($id)
{
    static $cache = array();
    if (empty($cache[$id])) {
        $cache[$id] = $GLOBALS['root']->select_one('cms_users', 'username', 'id = ' . (int) $id);
    }
    return $cache[$id];
}
function getObjectName($table, $id)
{
    static $cache = array();
    if (empty($cache[$table][$id])) {
        $cache[$table][$id] = is_int(strpos($table, '_implementations')) ? substr($table, 0, -16) . ': ' . $GLOBALS['db']->select_one('implementations', 'title', 'type = \'' . substr($table, 0, -16) . '\' AND implementation_id = ' . (int) $id) : '?';
    }
    return $cache[$table][$id];
}
tpl_header();
echo '<table border="1" cellpadding="5" cellspacing="1">';
foreach ($arrLogs as $log) {
    echo '<tr>';
    echo '<td>' . $log->action . '</td>';
    echo '<td>' . getUsername($log->user_id) . '</td>';
    echo '<td>' . getObjectName($log->table_name, $log->pk_value) . '</td>';
    echo '<td align="right">' . date('D Y-m-d H:i:s', $log->utc) . '</td>';
    echo '<td>' . $log->extra . '</td>';
    echo '</tr>';
}
echo '</table>';
 public function getName()
 {
     return getObjectName($this->steam_obj) . ".fragebogen";
 }
Ejemplo n.º 8
0
$logparams = array();
if ($loglist) {
    $i = 0;
    foreach ($loglist as $log) {
        if (is_array($log)) {
            $logid[] = $log["id"];
            /* transform LDAP user uri to a simple string */
            $loguser[] = getObjectName($log["user"]);
            $logcommit[] = $log["commit"];
            $logdate[] = $log["date"];
            $logplug[] = $auditManager->getCode($log["plugin"]);
            if (count($log["objects"]) > 0) {
                $logobject[] = getObjectName($log["objects"][0]["object"]);
                $logtypeobject[] = $auditManager->getCode($log["objects"][0]["type"]);
                if (isset($log["objects"][1]["object"])) {
                    $logaction[] = $auditManager->getCode($log["action"]) . " (" . getObjectName($log["objects"][1]["object"]) . ")";
                } else {
                    $logaction[] = $auditManager->getCode($log["action"]);
                }
            } else {
                $logobject[] = " ";
                $logtypeobject[] = " ";
                $logaction[] = $auditManager->getCode($log["action"]);
            }
            $logparams[$i]["logid"] = $log["id"];
            $logparams[$i]["logref"] = $logref;
            $i++;
        }
    }
}
$n = new LogListInfos($logdate, _("Date"));
Ejemplo n.º 9
0
$sel_name = $_SESSION['a5_object_name'];
// Initiate database if necessary
$file = getXmlFileName($sel_db);
if (!file_exists($file)) {
    createDb($sel_db, 5);
    $sel_object = 1;
    $_SESSION['a5_db'] = $sel_db;
    $_SESSION['a5_object'] = $sel_object;
    echo "Database initiated !";
}
// GET ==============================================
$temp = $_GET['a5_object_id'];
if ($temp) {
    $sel_object = $temp;
    $_SESSION['a5_object_id'] = $temp;
    $_SESSION['a5_object_name'] = getObjectName($sel_db, $sel_object);
}
// POST =============================================
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $post_action = $_POST['a5_post_action'];
    if ($post_action == 'post_create_product') {
        $sel_name = $_POST['a5_product_name'];
        $sel_proce = $_POST['a5_product_price'];
        $sel_status = $_POST['a5_product_status'];
        $sel_text = $_POST['a5_product_text'];
        $sel_id = getNextNodeId($sel_db);
        $father_id = 1;
        createObject($sel_db, $father_id, $sel_name, $sel_id);
        if ($sel_db && $sel_id) {
            $image_name = uploadImage($sel_db, $sel_id);
            if ($image_name) {
Ejemplo n.º 10
0
function addLink($from_struct, $from_object, $to_struct, $to_object)
{
    // <object name="Heater control" id="3" type="linkFrom">T24 45</object>
    global $error;
    // Not possible to link to smae structure
    if ($from_struct == $to_struct) {
        return;
    }
    //echo("Create link: $from_struct,$from_object,$to_struct,$to_object<br>");
    if ($from_struct && $from_object && $to_struct && $to_object) {
        $object_name_from = getObjectName($from_struct, $from_object);
        $object_name_to = getObjectName($to_struct, $to_object);
        //$lid = createNode('generate',$from_struct,$from_object,$object_name_from,$from_object,'linkFrom');
        createNode($from_struct, $from_object, $to_struct, $to_object, 'linkOut');
        $value = $to_struct . " " . $object_name_to . " " . $to_object;
        setNodeValue($from_struct, $from_object, 'type', 'linkFrom', $value);
        // echo("new lid = $lid<br>");
        createNode($to_struct, $to_object, $from_struct, $from_object, 'linkIn');
        $value = $from_struct . " " . $object_name_from . " " . $from_object;
        setNodeValue($to_struct, $to_object, 'type', 'linkTo', $value);
    } else {
        echo "Unable to create link: {$from_struct},{$from_object},{$to_struct},{$to_object}";
    }
}
Ejemplo n.º 11
0
function showObject($app, $db_name, $object_id)
{
    global $par;
    $path = $par['path'];
    $open_file = $par['p1'];
    //echo("showObject: $db_name,$object_id<br/>");
    //if($object_id == 1)echo("$db_name<br/>");
    $file = getXmlFileName($db_name);
    $dom = new DOMDocument();
    $dom->load($file);
    $xpath = new DOMXPath($dom);
    $question = "//object";
    $objects = $xpath->query($question);
    foreach ($objects as $object) {
        $id = $object->getAttribute('id');
        $name = $object->getAttribute('name');
        $type = $object->getAttribute('type');
        //echo("Aid= $id $object_id<br/>");
        if ($id == $object_id && $type == 'node') {
            echo "<b>{$name} {$id}</b><br/>";
            $childs = $object->childNodes;
            foreach ($childs as $child) {
                $attr_name = $child->attributes->getNamedItem("name")->nodeValue;
                $attr_id = $child->attributes->getNamedItem("id")->nodeValue;
                $attr_type = $child->attributes->getNamedItem("type")->nodeValue;
                //$attr_lid  = $child->attributes->getNamedItem("lid")->nodeValue;
                //if($attr_type != 'node')echo("Show: $attr_name $attr_id $attr_type<br/>");
                if ($attr_type == 'linkOut') {
                    $temp = getObjectName($attr_name, $attr_id);
                    //$temp = getNodeValue($db_name,$attr_id,$attr_lid,'type','linkFrom');
                    if ($temp) {
                        $sid = $par[$attr_name];
                        displayLinkOut($app, $db_name, $object_id, $attr_name, $attr_id, $temp, $sid);
                    }
                }
                if ($attr_type == 'linkIn') {
                    $temp = getObjectName($attr_name, $attr_id);
                    //$temp = getNodeValue($db_name,$attr_id,$attr_lid,'type','linkTo');
                    if ($temp) {
                        $sid = $par[$attr_name];
                        displayLinkIn($app, $db_name, $object_id, $attr_name, $attr_id, $temp, $sid);
                    }
                }
                if ($attr_type == 'text') {
                    $temp = getNodeValue($db_name, $attr_id, 'type', 'text');
                    if ($temp) {
                        displayObjectText($temp);
                    }
                }
                if ($attr_type == 'image') {
                    $temp = getNodeValue($db_name, $attr_id, 'type', 'image');
                    //if($temp)echo("Image: $temp<br/>");
                    //$image_name = getObjectImageName($db_name,$object_id);
                    //if($temp == $image_name)
                    $image_name = $temp;
                    if ($temp) {
                        displayObjectImage($image_name);
                    }
                }
                if ($attr_type == 'file') {
                    $temp = getNodeValue($db_name, $attr_id, 'type', 'file');
                    $file_name = $temp;
                    if ($temp) {
                        if ($open_file == "open_file") {
                            echo "<a href={$path}&a3_sid={$sys_id}&p1=close_file>" . FILE_CLOSE . "</a><br/>";
                            displayObjectFile($file_name);
                        } else {
                            echo "<a href={$path}&a3_sid={$sys_id}&p1=open_file>" . FILE_OPEN . "</a><br/>";
                        }
                    }
                }
            }
        }
    }
    echo "<hr>";
}
Ejemplo n.º 12
0
} else {
    $item = "index";
}
$sidemenu->forceActiveItem($item);
$p->setSideMenu($sidemenu);
$p->display();
$log = get_log_by_id($_GET["logid"]);
if ($log[0]["commit"]) {
    $style = "audit_ok";
} else {
    $style = "audit_nok";
}
$f = new ValidatingForm(array("class" => $style));
$f->push(new Table());
$f->add(new TrFormElement(_("Date"), new HiddenTpl("date")), array("value" => $log[0]["date"]));
$f->add(new TrFormElement(_("User that initiated the event"), new HiddenTpl("user")), array("value" => getObjectName($log[0]["user"]) . " (" . $log[0]["user"] . ")"));
$f->add(new TrFormElement(_("Event"), new HiddenTpl("action")), array("value" => $auditManager->getCode($log[0]["action"])));
$f->add(new TrFormElement(_("Plugin"), new HiddenTpl("plugin")), array("value" => $auditManager->getCode($log[0]["plugin"])));
$f->add(new TrFormElement(_("Client"), new HiddenTpl("interface")), array("value" => $log[0]["client-type"]));
$f->add(new TrFormElement(_("Client hostname"), new HiddenTpl("hostname")), array("value" => $log[0]["client-host"]));
$f->add(new TrFormElement(_("Agent hostname"), new HiddenTpl("ahostname")), array("value" => $log[0]["agent-host"]));
$i = 1;
foreach ($log[0]["objects"] as $obj) {
    $f->add(new TrFormElement(_("Object"), new HiddenTpl("obj" . $i)), array("value" => $obj["object"]));
    $f->add(new TrFormElement(_("Object type"), new HiddenTpl("type" . $i)), array("value" => $auditManager->getCode($obj["type"])));
    if (isset($obj["current"])) {
        foreach ($obj["current"] as $current) {
            if ($current) {
                $current_val = trim($current);
            } else {
                $current_val = "(empty)";
Ejemplo n.º 13
0
//======================================
// Template
// function viking_0_function1()
//======================================
define("TEMPLATE", "Mall");
// Declarations =====================================
// read SESSION parameters ===============================
$sel_db = $_SESSION['0_db'];
$sel_object = $_SESSION['0_object_id'];
$sel_name = $_SESSION['0_object_name'];
// GET ==============================================
$temp = $_GET['object_id'];
if ($temp) {
    $sel_object = $temp;
    $sel_name = getObjectName($sel_db, $sel_object);
}
// POST =============================================
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $post_action = $_POST['post_action'];
    if ($post_action == 'post_select_db') {
        $sel_db = $_POST['database'];
        $sel_object = 1;
        $index = '1.';
    }
}
// Set par array values
$par['3_db'] = $sel_db;
$par['3_object'] = $sel_object;
$par['3_name'] = $sel_name;
// set SESSION parameters ===============================