Example #1
0
 */
$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
if ($tab['ip'] == $SUMO['server']['ip']) {
    $tpl['MESSAGE:M'] = $language['NodeWarning'];
    $tpl['PUT:Host'] = $tab['ip'] . "<input type='hidden' name='host' value='" . $tab['host'] . "'>";
    $tpl['PUT:Status'] = "";
}
if (sumo_verify_permissions(7, 'sumo') && $tab['id'] > 1) {
    $msg = sumo_get_simple_rand_string(4, "123456789");
    $tpl['LINK:Remove'] = "<div class='sub-module-icon' " . "onmouseover='this.style.outline=\"1px solid #999999\";this.style.background=\"#FFFFFF\"' " . "onmouseout='this.style.outline=\"\";this.style.background=\"\"'>" . "<a href=\"javascript:" . "sumo_show_message('msg{$msg}', '" . htmlspecialchars(sumo_get_message('AreYouSureDeleteNode', $tab['name'])) . "', \n\t\t\t\t\t\t\t\t 'h', 0, \n\t\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'erase_node', 'id=' . $tab['id'])) . "',\n\t\t\t\t\t\t\t\t '" . base64_encode('') . "',\n\t\t\t\t\t\t\t\t '" . base64_encode("<input type='button' value='" . $language['Cancel'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "',\n\t\t\t\t\t\t\t\t '" . base64_encode("<input type='submit' value='" . $language['Ok'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "'\n\t\t\t\t\t\t\t\t);\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/network/remove_node.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
} else {
    $tpl['LINK:Remove'] = sumo_get_action_icon("", "remove_node");
}
Example #2
0
 * @link       http://sumoam.sourceforge.net SUMO Access Manager
 * @author     Alberto Basso <*****@*****.**>
 * @copyright  Copyright &copy; 2003-2009, Alberto Basso
 * @package    SUMO
 * @category   Console
 */
