Esempio n. 1
0
function print_newvps()
{
    global $xtpl;
    $xtpl->title(_("Create VPS"));
    $xtpl->form_create('?page=adminvps&section=vps&action=new2&create=1', 'post');
    $xtpl->form_add_input(_("Hostname") . ':', 'text', '30', 'vps_hostname', '', _("A-z, a-z"), 30);
    $xtpl->form_add_select(_("HW server") . ':', 'vps_server', list_servers(), '2', '');
    $xtpl->form_add_select(_("Owner") . ':', 'm_id', members_list(), '', '');
    $xtpl->form_add_select(_("Distribution") . ':', 'vps_template', list_templates(), '', '');
    $xtpl->form_add_select(_("RAM") . ':', 'vps_privvmpages', list_limit_privvmpages(), '1', '');
    $xtpl->form_add_select(_("Disk space") . ':', 'vps_diskspace', list_limit_diskspace(), '1', '');
    $xtpl->form_add_checkbox(_("Boot on create") . ':', 'boot_after_create', '1', true, $hint = '');
    $xtpl->form_add_textarea(_("Extra information about VPS") . ':', 28, 4, 'vps_info', '', '');
    $xtpl->table_add_category(' ');
    $xtpl->table_add_category(' ');
    $xtpl->table_add_category(' ');
    $xtpl->form_out(_("Create"));
}
Esempio n. 2
0
 function list_admin_menu()
 {
     $CI =& get_instance();
     $active = $CI->uri->segment(1);
     $sub = $CI->uri->segment(2);
     if ($sub == 'page') {
         $sub = '';
     }
     $menu = array(array('name' => 'Dashboard', 'controllers' => array(''), 'link' => ''), array('name' => 'Admin', 'controllers' => array('admin'), 'link' => 'controller_admin', 'links' => array('General' => 'admin/general', 'Account Codes' => 'admin/account_codes', 'Discretionary Accounts' => 'admin/discretionary_accounts', 'Office Locations' => 'admin/locations', 'User Settings' => 'admin/user_settings', 'Calendar Settings' => 'admin/calendar_settings')), array('name' => 'Users', 'controllers' => array('users'), 'link' => 'controller_users', 'links' => array('My Profile' => 'users/my_profile', 'Users List' => 'users', 'Add User' => 'users/add', 'Manage Roles' => 'users/manage_roles')), array('name' => 'Chapter Financials', 'controllers' => array('projects', 'budget'), 'link' => 'controller_projects', 'links' => array('Budgets' => array('Budget Managers' => 'budget'), 'Projects' => array('General Fund Projects' => 'projects/general_fund', 'Grant Actuals' => 'projects/grant_actuals'))), array('name' => 'Chapter Procurement', 'controllers' => array('procurement'), 'link' => 'controller_procurement', 'links' => list_templates()), array('name' => 'Timesheet', 'controllers' => array('timesheet'), 'link' => 'controller_timesheet', 'links' => array('Timesheets' => 'timesheet', 'New Timesheet' => 'timesheet/new_timesheet', 'My Timesheets' => 'timesheet/my_timesheets', 'Templates' => 'timesheet/template_list', 'New Template' => 'timesheet/new_template', 'Manage Emails' => 'timesheet/emails')), array('name' => 'Time Off', 'controllers' => array('timeoff'), 'link' => 'controller_timeoff', 'links' => array('Time Off Requests' => 'timeoff', 'My Requests' => 'timeoff/my_timeoff_requests', 'Request Time Off' => 'timeoff/new_timeoff_request', 'Manage Emails' => 'timeoff/emails')), array('name' => 'Travel Reimbursement', 'controllers' => array('travel'), 'link' => 'controller_travel', 'links' => array('Recent Reimbursement' => 'travel', 'New Reimbursement Request' => 'travel/new_travel_request', 'My Travel Reimbursements' => 'travel/my_travel_requests', 'Manage Emails' => 'travel/emails')), array('name' => 'Labor Accounts', 'controllers' => array('labor'), 'link' => 'controller_labor', 'links' => array('Accounts' => 'labor', 'New Account' => 'labor/new_account')), array('name' => 'Volunteers', 'controllers' => array('volunteers'), 'link' => 'controller_volunteers', 'links' => array('List' => 'volunteers', 'New' => 'volunteers/add')), array('name' => 'Grants', 'controllers' => array('grants'), 'link' => 'controller_grants', 'links' => array('List' => 'grants', 'New' => 'grants/add')), array('name' => 'Resource Calendar', 'controllers' => array('calendar'), 'link' => 'controller_calendar', 'links' => array('View Calendar' => 'calendar', 'Reserve Resource' => 'calendar/reserve', 'My Reservations' => 'calendar/my_reservations')));
     echo '<div class="menu ui-accordion ui-widget ui-helper-reset ui-accordion-icons">';
     foreach ($menu as $m) {
         if (can_this_user($m['link']) || $m['link'] == '') {
             echo '<h3 class="ui-accordion-header ui-helper-reset ui-state-default' . (in_array($active, $m['controllers']) ? ' ui-state-active' : '') . '"><span class="ui-icon ui-icon-triangle-1-' . (in_array($active, $m['controllers']) ? 's' : 'e') . '"></span>' . anchor($m['link'], $m['name'], 'class="topLevel"') . '</h3>';
             if (array_key_exists('links', $m)) {
                 echo '<div class="subMenu' . (in_array($active, $m['controllers']) ? ' ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active ui-state-hover' : ' ui-state-hover') . '">';
                 echo '<ul class="subMenuList">';
                 foreach ($m['links'] as $name => $link) {
                     if (@can_this_user($link) || is_array($link)) {
                         if (!is_array($link)) {
                             $class = $link == $active . ($sub != '' ? '/' . $sub : '') ? 'class="active"' : '';
                             echo '<li>' . anchor($link, ucwords($name), $class) . '</li>';
                         } else {
                             $class = $link == $active . ($sub != '' ? '/' . $sub : '') ? 'class="active"' : '';
                             echo '<li>' . $name;
                             echo '<ul>';
                             foreach ($link as $n => $l) {
                                 if (can_this_user($l)) {
                                     $class = $l == $active . ($sub != '' ? '/' . $sub : '') ? 'class="active"' : '';
                                     echo '<li>' . anchor($l, ucwords($n), $class) . '</li>';
                                 }
                             }
                             echo '</ul>';
                             echo '</li>';
                         }
                     }
                 }
                 echo '</ul>';
                 echo '</div>';
             }
         }
     }
     echo '</div>';
     echo '<p>' . anchor('logout', 'LOGOUT', 'class="button"') . '</p>';
 }
