Example #1
0
<?php

/**
 * SUMO MODULE: Network | Edit Node
 * 
 * @version    0.5.0
 * @link       http://sumoam.sourceforge.net SUMO Access Manager
 * @author     Alberto Basso <*****@*****.**>
 * @copyright  Copyright &copy; 2003-2009, Alberto Basso
 * @package    SUMO
 * @category   Console
 */
$tab = sumo_get_node_info($_GET['id'], 'id', FALSE);
$tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify_node', 'id=' . $tab['id']);
$tpl['PUT:Protocol'] = sumo_put_node_protocol($tab['protocol']);
$tpl['PUT:NodeName'] = "<input type='text' size='25' name='name' value='" . $tab['name'] . "'>";
$tpl['PUT:Host'] = "<input type='text' size='25' name='host' value='" . $tab['host'] . "'>";
$tpl['PUT:Port'] = "<input type='text' size='7' name='port' value='" . $tab['port'] . "'>";
$tpl['PUT:SumoPath'] = "<input type='text' size='25' name='sumo_path' value='" . $tab['sumo_path'] . "'>";
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_node&id=" . $tab['id'] . "\");'>";
$tpl['LINK:Add'] = sumo_verify_permissions(4, 'sumo') ? sumo_get_action_icon("network", "add_node", "network.content", "?module=network&action=new_node&decoration=false") : sumo_get_action_icon("", "add_node");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit_node");
// Change status
if ($tab['active']) {
    $tpl['GET:Status'] = "<font class='status-green'>" . $language['Active'] . "</font>";
    $tpl['PUT:Status'] = "<select name='status'>\n<option value='1'>" . $language['Enable'] . "</option>\n<option value='0'>" . $language['Disable'] . "</option>\n</select>";
} else {
    $tpl['GET:Status'] = "<font class='status-red'>" . $language['Disabled'] . "</font>";
    $tpl['PUT:Status'] = "<select name='status'>\n<option value='0'>" . $language['Disable'] . "</option>\n<option value='1'>" . $language['Enable'] . "</option>\n</select>";
}
// if it's current node
Example #2
0
<?php

/**
 * SUMO MODULE: Network | New Node
 * 
 * @version    0.5.0
 * @link       http://sumoam.sourceforge.net SUMO Access Manager
 * @author     Alberto Basso <*****@*****.**>
 * @copyright  Copyright &copy; 2003-2009, Alberto Basso
 * @package    SUMO
 * @category   Console
 */
$tpl['GET:AddForm'] = sumo_get_form_req('', 'add_node');
$tpl['PUT:NodeName'] = "<input type='text' size='25' name='name' value='" . $_POST['name'] . "'>";
$tpl['PUT:Host'] = "<input type='text' size='25' name='host' value='" . $_POST['host'] . "'>";
$tpl['PUT:Port'] = "<input type='text' size='7' name='port' value='" . $_POST['port'] . "'>";
$tpl['PUT:Protocol'] = sumo_put_node_protocol($_POST['protocol']);
$tpl['PUT:SumoPath'] = "<input type='text' size='25' name='sumo_path' value='" . $_POST['sumo_path'] . "'>";
$tpl['PUT:Status'] = "<select name='status'>\n<option value='0'>" . $language['Disable'] . "</option>\n<option value='1'>" . $language['Enable'] . "</option>\n</select>";
$tpl['LINK:Add'] = sumo_get_action_icon("", "add_node");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit_node");
$tpl['LINK:Remove'] = sumo_get_action_icon("", "remove_node");
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network.content\",\"?module=network&action=nlist&decoration=false\");'>";