$id = isset($_GET['id']) ? $_GET['id'] : '';
$tab = sumo_get_accesspoint_info($id, 'id', FALSE);
$checked['http_auth'] = $tab['http_auth'] ? " checked='checked'" : "";
$checked['filtering'] = $tab['filtering'] ? " checked='checked'" : "";
$checked['pwd_encrypt'] = $tab['pwd_encrypt'] ? " checked='checked'" : "";
$checked['change_pwd'] = $tab['change_pwd'] ? " checked='checked'" : "";
$checked['registration'] = $tab['registration'] ? " checked='checked'" : "";
$form_name = 'AddAccesspoints';
$tpl['GET:ID'] = $tab['id'];
$tpl['GET:AddForm'] = sumo_get_form_req('', 'add', 'id=' . $tab['id']);
$tpl['PUT:Node'] = sumo_put_node($tab['node']);
$tpl['PUT:Theme'] = sumo_put_themes($tab['theme']);
$tpl['PUT:Groups'] = sumo_put_accesspoint_group($tab['id']);
$tpl['PUT:AddGroup'] = sumo_add_accesspoint_group();
$tpl['PUT:AddRegGroup'] = sumo_add_accesspoint_group('', 'reg_group');
$tpl['PUT:Name'] = sumo_put_accesspoint_name($form_name, sumo_get_accesspoint_name($tab['name']));
$tpl['PUT:Path'] = "<input type='text' size='35' name='path' value='" . $tab['path'] . "' />";
$tpl['PUT:HTTPAuth'] = "<input type='checkbox' name='http_auth' " . $checked['http_auth'] . " onclick='if(document.{$form_name}.http_auth.checked==true && document.{$form_name}.pwd_encrypt.disabled==false){document.{$form_name}.pwd_encrypt.checked=false;}' />";
$tpl['PUT:Filtering'] = "<input type='checkbox' name='filtering' " . $checked['filtering'] . "  />";
$tpl['PUT:PwdEncrypt'] = "<input type='checkbox' name='pwd_encrypt' " . $checked['pwd_encrypt'] . " onclick='if(document.{$form_name}.pwd_encrypt.checked==true){document.{$form_name}.http_auth.checked=false;}' />";
$tpl['PUT:ChangePwd'] = "<input type='checkbox' name='change_pwd' " . $checked['change_pwd'] . " />";
$tpl['PUT:Registration'] = "<input type='checkbox' name='registration' " . $checked['registration'] . " " . "onclick='if(document.{$form_name}.registration.checked==true){document.{$form_name}.reg_group.disabled=false;}else{document.{$form_name}.reg_group.disabled=true;}' />";
$tpl['LINK:Add'] = sumo_get_action_icon("", "add");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit");
$tpl['LINK:Remove'] = sumo_get_action_icon("", "remove");
Example #3
0
        case 'L':
            $tab['type'] = $language['Locale'];
            break;
        case 'P':
            $tab['type'] = $language['Proxy'];
            break;
        default:
            $tab['type'] = $language['Unknow'];
            break;
    }
    // verify permission to delete node
    // NOTE: NOT use sumo_verify_permissions() for best performance!
    $delete = '';
    if ($SUMO['user']['group_level']['sumo'] > 4) {
        $msg = sumo_get_simple_rand_string(4, "123456789");
        $delete = "<a href=\"javascript:" . "sumo_show_message('msg{$msg}', '" . htmlspecialchars(sumo_get_message('AreYouSureDeleteLocalIP', array($tab['ip'], $tab['type']))) . "', \n\t\t\t\t\t\t\t\t\t 'h', 0,\n\t\t\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'erase_localip', 'id=' . $tab['id'])) . "',\n\t\t\t\t\t\t\t\t\t '" . base64_encode('') . "',\n\t\t\t\t\t\t\t\t\t '" . base64_encode("<input type='button' value='" . $language['Cancel'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "',\n\t\t\t\t\t\t\t\t\t '" . base64_encode("<input type='submit' value='" . $language['Ok'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "'\n\t\t\t\t\t\t\t\t\t);\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/network/remove.gif'></a>&nbsp;&nbsp;";
    }
    $list .= "<tr>\n";
    if ($col[3]) {
        $list .= "<td class='" . $style . "'>" . $delete . "<a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_localip&id=" . $tab['id'] . "\");' title='" . $language['View'] . "'>" . $tab['type'] . "</a></td>\n";
    }
    if ($col[2]) {
        $list .= "<td class='" . $style . "' align='right'>" . "<a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_localip&id=" . $tab['id'] . "\");' title='" . $language['View'] . "'>" . $tab['ip'] . "</a></td>\n";
    }
    $list .= "</tr>\n";
}
$list .= "</table>";
$searched = $search ? $_SESSION['search_network_ilist'] : '';
// Template Data
$tpl = array('MESSAGE:H' => $tpl['MESSAGE:H'], 'MESSAGE:M' => $tpl['MESSAGE:M'], 'MESSAGE:L' => $tpl['MESSAGE:L'], 'GET:Theme' => $SUMO['page']['theme'], 'GET:MenuModule' => $tpl['GET:MenuModule'], 'GET:LocalNetworkList' => $list, 'GET:TotalRows' => number_format($tot, 0, "", "."), 'GET:StartRow' => number_format($_SESSION['start_network_ilist'], 0, "", "."), 'GET:EndRow' => number_format($_SESSION['start_network_ilist'] + $vis, 0, "", "."), 'GET:PagingResults' => sumo_paging_results($tot, $vis, $_SESSION['rows_network_ilist'], 5, $_SESSION['start_network_ilist'], 'start_network_ilist'), 'GET:TableSettings' => sumo_get_table_settings($table['data']['ilist']), 'GET:SearchForm' => sumo_get_form_search($searched), 'GET:ExportData' => '');
$tpl['GET:Pagination'] = $tot > 0 ? $tpl['GET:StartRow'] . "..." . $tpl['GET:EndRow'] . "&nbsp;&nbsp;" . $language['of'] . "&nbsp;<b>" . $tpl['GET:TotalRows'] . "</b>" : "";
Example #4
0
$form_name = 'ModifyAccesspoints';
$is_console = sumo_verify_is_console($tab['path']) ? true : false;
$path_console = $is_console ? $tab['path'] : sumo_get_rand_string(8);
// bad solution
// Delete
if ($SUMO['user']['group_level']['sumo'] > 4 && (!sumo_verify_is_console($tab['path']) || $tab['id'] != 1)) {
    $msg = sumo_get_simple_rand_string(4, "123456789");
    $delete = "<div class='sub-module-icon' " . "onmouseover='this.style.outline=\"1px solid #999999\";this.style.background=\"#FFFFFF\"' " . "onmouseout='this.style.outline=\"\";this.style.background=\"\"'>" . "<a href=\"javascript:" . "sumo_show_message('msg{$msg}', '" . htmlspecialchars(sumo_get_message('AreYouSureDelete', array($tab['path'], htmlspecialchars(sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']), ENT_QUOTES)))) . "', \n\t\t\t\t\t\t'h', 0, \n\t\t\t\t\t\t'" . base64_encode(sumo_get_form_req('', 'delete', 'id=' . $tab['id'])) . "',\n\t\t\t\t\t\t'" . base64_encode('') . "',\n\t\t\t\t\t\t'" . base64_encode("<input type='button' value='" . $language['Cancel'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "',\n\t\t\t\t\t\t'" . base64_encode("<input type='submit' value='" . $language['Ok'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "'\n\t\t\t\t);\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/accesspoints/remove.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
} else {
    $delete = sumo_get_action_icon("", "remove");
}
$tpl['GET:ID'] = $tab['id'];
$tpl['GET:RegGroup'] = $tab['reg_group'];
$tpl['GET:Updated'] = sumo_get_human_date($tab['updated']);
$tpl['GET:Created'] = sumo_get_human_date($tab['created']);
$tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify', 'id=' . $tab['id']);
$tpl['GET:Created'] = sumo_get_human_date($tab['created']);
$tpl['PUT:Node'] = $tab['id'] > 1 ? sumo_put_node($tab['node']) : sumo_put_node($tab['node'], true);
$tpl['PUT:Groups'] = sumo_put_accesspoint_group($tab['id']);
$tpl['PUT:AddGroup'] = sumo_add_accesspoint_group(sumo_get_grouplevel($tab['usergroup'], true));
$tpl['PUT:AddRegGroup'] = sumo_add_accesspoint_group($tab['reg_group'], 'reg_group', $checked['reg_group']);
$tpl['PUT:Theme'] = sumo_put_themes($tab['theme']);
$tpl['PUT:Name'] = sumo_put_accesspoint_name($form_name, sumo_get_accesspoint_name($tab['name']));
$tpl['PUT:Filtering'] = "<input type='checkbox' name='filtering' " . $checked['filtering'] . ">";
$tpl['PUT:ChangePwd'] = $is_console ? "<input type='checkbox' name='change_pwd' disabled " . $checked['change_pwd'] . " />" : "<input type='checkbox' name='change_pwd' " . $checked['change_pwd'] . " />";
$tpl['PUT:Registration'] = $is_console ? "<input type='checkbox' name='registration' disabled " . $checked['registration'] . " " : "<input type='checkbox' name='registration' " . $checked['registration'] . " " . "onclick='if(document.{$form_name}.registration.checked==true){document.{$form_name}.reg_group.disabled=false;}else{document.{$form_name}.reg_group.disabled=true;}' />";
$tpl['PUT:Path'] = $tab['id'] > 1 ? "<input type='text' size='50' name='path' value='" . $tab['path'] . "' onchange='if(this.form.path.value!=\"{$path_console}\"){document.{$form_name}.filtering.disabled=false;}else{document.{$form_name}.filtering.disabled=true;}' />" : "<input type='hidden' name='path' value='" . $tab['path'] . "'><input type='text' size='50' name='path2' value='" . $tab['path'] . "' disabled>";
$tpl['PUT:HTTPAuth'] = "<input type='checkbox' name='http_auth' " . $checked['http_auth'] . " " . "onclick='if(document.{$form_name}.http_auth.checked==true && document.{$form_name}.pwd_encrypt.disabled==false){document.{$form_name}.pwd_encrypt.checked=false;}' />";
$tpl['PUT:PwdEncrypt'] = "<input type='checkbox' name='pwd_encrypt' " . $checked['pwd_encrypt'] . " " . "onclick='if(document.{$form_name}.pwd_encrypt.checked==true){document.{$form_name}.http_auth.checked=false;}' />";
$tpl['LINK:Add'] = sumo_verify_permissions(5, 'sumo') ? sumo_get_action_icon("", "add", "accesspoints.content", "?module=accesspoints&action=new&decoration=false") : sumo_get_action_icon("", "add");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit");
Example #5
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\");'>";
Example #6
0
/**
 *  Get form to change table settings
 */
function sumo_get_table_settings($columns = array(), $module = NULL, $action = NULL)
{
    global $language;
    $m = $module ? $module : $_SESSION['module'];
    $a = $action ? $action : $_SESSION['action'];
    $settings = "<div id='ChangeTableSettings" . $m . $a . "'>\n" . "<input type='button' class='button' value='" . $language['TableSettings'] . "' " . "onclick='javascript:ShowHideElement(\"TableSettings" . $m . $a . "\");" . "HideElement(\"ChangeTableSettings" . $m . $a . "\");sumo_unrefresh_window(\"{$m}\");'>" . "</div>\n" . "<div id='TableSettings" . $m . $a . "' style='visibility:hidden;position:absolute'>\n" . "<table style='white-space:nowrap;'>\n" . "<tr><td>" . sumo_get_form_req($m, $a) . $language['View'] . ":&nbsp;" . "<input type='hidden' value='true' name='reset_" . $m . "_" . $a . "' />\n" . "<input type='text' class='small' size='3' name='rows_" . $m . "_" . $a . "' " . "value='" . $_SESSION['rows_' . $m . '_' . $a] . "' />&nbsp;" . "<select name='" . $m . "_" . $a . "_view_col' />\n" . " <option class='comment'>" . $language['SelectCols'] . "</option>\n" . " <option value='999'>&nbsp;&nbsp;&nbsp;&nbsp;" . $language['SelectAllCols'] . "</option>\n" . " <option class='comment'>------------------</option>\n";
    for ($c = 0; $c < count($columns); $c++) {
        $id = $columns[$c]['id'];
        $name = strip_tags($columns[$c]['name']) ? $columns[$c]['name'] : $language['UNDEFINED'];
        $enabled = '&nbsp;&nbsp;';
        $change = 1;
        if (isset($_SESSION[$m][$a]['col'][$id])) {
            $enabled = $_SESSION[$m][$a]['col'][$id] ? '&bull;' : '&nbsp;&nbsp;';
            $change = $_SESSION[$m][$a]['col'][$id] ? 0 : 1;
        }
        $settings .= " <option value='" . $id . ".{$change}'>" . $enabled . "&nbsp;&nbsp;" . $name . "</option>\n";
    }
    $settings .= "</select>&nbsp;<input type='submit' value='" . $language['Ok'] . "' class='button'>" . "</form>\n</td></tr></table>\n</div>";
    return $settings;
}
Example #7
0
<?php

/**
 * SUMO MODULE: Network | Erase Node
 * 
 * @version    0.4.2
 * @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:DeleteForm'] = sumo_get_form_req('', 'erase_node', 'id=' . $tab['id']);
if ($_GET['id'] == 1) {
    $tpl['MESSAGE:H'] = $language['CannotDeleteNode'];
} else {
    $delete = sumo_delete_node($_GET['id']);
    if ($delete) {
        $tpl['MESSAGE:L'] = sumo_get_message('NodeDeleted', $tab['name']);
    } else {
        $tpl['MESSAGE:H'] = sumo_get_message('NodeNotDeleted', $tab['name']);
    }
}
$tpl['GET:MenuModule'] = sumo_get_module_menu($menu['nlist'], 'nlist');
require "action.nlist.php";
Example #8
0
$form_name = ucfirst('add_datasource') . ucfirst('network');
$tpl['PUT:DataSourceType'] = sumo_put_datasources_type($_POST['type'], $form_name);
$tpl['PUT:EncType'] = sumo_put_datasources_enctype($_POST['enctype'], $_POST['type']);
$tpl['PUT:DataSourceName'] = "<input type='text' size='35' name='name' value='" . $_POST['name'] . "'>";
$tpl['PUT:DataSourceHost'] = "<input type='text' size='35' name='host' value='" . $_POST['host'] . "'>";
$tpl['PUT:DataSourcePort'] = "<input type='text' size='7' name='port' value='" . $_POST['port'] . "'>";
$tpl['PUT:DataSourceUser'] = "******" . $_POST['user'] . "'>";
$tpl['PUT:DataSourcePassword'] = "******" . $_POST['password'] . "'>";
$tpl['PUT:DataSourceRePassword'] = "******";
$tpl['PUT:DBName'] = "<input type='text' size='25' name='db_name' value='" . $_POST['db_name'] . "'>";
$tpl['PUT:DBTable'] = "<input type='text' size='35' name='db_table' value='" . $_POST['db_table'] . "'>";
$tpl['PUT:DBFieldUser'] = "******" . $_POST['db_field_user'] . "'>";
$tpl['PUT:DBFieldPassword'] = "******" . $_POST['db_field_password'] . "'>";
$tpl['PUT:LDAPBase'] = "<input type='text' size='35' name='ldap_base' value='" . $_POST['ldap_base'] . "'>";
$tpl['BUTTON:Cancel'] = "<input type='button' class='button-red' value='" . $language["Cancel"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=dlist\");'>";
$tpl['GET:Form'] = sumo_get_form_req('', 'add_datasource');
$tpl['LINK:Add'] = sumo_get_action_icon('', "add_datasource");
$tpl['LINK:Edit'] = sumo_get_action_icon('', "edit_datasource");
$tpl['LINK:Remove'] = sumo_get_action_icon('', "remove_datasource");
//$visibility['DatabaseOptions']   = $_POST['DatabaseOptions_visibility'] ? true : false;
//$visibility['LDAPOptions']       = $_POST['LDAPOptions_visibility']     ? true : false;
$visibility['DatabaseOptions'] = $_POST['DatabaseOptions_visibility'] ? 1 : 0;
$visibility['LDAPOptions'] = $_POST['LDAPOptions_visibility'] ? 1 : 0;
$tpl['LINK:DatabaseOptions'] = '<div onclick=\'javascript:ShowHideSubModule("network.add_datasource.DatabaseOptions");\'><input type="hidden" value="' . $visibility['DatabaseOptions'] . '" name="DatabaseOptions_visibility"></div>' . '<div style="visibility: hidden; position: absolute;" id="network.add_datasource.DatabaseOptions">';
$tpl['LINK:LDAPOptions'] = '<div onclick=\'javascript:ShowHideSubModule("network.add_datasource.LDAPOptions");\'><input type="hidden" value="' . $visibility['LDAPOptions'] . '" name="LDAPOptions_visibility"></div>' . '<div style="visibility: hidden; position: absolute;" id="network.add_datasource.LDAPOptions">';
//$tpl['LINK:DatabaseOptions'] = sumo_get_action_link('network.add_datasource', 'DatabaseOptions', $visibility['DatabaseOptions']);
//$tpl['LINK:LDAPOptions']     = sumo_get_action_link('network.add_datasource', 'LDAPOptions',     $visibility['LDAPOptions']);
// Bugfix
if ($_POST['db_name']) {
    $tpl['GET:WindowScripts'] = "setTimeout('ShowElement(\"network.add_datasource.DatabaseOptions\")',100);";
}
Example #9
0
<?php

/**
 * SUMO MODULE: Settings | Edit
 * 
 * @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_user_info($_GET['id'], 'id', FALSE);
$conf = sumo_get_config('server', FALSE);
$conf = $conf['config'];
$tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify');
// Generic
$tpl['PUT:server.language'] = sumo_get_available_languages(1, 0, $conf['server']['language'], 'config[server][language]');
$tpl['IMG:server.language'] = "<img src='themes/" . $SUMO['page']['theme'] . "/images/flags/" . $conf['server']['language'] . ".png' alt='" . ucwords($conf['server']['language']) . "' class='flag'>";
$tpl['PUT:server.date_format'] = "<input type='text' size='5' name='config[server][date_format]' value='" . $conf['server']['date_format'] . "'>";
$tpl['PUT:server.time_format'] = "<input type='text' size='5' name='config[server][time_format]' value='" . $conf['server']['time_format'] . "'>";
$tpl['PUT:server.admin.name'] = "<input type='text' size='30' name='config[server][admin][name]' value='" . $conf['server']['admin']['name'] . "'>";
$tpl['PUT:server.admin.email'] = "<input type='text' size='30' name='config[server][admin][email]' value='" . $conf['server']['admin']['email'] . "'>";
$tpl['PUT:iptocountry.enabled'] = $conf['iptocountry']['enabled'] ? "<input type='checkbox' name='config[iptocountry][enabled]' checked='checked'>" : "<input type='checkbox' name='config[iptocountry][enabled]'>";
$tpl['GET:iptocountry.updater'] = "<a href='services.php?service=updater&cmd=UPDATE_IP2C' target='_new'>" . $language['iptocountry.updater'] . "</a>";
// Console
$tpl['PUT:console.tip'] = $conf['console']['tip'] ? "<input type='checkbox' name='config[console][tip]' checked='checked'>" : "<input type='checkbox' name='config[console][tip]'>";
// Security
$tpl['PUT:security.max_login_attempts'] = "<input type='text' size='5' name='config[security][max_login_attempts]' value='" . $conf['security']['max_login_attempts'] . "'>";
$tpl['PUT:security.banned_time'] = "<input type='text' size='5' name='config[security][banned_time]' value='" . $conf['security']['banned_time'] . "'>";
$tpl['PUT:security.access_violations'] = $conf['security']['access_violations'] ? "<input type='checkbox' name='config[security][access_violations]' checked='checked'>" : "<input type='checkbox' name='config[security][access_violations]'>";
Example #10
0
    case $type == 'GMail':
        $tab['ldap_base'] = '';
        $tab['port'] = '';
        $tab['db_name'] = '';
        $tab['db_table'] = '';
        $tab['db_field_user'] = '';
        $tab['db_field_password'] = '';
        break;
}
if ($_GET['id'] == 1) {
    $tpl['MESSAGE:M'] = $language['CannotModifyDataSource'];
}
$form_name = ucfirst('modify_datasource') . ucfirst('network');
$msg = sumo_get_simple_rand_string(4, "123456789");
$delete = "<div class='sub-module-icon' " . "onmouseover='this.style.outline=\"1px solid #999999\";this.style.background=\"#FFFFFF\"' " . "onmouseout='this.style.outline=\"\";this.style.background=\"\"'>" . "<a href=\"javascript:" . "sumo_show_message('msg{$msg}', '" . htmlspecialchars(sumo_get_message('AreYouSureDeleteDataSource', $tab['name'])) . "', \n\t\t\t\t\t\t\t 'h', 0, \n\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'erase_datasource', 'id=' . $tab['id'])) . "',\n\t\t\t\t\t\t\t '" . base64_encode('') . "',\n\t\t\t\t\t\t\t '" . base64_encode("<input type='button' value='" . $language['Cancel'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "',\n\t\t\t\t\t\t\t '" . base64_encode("<input type='submit' value='" . $language['Ok'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "'\n\t\t\t\t\t\t\t);\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/network/remove_datasource.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
$tpl['GET:Form'] = sumo_get_form_req('', 'modify_datasource', 'id=' . $tab['id']);
$tpl['PUT:DataSourceType'] = sumo_put_datasources_type($type, $form_name);
$tpl['PUT:EncType'] = sumo_put_datasources_enctype($tab['enctype'], $type);
$tpl['PUT:DataSourceName'] = "<input type='text' size='35' name='name' value='" . $tab['name'] . "'>";
$tpl['PUT:DataSourceHost'] = "<input type='text' size='35' name='host' value='" . $tab['host'] . "'>";
$tpl['PUT:DataSourcePort'] = "<input type='text' size='7' name='port' value='" . $tab['port'] . "'>";
$tpl['PUT:DataSourceUser'] = "******" . $tab['username'] . "'>";
$tpl['PUT:DataSourcePassword'] = "******" . $tab['password'] . "'>";
$tpl['PUT:DataSourceRePassword'] = "******" . $tab['password'] . "'>";
$tpl['PUT:DBName'] = "<input type='text' size='25' name='db_name' value='" . $tab['db_name'] . "'>";
$tpl['PUT:DBTable'] = "<input type='text' size='35' name='db_table' value='" . $tab['db_table'] . "'>";
$tpl['PUT:DBFieldUser'] = "******" . $tab['db_field_user'] . "'>";
$tpl['PUT:DBFieldPassword'] = "******" . $tab['db_field_password'] . "'>";
$tpl['PUT:LDAPBase'] = "<input type='text' size='35' name='ldap_base' value='" . $tab['ldap_base'] . "'>";
$tpl['BUTTON:Cancel'] = "<input type='button' class='button-red' value='" . $language["Cancel"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_datasource&id=" . $tab['id'] . "\");'>";
$tpl['LINK:Add'] = sumo_verify_permissions(4, 'sumo') ? sumo_get_action_icon("", "add_datasource", "network.content", "?module=network&action=new_datasource&decoration=false") : sumo_get_action_icon("", "add_datasource");
Example #11
0
 * @package    SUMO
 * @category   Console
 */
if (sumo_verify_permissions(5, $SUMO['user']['group'])) {
    $tpl['PUT:User'] = "******" . $_POST['user'] . "'>";
    $tpl['PUT:FirstName'] = "<input type='text' size='35' name='firstname' value='" . htmlspecialchars($_POST['firstname'], ENT_QUOTES) . "'>";
    $tpl['PUT:LastName'] = "<input type='text' size='35' name='lastname' value='" . htmlspecialchars($_POST['lastname'], ENT_QUOTES) . "'>";
    $tpl['PUT:Email'] = "<input type='text' size='35' name='email' value='" . $_POST['email'] . "'>";
    $tpl['PUT:DayLimit'] = "<input type='text' size='3' name='day_limit' value='" . $SUMO['config']['accounts']['life'] . "'>";
    $tpl['PUT:NewPassword'] = "******";
    $tpl['PUT:ReNewPassword'] = "******";
    $tpl['PUT:IP'] = "<textarea rows='2' cols='40' name='ip'>" . $_POST['ip'] . "</textarea>";
    $tpl['PUT:AddGroupLevel'] = sumo_add_user_grouplevel('AddUsers');
    $tpl['PUT:Language'] = sumo_get_available_languages(1, 0, $_COOKIE['language']);
    $tpl['PUT:DataSourceType'] = sumo_put_datasource();
    $tpl['GET:AddForm'] = sumo_get_form_req('', 'add', '', 'POST', 'onsubmit=\'if(document.AddUsers.new_password.value!=""){document.AddUsers.new_password.value=hex_sha1(document.AddUsers.new_password.value);' . 'document.AddUsers.renew_password.value=hex_sha1(document.AddUsers.renew_password.value);}\'');
    // Status
    $tpl['GET:Status'] = "<font class='status-green'>" . $language['Active'] . "</font>";
    $tpl['IMG:Status'] = "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/users/user_on.gif' align='middle'>";
    $tpl['PUT:Status'] = "<select name='active'>\n<option value='1'>" . $language['Enable'] . "</option>\n<option value='0'>" . $language['Disable'] . "</option>\n</select>";
    // Pwd expiration date
    if ($SUMO['config']['accounts']['password']['life'] > 0) {
        $tpl['GET:PwdExpiration'] = sumo_get_human_date($SUMO['server']['time'] + $SUMO['config']['accounts']['password']['life'] * 86400);
    }
    $tpl['LINK:AddUser'] = sumo_get_action_icon("users", "new");
    $tpl['LINK:EditUser'] = sumo_get_action_icon("users", "edit");
    $tpl['LINK:Remove'] = sumo_get_action_icon("users", "delete");
} else {
    $action_error = true;
    $tpl['MESSAGE:H'] = $language['AccessDenied'];
}
Example #12
0
<?php

/**
 * SUMO MODULE: Users | Edit password
 * 
 * @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 = array('MESSAGE:H' => $tpl['MESSAGE:H'], 'MESSAGE:M' => $tpl['MESSAGE:M'], 'MESSAGE:L' => $tpl['MESSAGE:L'], 'PUT:NewPassword' => "<input type='password' class='password' size='20' name='new_password' autocomplete='off'>", 'PUT:ReNewPassword' => "<input type='password' class='password' size='20' name='renew_password' autocomplete='off'>", 'GET:FormName' => sumo_get_form_name('', 'modify_password'), 'GET:UpdateForm' => sumo_get_form_req('', 'modify_password'), 'BUTTON:Save' => '<input type="submit" class="button-green" value="' . $language["Save"] . '">', 'BUTTON:Cancel' => '<input type="button" class="button-red" value="' . $language["Cancel"] . '" onClick="sumo_remove_window(\'users\');">', 'GET:WindowScripts' => $tpl['GET:WindowScripts']);
Example #13
0
<?php

/**
 * SUMO MODULE: Network | New Local IP address
 * 
 * @version    0.2.10
 * @link       http://sumoam.sourceforge.net SUMO Access Manager
 * @author     Alberto Basso <*****@*****.**>
 * @copyright  Copyright &copy; 2003-2009, Alberto Basso
 * @package    SUMO
 * @category   Console
 */
switch ($_POST['type']) {
    case 'L':
        $type = $language['Locale'];
        break;
    case 'P':
        $type = $language['Proxy'];
        break;
    default:
        $type = '';
        break;
}
$tpl['PUT:LocalIPType'] = "<select name='type'>\n<option value='" . $_POST['type'] . "'>" . $type . "</option>\n" . "<option value='L'>" . $language['Locale'] . "</option>\n<option value='P'>" . $language['Proxy'] . "</option>\n" . "</select>";
$tpl['PUT:IP'] = "<input type='text' size='25' name='ip' value='" . $_POST['ip'] . "'>";
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_localip&id=" . $tab['id'] . "\");'>";
$tpl['GET:AddForm'] = sumo_get_form_req('', 'add_localip');