Esempio n. 3
0
function print_newvps()
{
    global $xtpl, $cluster;
    $xtpl->title(_("Create VPS"));
    $xtpl->form_create('?page=adminvps&section=vps&action=new2&create=1', 'post');
    $xtpl->form_add_input(_("Hostname") . ':', 'text', '30', 'vps_hostname', '', _("A-z, a-z"), 255);
    if ($_SESSION["is_admin"]) {
        $xtpl->form_add_select(_("HW server") . ':', 'vps_server', list_servers(false, array("node")), '2', '');
        $xtpl->form_add_select(_("Owner") . ':', 'm_id', members_list(), '', '');
    }
    $xtpl->form_add_select(_("Distribution") . ':', 'vps_template', list_templates(false), '', '');
    if ($_SESSION["is_admin"]) {
        //$xtpl->form_add_select(_("IPv4").':', 'ipv4', get_all_ip_list(4), '1', '');
        $xtpl->form_add_checkbox(_("Boot on create") . ':', 'boot_after_create', '1', true, $hint = '');
        $xtpl->form_add_textarea(_("Extra information about VPS") . ':', 28, 4, 'vps_info', '', '');
    }
    $xtpl->table_add_category('&nbsp;');
    $xtpl->table_add_category('&nbsp;');
    $xtpl->table_add_category('&nbsp;');
    $xtpl->form_out(_("Create"));
}
Esempio n. 4
0
        if (isset($_POST['id'])) {
            $id = $_POST['id'];
            template_deleterecord($id);
        }
        break;
    case 'insert':
        template_insert();
        break;
    case 'update':
        if (isset($_POST['id'])) {
            $id = $_POST['id'];
            template_update($id);
        }
        break;
    default:
        list_templates();
        break;
}
//end switch
exit(0);
/*
template_deleterecord($id = '')

Delete a Blog Data record (no recovery)
*/
function template_deleterecord($id = '')
{
    debug_msg("FUNCTION: " . __FUNCTION__, 4);
    db_delete_templates($id);
    // If no headers are sent, send one
    if (!headers_sent()) {
Esempio n. 5
0
     $xtpl->table_td($row["m_year"]);
     $xtpl->table_tr();
     $xtpl->table_td(_("Jabber") . ':');
     $xtpl->table_td($row["m_jabber"]);
     $xtpl->table_tr();
     $xtpl->table_td(_("How") . ':');
     $xtpl->table_td($row["m_how"]);
     $xtpl->table_tr();
     $xtpl->table_td(_("Note") . ':');
     $xtpl->table_td($row["m_note"]);
     $xtpl->table_tr();
     $xtpl->table_td(_("Currency") . ':');
     $xtpl->table_td($row["m_currency"]);
     $xtpl->table_tr();
     $xtpl->form_add_checkbox(_("Create VPS") . ':', 'm_create_vps', '1', true);
     $xtpl->form_add_select(_("Distribution") . ':', 'm_distribution', list_templates(false), $row["m_distribution"]);
     $xtpl->form_add_select(_("Location") . ':', 'm_location', $cluster->list_locations(), $row["m_location"]);
     $empty = array("" => _("pick automatically"));
     $nodes = list_servers(false, array('node'));
     $xtpl->form_add_select(_("Node") . ':', 'm_node', $empty + $nodes);
     $xtpl->form_add_checkbox(_("Assign IP addresses") . ':', 'm_assign_ips', '1', true);
     $xtpl->form_add_select(_("IPv4") . ':', 'ipv4', array_merge($empty, get_free_ip_list(4, $row["m_location"])), '', _("listing IPs from application location only"));
     $xtpl->form_add_select(_("IPv6") . ':', 'ipv6', array_merge($empty, get_free_ip_list(6, $row["m_location"])), '', _("listing IPs from application location only"));
     $xtpl->form_add_input(_("Admin response") . ':', 'text', '30', 'm_admin_response', $row["m_admin_response"]);
     $xtpl->table_td('');
     $xtpl->table_td($xtpl->html_submit(_("Approve"), "approve") . $xtpl->html_submit(_("Deny"), "deny") . $xtpl->html_submit(_("Invalidate"), "invalidate") . $xtpl->html_submit(_("Ignore"), "ignore"));
     $xtpl->table_tr();
     $xtpl->form_out_raw();
     break;
 case "change":
     $xtpl->table_add_category(_("Personal information"));
Esempio n. 6
0
<?php

/*	Copyright (c) 2014 Freeder
 *	Released under a MIT License.
 *	See the file LICENSE at the root of this repo for copying permission.
 */
// TODO: Modularize me!
require_once 'inc/init.php';
require_once 'inc/feeds.php';
require_once 'inc/entries.php';
require_auth();
$feeds = get_feeds();
$tpl->assign('config', $config, RainTPL::RAINTPL_HTML_SANITIZE);
$tpl->assign('templates', list_templates(), RainTPL::RAINTPL_HTML_SANITIZE);
$tpl->assign('feeds', $feeds, RainTPL::RAINTPL_XSS_SANITIZE);
// Handle posted info for settings
if (!empty($_POST['synchronization_type']) && !empty($_POST['template']) && !empty($_POST['timezone']) && isset($_POST['import_tags_from_feeds']) && isset($_POST['anonymous_access']) && isset($_POST['entries_to_keep']) && !empty($_POST['display_entries']) && isset($_POST['entries_per_page']) && isset($_POST['share_input_shaarli']) && isset($_POST['share_input_diaspora']) && !empty($_POST['token']) && check_token(600, 'settings_form')) {
    if ($config->synchronization_type != $_POST['synchronization_type']) {
        $config->synchronization_type = $_POST['synchronization_type'];
        require_once INC_DIR . 'cron.php';
        if ($config->synchronization_type == 'cron') {
            register_crontask('0 * * * * cd ' . dirname(__FILE__) . '../ && php refresh.php > logs/cron.log 2>&1  # FREEDER AUTOADDED CRONTASK');
        } else {
            unregister_crontask('# FREEDER AUTOADDED CRONTASK');
        }
    }
    // Template
    if (is_dir(TPL_DIR . $_POST['template'])) {
        $config->template = $_POST['template'];
        if (!endswith($config->template, '/')) {
            $config->template = $config->template . '/';
Esempio n. 7
0
        $xtpl->sbar_add(_("Back"), '?page=cluster');
    }
    if ($mass_management) {
        $xtpl->title(_("Mass managenent"));
        $xtpl->table_title(_("Filters"));
        $xtpl->form_create('', 'get');
        $xtpl->table_td('<input type="hidden" name="page" value="cluster">
	                 <input type="hidden" name="action" value="mass_management">' . _('Locations') . ':');
        $xtpl->form_add_select_pure('l[]', $cluster->list_locations(), $_GET["l"], true, '10');
        $xtpl->table_td(_('Nodes') . ':');
        $xtpl->form_add_select_pure('n[]', $cluster->list_servers(), $_GET["n"], true, '10');
        $xtpl->table_tr();
        $xtpl->table_td(_('Owners') . ':');
        $xtpl->form_add_select_pure('o[]', members_list(), $_GET["o"], true, '10');
        $xtpl->table_td(_('Templates') . ':');
        $xtpl->form_add_select_pure('t[]', list_templates(), $_GET["t"], true, '10');
        $xtpl->table_tr();
        $xtpl->table_td(_('State') . ':');
        $xtpl->form_add_select_pure('state', array("" => _("All"), 1 => _("Running"), 2 => _("Stopped")), $_GET["state"]);
        $xtpl->table_td(_('Backup lock') . ':');
        $xtpl->form_add_select_pure('backup_lock', array("" => _("All"), 1 => _("Locked"), 2 => _("Unlocked")), $_GET["backup_lock"]);
        $xtpl->table_tr();
        $xtpl->table_td(_("Has mount on") . ':');
        $xtpl->form_add_select_pure('m[]', $cluster->list_servers_with_type("storage"), $_GET["m"], true, '5');
        $xtpl->table_td(_("Has configs") . ':');
        $xtpl->form_add_select_pure('c[]', list_configs(), $_GET["c"], true, '5');
        $xtpl->table_tr();
        $xtpl->table_td(_("Has DNS resolvers") . ':');
        $xtpl->form_add_select_pure('r[]', list_dns_resolvers(), $_GET["r"], true, '5');
        $xtpl->table_tr();
        $xtpl->form_out(_("Show"), null, '', '3');