Exemple #1
0
    $page->logRequest();
    exit;
}
// generate output
$localNode = sotf_Node::getLocalNode();
if (!$localNode) {
    // clear old entry
    $localNode = new sotf_Node();
    $localNode->set('name', $config['nodeName']);
    $localNode->find();
    if ($localNode->exists()) {
        $localNode->delete();
    }
    // create local node entry if does not exist
    $localNode = new sotf_Node();
    $localNode->set('node_id', $config['nodeId']);
    $localNode->set('name', $config['nodeName']);
    $localNode->set('url', $config['rootUrl']);
    $localNode->create();
}
$smarty->assign("LOCAL_NODE", $localNode->getAll());
// nodes
//$nodes = sotf_Node::countAll();
//$smarty->assign('NODES',$nodeData);
// neighbours
//$neighbours = sotf_Neighbour::listAll();
$nodes = sotf_Node::listAll();
print_r($neighbours);
while (list(, $node) = each($nodes)) {
    $nodeId = $node->get('node_id');
    if ($nodeId == $config['nodeId']) {
Exemple #2
0
    $username = sotf_Utils::getParameter('username');
    $userid = $user->getUserid($username);
    if (empty($userid) || !is_numeric($userid)) {
        raiseError("Invalid username: {$username}");
    }
    $permissions->delPermission('node', $userid);
    $msg = $page->getlocalizedWithParams("deleted_permissions_for", $username);
    $page->addStatusMsg($msg, false);
    $page->redirect("admin.php");
    exit;
}
// generate output
$localNode = sotf_Node::getLocalNode();
if (!$localNode) {
    $localNode = new sotf_Node();
    $localNode->set('node_id', $nodeId);
    $localNode->set('name', $nodeName);
    $localNode->set('url', $rootdir);
    $localNode->create();
}
$smarty->assign("LOCAL_NODE", $localNode->getAll());
// nodes
//$nodes = sotf_Node::countAll();
//$smarty->assign('NODES',$nodeData);
// neighbours
$neighbours = sotf_Neighbour::listAll();
while (list(, $nei) = each($neighbours)) {
    $node = sotf_Node::getNodeById($nei->get('node_id'));
    $data = $nei->getAll();
    if ($node) {
        $data['node'] = $node->getAll();