Beispiel #1
0
 * @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");
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=list\");'>";
Beispiel #2
0
} 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");
$tpl['LINK:Remove'] = $delete;
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=view&id=" . $tab['id'] . "\");'>";
// Use REQUEST method because when delete a group on AP
// the command came from a link
$visibility['SecurityOptions'] = $_REQUEST['SecurityOptions_visibility'] ? true : false;
$visibility['LayoutOptions'] = $_REQUEST['LayoutOptions_visibility'] ? true : false;
$tpl['LINK:SecurityOptions'] = sumo_get_action_link($form_name, 'SecurityOptions', $visibility['SecurityOptions']);
$tpl['LINK:LayoutOptions'] = sumo_get_action_link($form_name, 'LayoutOptions', $visibility['LayoutOptions']);
<?php

/**
 * SUMO MODULE: Network | View Datasource
 * 
 * @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_datasource_info($_GET['id'], FALSE);
$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 = array('GET:Theme' => $SUMO['page']['theme'], 'GET:MenuModule' => $tpl['GET:MenuModule'], 'GET:DataSourceName' => $tab['name'], 'GET:DataSourceType' => $language[$tab['type']], 'GET:DataSourceHost' => $tab['host'], 'GET:DataSourcePort' => $tab['port'], 'GET:DataSourceUser' => $tab['username'], 'GET:DataSourcePassword' => $tab['password'] != '' ? '*****' : '', 'GET:DBName' => $tab['db_name'], 'GET:DBTable' => $tab['db_table'], 'GET:DBFieldUser' => $tab['db_field_user'], 'GET:DBFieldPassword' => $tab['db_field_password'], 'GET:EncType' => $tab['enctype'], 'GET:LDAPBase' => $tab['ldap_base'], 'LINK:Add' => sumo_verify_permissions(4, 'sumo') ? sumo_get_action_icon("network", "add_datasource", "network.content", "?module=network&action=new_datasource&decoration=false") : sumo_get_action_icon("", "add_datasource"), 'LINK:Edit' => sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? sumo_get_action_icon("network", "edit_datasource", "network.content", "?module=network&action=edit_datasource&id=" . $tab['id'] . "&decoration=false") : sumo_get_action_icon("", "edit_datasource"), 'LINK:Remove' => sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? $delete : sumo_get_action_icon("", "remove_datasource"), 'BUTTON:Back' => "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network.content\",\"?module=network&action=dlist&decoration=false\");'>");
Beispiel #4
0
<?php

/**
 * SUMO MODULE: Network | View 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);
$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('AreYouSureDeleteNode', $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_node', '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_node.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
$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:Status' => $tab['active'] ? "<font class='status-green'>" . $language['Active'] . "</font>" : "<font class='status-red'>" . $language['Disabled'] . "</font>", 'GET:NodeName' => $tab['name'], 'GET:Host' => $tab['host'], 'GET:Port' => $tab['port'], 'GET:Protocol' => $tab['protocol'], 'GET:SumoPath' => $tab['sumo_path'], '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"), 'LINK:Edit' => sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? sumo_get_action_icon("network", "edit_node", "network.content", "?module=network&action=edit_node&id=" . $tab['id'] . "&decoration=false") : sumo_get_action_icon("", "edit_node"), 'LINK:Remove' => sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? $delete : sumo_get_action_icon("", "remove_node"), 'BUTTON:Back' => "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"network.content\",\"?module=network&action=nlist&decoration=false\");'>");
Beispiel #5
0
    $delete = sumo_get_action_icon("", "remove");
}
$node = sumo_get_node_info($tab['node']);
$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:Created'] = sumo_get_human_date($tab['created']);
$tpl['GET:Node'] = $node['name'];
$tpl['GET:Groups'] = implode(", ", $tab['usergroup']);
$tpl['GET:RegGroup'] = $tab['reg_group'];
$tpl['GET:Theme'] = ucfirst($tab['theme']);
$tpl['GET:Name'] = sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']);
$tpl['GET:Filtering'] = "<input type='checkbox' name='filtering' " . $checked['filtering'] . " disabled />";
$tpl['GET:ChangePwd'] = "<input type='checkbox' name='change_pwd' " . $checked['change_pwd'] . " disabled />";
$tpl['GET:Registration'] = "<input type='checkbox' name='registration' " . $checked['registration'] . " disabled />";
$tpl['GET:Path'] = "<input type='text' size='50' name='path' value='" . $tab['path'] . "' disabled />";
$tpl['GET:HTTPAuth'] = "<input type='checkbox' name='http_auth' " . $checked['http_auth'] . " disabled />";
$tpl['GET:PwdEncrypt'] = "<input type='checkbox' name='pwd_encrypt' " . $checked['pwd_encrypt'] . " disabled />";
$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_verify_permissions(4, 'sumo') ? sumo_get_action_icon("", "edit", "accesspoints.content", "?module=accesspoints&action=edit&id=" . $tab['id'] . "&decoration=false") : sumo_get_action_icon("", "edit");
$tpl['LINK:Remove'] = $delete;
$tpl['BUTTON:Back'] = "<input type='button' class='button-red' value='" . $language["Back"] . "' onclick='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=list\");'>";
// Use REQUEST method because when delete a group on AP
// the command came from a link
$visibility['SecurityOptions'] = $_REQUEST['SecurityOptions_visibility'] ? true : false;
$visibility['LayoutOptions'] = $_REQUEST['LayoutOptions_visibility'] ? true : false;
$tpl['LINK:SecurityOptions'] = sumo_get_action_link($form_name, 'SecurityOptions', $visibility['SecurityOptions']);
$tpl['LINK:LayoutOptions'] = sumo_get_action_link($form_name, 'LayoutOptions', $visibility['LayoutOptions']);
// delete old refresh window and update
$tpl['GET:WindowScripts'] .= 'sumo_unrefresh_window("accesspoints");';
Beispiel #6
0
     $tpl['PUT:Language'] = ucfirst(sumo_get_string_languages($tab['language']));
     $tpl['PUT:Email'] = "<a href='mailto:" . $tab['email'] . "' title='Send e-mail'>" . $tab['email'] . "</a>";
     $tpl['PUT:UserImage'] = "";
 }
 // to change IP
 if (in_array('sumo', $SUMO['user']['group']) || $SUMO['user']['id'] == $tab['owner_id']) {
     $tpl['PUT:IP'] = "<textarea rows='2' cols='40' name='ip'>" . implode("; ", $tab['ip']) . "</textarea>";
 } else {
     $tpl['PUT:IP'] = implode("; ", $tab['ip']);
 }
 // Remove
 if ((in_array('sumo', $SUMO['user']['group']) || sumo_verify_permissions(7, $tab['group']) || $SUMO['user']['id'] == $tab['owner_id']) && $tab['username'] != 'sumo' && $tab['username'] != $SUMO['user']['user']) {
     $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('AreYouSureDelete', array($tab['username'], htmlspecialchars($tab['firstname'], ENT_QUOTES), htmlspecialchars($tab['lastname'], ENT_QUOTES)))) . "', \n\t\t\t\t\t\t\t 'h', 0,\n\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'delete', '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'>" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/users/delete.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
 } else {
     $tpl['LINK:Remove'] = sumo_get_action_icon("users", "delete");
 }
 // on submit
 $submit = 'if(document.ModifyUsers.new_password.value!="")' . '{document.ModifyUsers.new_password.value=hex_sha1(document.ModifyUsers.new_password.value);' . 'document.ModifyUsers.renew_password.value=hex_sha1(document.ModifyUsers.renew_password.value);}';
 // ...to change password
 if (($SUMO['user']['user'] == $tab['username'] || $SUMO['user']['id'] == $tab['owner_id'] || $SUMO['user']['user'] == 'sumo') && in_array($datasource['type'], array('SUMO', 'MySQLUsers', 'Joomla15'))) {
     $tpl['PUT:NewPassword'] = "******";
     $tpl['PUT:ReNewPassword'] = "******";
     $tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify', 'id=' . $tab['id']);
 }
 // Pwd expiration date
 if ($SUMO['config']['accounts']['password']['life'] > 0 && $datasource['type'] == 'SUMO' && $tab['pwd_updated']) {
     $tpl['GET:PwdExpiration'] = sumo_get_human_date($tab['pwd_updated'] + $SUMO['config']['accounts']['password']['life'] * 86400);
 } elseif (!$tab['pwd_updated']) {
     $tpl['GET:PwdExpiration'] = '';
 } else {
$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);";
}
$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");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit_datasource");
$tpl['LINK:Remove'] = sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? $delete : sumo_get_action_icon("", "remove_datasource");
/*
$visibility['DatabaseOptions']   = $tab['db_name']   ? true : false;
$visibility['LDAPOptions']       = $tab['ldap_base'] ? true : false;

$tpl['LINK:DatabaseOptions']     = sumo_get_action_link('network.modify_datasource', 'DatabaseOptions', $visibility['DatabaseOptions']);
$tpl['LINK:LDAPOptions']         = sumo_get_action_link('network.modify_datasource', 'LDAPOptions',     $visibility['LDAPOptions']);
*/
$visibility['DatabaseOptions'] = $_POST['DatabaseOptions_visibility'] ? 1 : 0;
$visibility['LDAPOptions'] = $_POST['LDAPOptions_visibility'] ? 1 : 0;
$tpl['LINK:DatabaseOptions'] = '<div onclick=\'javascript:ShowHideSubModule("network.modify_datasource.DatabaseOptions");\'><input type="hidden" value="' . $visibility['DatabaseOptions'] . '" name="DatabaseOptions_visibility"></div>' . '<div style="visibility: hidden; position: absolute;" id="network.modify_datasource.DatabaseOptions">';
$tpl['LINK:LDAPOptions'] = '<div onclick=\'javascript:ShowHideSubModule("network.modify_datasource.LDAPOptions");\'><input type="hidden" value="' . $visibility['LDAPOptions'] . '" name="LDAPOptions_visibility"></div>' . '<div style="visibility: hidden; position: absolute;" id="network.modify_datasource.LDAPOptions">';
// Bugfix
$tpl['GET:WindowScripts'] = $tab['db_name'] ? "setTimeout('ShowElement(\"network.modify_datasource.DatabaseOptions\")',100);" : "";
Beispiel #9
0
$tpl['PUT:logs.access.database.life'] = "<input type='text' size='5' name='config[logs][access][database][life]' value='" . $conf['logs']['access']['database']['life'] . "'>";
$tpl['PUT:logs.access.file.enabled'] = $conf['logs']['access']['file']['enabled'] ? "<input type='checkbox' name='config[logs][access][file][enabled]' checked='checked'>" : "<input type='checkbox' name='config[logs][access][file][enabled]'>";
$tpl['PUT:logs.access.file.life'] = "<input type='text' size='5' name='config[logs][access][file][life]' value='" . $conf['logs']['access']['file']['life'] . "'>";
$tpl['PUT:logs.access.file.size'] = "<input type='text' size='5' name='config[logs][access][file][size]' value='" . $conf['logs']['access']['file']['size'] . "'>";
$tpl['PUT:logs.access.email.enabled'] = $conf['logs']['access']['email']['enabled'] ? "<input type='checkbox' name='config[logs][access][email][enabled]' checked='checked'>" : "<input type='checkbox' name='config[logs][access][email][enabled]'>";
// Sessions & Connections
$tpl['PUT:connections.timeout'] = "<input type='text' size='5' name='config[connections][timeout]' value='" . $conf['connections']['timeout'] . "'>";
$tpl['PUT:sessions.timeout'] = "<input type='text' size='5' name='config[sessions][timeout]' value='" . $conf['sessions']['timeout'] . "'>";
$tpl['PUT:sessions.auto_regenerate_id'] = $conf['sessions']['auto_regenerate_id'] ? "<input type='checkbox' name='config[sessions][auto_regenerate_id]' checked='checked'>" : "<input type='checkbox' name='config[sessions][auto_regenerate_id]'>";
if (SUMO_SESSIONS_REPLICA) {
    $tpl['PUT:sessions.auto_regenerate_id'] = "<input type='checkbox' name='config[sessions][auto_regenerate_id]' disabled>";
}
// Database
$tpl['PUT:database.optimize_hits'] = "<input type='text' size='5' name='config[database][optimize_hits]' value='" . $conf['database']['optimize_hits'] . "'>";
$tpl['GET:database.optimize_hits.counter'] = @file_get_contents(SUMO_PATH . '/tmp/hits/hits.' . $conf['database']['optimize_hits']);
$tpl['LINK:EditSettings'] = sumo_get_action_icon("settings", "edit");
// Set sub module visibility
$visibility['GenericOptions'] = $_REQUEST['GenericOptions_visibility'] ? true : false;
$visibility['ConsoleOptions'] = $_REQUEST['ConsoleOptions_visibility'] ? true : false;
$visibility['SecurityOptions'] = $_REQUEST['SecurityOptions_visibility'] ? true : false;
$visibility['SessionsOptions'] = $_REQUEST['SessionsOptions_visibility'] ? true : false;
$visibility['AccountsOptions'] = $_REQUEST['AccountsOptions_visibility'] ? true : false;
$visibility['LoggingOptions'] = $_REQUEST['LoggingOptions_visibility'] ? true : false;
$visibility['AccessPointOptions'] = $_REQUEST['AccessPointOptions_visibility'] ? true : false;
// see action.stats.php
$tpl['LINK:GenericOptions'] = sumo_get_action_link('ModifySettings', 'GenericOptions', $visibility['GenericOptions']);
$tpl['LINK:ConsoleOptions'] = sumo_get_action_link('ModifySettings', 'ConsoleOptions', $visibility['ConsoleOptions']);
$tpl['LINK:SecurityOptions'] = sumo_get_action_link('ModifySettings', 'SecurityOptions', $visibility['SecurityOptions']);
$tpl['LINK:SessionsOptions'] = sumo_get_action_link('ModifySettings', 'SessionsOptions', $visibility['SessionsOptions']);
$tpl['LINK:AccountsOptions'] = sumo_get_action_link('ModifySettings', 'AccountsOptions', $visibility['AccountsOptions']);
$tpl['LINK:LoggingOptions'] = sumo_get_action_link('ModifySettings', 'LoggingOptions', $visibility['LoggingOptions']);
Beispiel #10
0
$tpl['GET:logs.system.file.size'] = $conf['logs']['system']['file']['size'];
$tpl['GET:logs.system.email.enabled'] = $conf['logs']['system']['email']['enabled'] ? $yes : $no;
// Log Manager: Errors
$tpl['GET:logs.errors.database.enabled'] = $conf['logs']['errors']['database']['enabled'] ? $yes : $no;
$tpl['GET:logs.errors.database.life'] = $conf['logs']['errors']['database']['life'];
$tpl['GET:logs.errors.file.enabled'] = $conf['logs']['errors']['file']['enabled'] ? $yes : $no;
$tpl['GET:logs.errors.file.life'] = $conf['logs']['errors']['file']['life'];
$tpl['GET:logs.errors.file.size'] = $conf['logs']['errors']['file']['size'];
$tpl['GET:logs.errors.email.enabled'] = $conf['logs']['errors']['email']['enabled'] ? $yes : $no;
// Log Manager: Access
$tpl['GET:logs.access.database.enabled'] = $conf['logs']['access']['database']['enabled'] ? $yes : $no;
$tpl['GET:logs.access.database.life'] = $conf['logs']['access']['database']['life'];
$tpl['GET:logs.access.file.enabled'] = $conf['logs']['access']['file']['enabled'] ? $yes : $no;
$tpl['GET:logs.access.file.life'] = $conf['logs']['access']['file']['life'];
$tpl['GET:logs.access.file.size'] = $conf['logs']['access']['file']['size'];
$tpl['GET:logs.access.email.enabled'] = $conf['logs']['access']['email']['enabled'] ? $yes : $no;
// Sessions & Connections
$tpl['GET:sessions.timeout'] = sumo_convert_sec2hms($conf['sessions']['timeout']);
$tpl['GET:connections.timeout'] = sumo_convert_sec2hms($conf['connections']['timeout']);
$tpl['GET:sessions.auto_regenerate_id'] = $conf['sessions']['auto_regenerate_id'] ? $yes : $no;
// Database
$tpl['GET:database.optimize_hits'] = $conf['database']['optimize_hits'];
$tpl['GET:database.optimize_hits.counter'] = @file_get_contents(SUMO_PATH . '/tmp/hits/hits.' . $conf['database']['optimize_hits']);
$tpl['LINK:EditSettings'] = sumo_get_action_icon("settings", "edit", "settings.content", "?module=settings&action=edit&decoration=false");
$tpl['LINK:GenericOptions'] = sumo_get_action_link('settings.view', 'GenericOptions');
$tpl['LINK:ConsoleOptions'] = sumo_get_action_link('settings.view', 'ConsoleOptions');
$tpl['LINK:SecurityOptions'] = sumo_get_action_link('settings.view', 'SecurityOptions');
$tpl['LINK:SessionsOptions'] = sumo_get_action_link('settings.view', 'SessionsOptions');
$tpl['LINK:AccountsOptions'] = sumo_get_action_link('settings.view', 'AccountsOptions');
$tpl['LINK:LoggingOptions'] = sumo_get_action_link('settings.view', 'LoggingOptions');
$tpl['LINK:AccessPointOptions'] = sumo_get_action_link('settings.view', 'AccessPointOptions');
Beispiel #11
0
    if ($col[4]) {
        $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"users.content\",\"?module=users&action=view&id=" . $tab['id'] . "&decoration=false\");' title='" . $language['ViewUser'] . "'>" . $username . "</a></td>\n";
    }
    if ($col[8]) {
        $list .= " <td class='" . $style . "' nowrap>" . $group . "</td>\n";
    }
    if ($col[9]) {
        $list .= " <td class='" . $style . "' nowrap><a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_datasource&id=" . $tab['datasource_id'] . "\");'>" . $tab['datasource_id'] . $datasource[$tab['datasource_id']] . "</a></td>\n";
    }
    if ($col[13]) {
        $list .= " <td class='" . $style . "' align='right' nowrap>" . $tab['email'] . "</td>\n";
    }
    if ($col[12]) {
        $list .= " <td class='" . $style . "' align='right'><img src='themes/" . $SUMO['page']['theme'] . "/images/flags/" . $tab['language'] . ".png'>&nbsp;&nbsp;" . ucfirst($users_lang[$tab['language']]) . "</td>\n";
    }
    if ($col[10]) {
        $list .= " <td class='" . $style . "' align='right'>" . $last_login . "</td>\n";
    }
    if ($col[15]) {
        $list .= " <td class='" . $style . "' align='right'>" . $created . "</td>\n";
    }
    if ($col[11]) {
        $list .= " <td class='" . $style . "' align='right'>" . $expire . "</td>\n";
    }
    $list .= "</tr>\n";
}
$list .= "</table>";
$searched = $search ? $_SESSION['search_users_list'] : '';
// 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:NumUsers' => number_format($users, 0, "", "."), 'GET:NumUsersActive' => number_format($active, 0, "", "."), 'GET:NumSuspendedUsers' => "<a href='javascript:sumo_ajax_get(\"users.content\",\"index.php?start_users_list=0&module=users&action=list&om=0&oc=6&decoration=false\");'>" . number_format($users - $active, 0, "", ".") . "</a>", 'GET:UsersList' => $list, 'GET:TotalRows' => number_format($tot, 0, "", "."), 'GET:StartRow' => number_format($_SESSION['start_users_list'], 0, "", "."), 'GET:EndRow' => number_format($_SESSION['start_users_list'] + $vis, 0, "", "."), 'GET:PagingResults' => sumo_paging_results($tot, $vis, $_SESSION['rows_users_list'], 5, $_SESSION['start_users_list'], 'start_users_list', 'list'), 'GET:TableSettings' => sumo_get_table_settings($table['data']['list']), 'GET:SearchForm' => sumo_get_form_search($searched), 'GET:ExportData' => sumo_get_export_data(), 'LINK:AddUser' => sumo_get_action_icon("", "new", "users.content", "?module=users&action=new&decoration=false"));
$tpl['GET:Pagination'] = $tot > 0 ? $tpl['GET:StartRow'] . "..." . $tpl['GET:EndRow'] . "&nbsp;&nbsp;" . $language['of'] . "&nbsp;<b>" . $tpl['GET:TotalRows'] . "</b>" : "";
Beispiel #12
0
<?php

/**
 * SUMO MODULE: Groups | Edit Group
 * 
 * @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_group_info($_GET['id']);
$tpl['GET:EditForm'] = sumo_get_form_req('', 'modify', 'id=' . $tab['id']);
//$tpl['GET:Relationship'] = "<img src='services.php?module=groups&service=relationship&cmd=GET_USERS&id=".$tab['id']."'>";
$tpl['PUT:GroupName'] = "<input type='hidden' name='id' value='" . $tab['id'] . "' />" . "<input type='text' size='35' name='groupname' value='" . $tab['usergroup'] . "' />" . "<input type='hidden' name='oldgroup' value='" . $tab['usergroup'] . "' />";
$tpl['PUT:GroupDesc'] = "<input type='text' size='35' name='groupdesc' value='" . $tab['description'] . "' />";
$tpl['LINK:AddGroup'] = sumo_get_action_icon("groups", "add", "groups.content", "?module=groups&action=new&decoration=false");
$tpl['LINK:EditGroup'] = sumo_get_action_icon("groups", "edit");
$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('AreYouSureDelete', array($tab['usergroup'], htmlspecialchars($tab['description'], ENT_QUOTES)))) . "', \n                                                                         'h', 0, \n\t\t\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'delete', 'id=' . $tab['id'])) . "',\n                                        \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 );\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/groups/delete.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
Beispiel #13
0
    if ($col[100]) {
        $list .= " <td '" . $style2 . "'>" . $status . "</td>\n";
    }
    if ($col[2]) {
        $list .= " <td class='" . $style . "'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/network/" . $active . ".gif'></td>\n";
    }
    if ($col[5]) {
        $list .= " <td class='" . $style . "'>" . "<a href='javascript:sumo_ajax_get(\"network.content\",\"?module=network&action=view_node&id=" . $tab['id'] . "&decoration=false\");'>" . $tab['name'] . "</a></td>\n";
    }
    if ($col[3]) {
        $list .= " <td class='" . $style . "' align='right'>" . $tab['host'] . "</td>\n";
    }
    if ($col[4]) {
        $list .= " <td class='" . $style . "' align='right'>" . $tab['port'] . "</td>\n";
    }
    if ($col[6]) {
        $list .= " <td class='" . $style . "'>" . $tab['protocol'] . "</td>\n";
    }
    if ($col[7]) {
        $list .= " <td class='" . $style . "'>" . $tab['sumo_path'] . "</td>\n";
    }
    if ($col[8]) {
        $list .= " <td class='" . $style . "' align='right'>" . $ap . "</td>\n";
    }
    $list .= "</tr>\n";
}
$list .= "</table>";
$searched = $search ? $_SESSION['search_network_nlist'] : '';
// 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:NodesList' => $list, 'GET:TotalRows' => number_format($tot, 0, "", "."), 'GET:StartRow' => number_format($_SESSION['start_network_nlist'], 0, "", "."), 'GET:EndRow' => number_format($_SESSION['start_network_nlist'] + $vis, 0, "", "."), 'GET:PagingResults' => sumo_paging_results($tot, $vis, $_SESSION['rows_network_nlist'], 5, $_SESSION['start_network_nlist'], 'start_network_nlist'), 'GET:TableSettings' => sumo_get_table_settings($table['data']['nlist']), 'GET:SearchForm' => sumo_get_form_search($searched), 'GET:ExportData' => '', 'LINK:AddNode' => 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"), 'BUTTON:TestConnection' => "<input value='" . $language['TestConnection'] . "' type='button' class='button' onclick='javascript:sumo_ajax_get(\"network.content\",\"?module=network&action=nlist&test=1&network_nlist_view_col=100.1&decoration=false" . "\");'>");
$tpl['GET:Pagination'] = $tot > 0 ? $tpl['GET:StartRow'] . "..." . $tpl['GET:EndRow'] . "&nbsp;&nbsp;" . $language['of'] . "&nbsp;<b>" . $tpl['GET:TotalRows'] . "</b>" : "";
Beispiel #14
0
        if ($col[8]) {
            $list .= " <td class='" . $style . "' align='center'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/accesspoints/" . $pwd_encrypt . ".gif'></td>\n";
        }
        if ($col[9]) {
            $list .= " <td class='" . $style . "' align='center'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/accesspoints/" . $registration . ".gif'></td>\n";
        }
        if ($col[10]) {
            $list .= " <td class='" . $style . "' align='center'>" . $tab['reg_group'] . "</td>\n";
        }
        if ($col[11]) {
            $list .= " <td class='" . $style . "' align='center'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/accesspoints/" . $change_pwd . ".gif'></td>\n";
        }
        if ($col[12]) {
            $list .= " <td class='" . $style . "'>" . $theme . "</td>\n";
        }
        if ($col[13]) {
            $list .= " <td class='" . $style . "'>" . $created . "</td>\n";
        }
        if ($col[14]) {
            $list .= " <td class='" . $style . "'>" . $updated . "</td>\n";
        }
        $list .= "</tr>\n";
    }
    $list .= "</table>";
} else {
    $list = "<div class='no-results'>" . $language['AccesspointsNotFound'] . "</div>";
}
$searched = $search ? $_SESSION['search_accesspoints_list'] : '';
// Template Data
$tpl = array('MESSAGE:H' => $tpl['MESSAGE:H'], 'MESSAGE:M' => $tpl['MESSAGE:M'], 'MESSAGE:L' => $tpl['MESSAGE:L'], 'GET:MenuModule' => $tpl['GET:MenuModule'], 'GET:AccessPointsList' => $list, 'GET:TotalRows' => number_format($tot, 0, "", "."), 'GET:StartRow' => number_format($_SESSION['start_accesspoints_list'], 0, "", "."), 'GET:EndRow' => number_format($_SESSION['start_accesspoints_list'] + $vis, 0, "", "."), 'GET:PagingResults' => sumo_paging_results($tot, $vis, $_SESSION['rows_accesspoints_list'], 5, $_SESSION['start_accesspoints_list'], 'start_accesspoints_list'), 'GET:TableSettings' => sumo_get_table_settings($table['data']['list']), 'GET:SearchForm' => sumo_get_form_search($searched), 'GET:ExportData' => sumo_get_export_data(), 'LINK:AddAccessPoint' => sumo_verify_permissions(5, 'sumo') ? sumo_get_action_icon("", "add", "accesspoints.content", "?module=accesspoints&action=new&decoration=false") : sumo_get_action_icon("", "add"));
$tpl['GET:Pagination'] = $tot > 0 ? $tpl['GET:StartRow'] . "..." . $tpl['GET:EndRow'] . "&nbsp;&nbsp;" . $language['of'] . "&nbsp;<b>" . $tpl['GET:TotalRows'] . "</b>" : "";