Exemplo n.º 1
0
 case 'ajax':
     if (isset($client_command) && in_array($client_command, $ajax_commands)) {
         switch ($client_command) {
             case 'family_members':
                 if (isset($action_command)) {
                     switch ($action_command) {
                         case 'new':
                             create_client(post('id'), post('name'), '', post('gender'), post('dob'));
                             exit;
                             break;
                         case 'save':
                             edit_client(post('id'), post('name'), '', post('gender'), post('dob'));
                             exit;
                             break;
                         case 'delete':
                             delete_client(post('id'));
                             exit;
                             break;
                         default:
                             redirect($g["abs_url"] . '/error/invalid-page');
                     }
                 } else {
                     redirect($g["abs_url"] . '/error/invalid-page');
                 }
                 break;
             case 'transactions':
                 if (isset($action_command)) {
                     switch ($action_command) {
                         case 'delete':
                             delete_client_transaction(post('transactionid'));
                             exit;
Exemplo n.º 2
0
    exit;
}
if (isset($_GET["iscsi-search"])) {
    add_search();
    exit;
}
if (isset($_GET["add-select"])) {
    add_select_popup();
    exit;
}
if (isset($_POST["Params"])) {
    add_select_sql();
    exit;
}
if (isset($_GET["iScsiClientDelete"])) {
    delete_client();
    exit;
}
if (isset($_GET["iScsciReconnect"])) {
    iScsciReconnect();
    exit;
}
function add_js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{add_iscsi_disk}");
    $html = "YahooWin2('850','{$page}?add-popup=yes','{$title}');";
    echo $html;
}
function add_popup()
Exemplo n.º 3
0
// are you in the correct group?
if ($_SESSION['role_id'] < 2) {
    errormsg('Your role does not have access to this resource');
} else {
    if (isset($_POST['client_id']) && get_client_name($_POST['client_id'], $mysqli)) {
        // set the client_id variable from POST
        $client_id = $_POST['client_id'];
        $client_name = get_client_name($client_id, $mysqli);
        // check if the client has attached domains
        if (get_client_domain_count($client_id, $mysqli) && ($domain_tables = get_domains_table($client_id, $mysqli))) {
            echo "\n\t\t\t<!-- Begin Content Division -->\n\t\t\t<div id='content'>\t\t\t\t\t\n\t\t\t\t<legend>Delete Client</legend>\n\t\t\t\t\n\t\t\t\t" . quickalert("warning", $client_name . " is the owner of one or more domains.") . "\n\t\t\t\t\n\t\t\t\t" . quickalert("info", "To delete this client, you can either delete all \n\t\t\t\t\tassociated domains and their transport maps, or \n\t\t\t\t\tchange the owner of any domain to another client. \n\t\t\t\t\t<a class='alert-link' href=" . SITE_URL . "/?do=list&object=domain&id=" . $client_id . "'>View Domain(s)</a>") . "\n\t\t\t\t\n\t\t\t\t" . $domain_tables . "\n\t\t\t\t\n\t\t\t<!-- End Content Division -->\n\t\t\t</div>\n\t\t\t";
        } elseif (get_client_domain_count($client_id, $mysqli)) {
            errormsg("cannot generate domains table");
        } else {
            // no domains, remove client
            if (delete_client($client_id, $mysqli)) {
                echo "\n\t\t\t\t<!-- Begin Content Division -->\n\t\t\t\t<div id='content'>\t\t\t\t\t\n\t\t\t\t\t<legend>Delete Client</legend>\n\t\t\t\t\t\n\t\t\t\t\t" . quickalert("success", "Client '" . $client_name . "' has been removed from the database.") . "\n\t\t\t\t\t\n\t\t\t\t<!-- End Content Division -->\n\t\t\t\t</div>\n\t\t\t\t";
            } else {
                errormsg("Failed to delete record from the database");
            }
        }
    } elseif (!$_POST) {
        if (isset($_GET['id'])) {
            if (get_client_name($_GET['id'], $mysqli)) {
                $selected_client_id = $_GET['id'];
            }
        }
        echo "\n\t\t<!-- Begin Content Division -->\n\t\t<div id='content'>\n\t\t\t<form class='form-horizontal' action='" . SITE_URL . "/?do=delete&object=client' method='post' name='delete_client'>\n\t\t\t\t<fieldset>\n\t\t\t\t\n\t\t\t\t<legend>Delete Client</legend>\n\t\t\t\t\n\t\t\t\t" . quickalert("info", "Cannot delete clients until all domains and transport maps are removed.") . "\n\t\t\t\t\n\t\t\t\t<div class='form-group'>\n\t\t\t\t\t<label class='col-md-4 control-label' for='selectbasic'>Client</label>\n\t\t\t\t\t<div class='col-md-4'>\n\t\t\t\t\t<select id='client_id' name='client_id' class='form-control'>\n\t\t";
        $query = "SELECT client_id,client_name FROM clients ORDER BY client_name";
        if ($stmt = $mysqli->prepare($query)) {
            $stmt->execute();
Exemplo n.º 4
0
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	include_once("ressources/class.os.system.inc");
	include_once("ressources/class.lvm.org.inc");
	if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
	$user=new usersMenus();
	if(!$user->AsSystemAdministrator){echo "alert('no privileges');";die();}
	
	
	if(isset($_GET["add"])){add_js();exit;}
	if(isset($_GET["add-popup"])){add_popup();exit;}
	if(isset($_GET["iscsi-search"])){add_search();exit;}
	if(isset($_GET["add-select"])){add_select_popup();exit;}
	if(isset($_POST["Params"])){add_select_sql();exit;}
	if(isset($_GET["iScsiClientDelete"])){delete_client();exit;}
	if(isset($_GET["iScsciReconnect"])){iScsciReconnect();exit;}
	
function add_js(){
	
	$page=CurrentPageName();
	$tpl=new templates();
	$title=$tpl->_ENGINE_parse_body("{add_iscsi_disk}");
	
	$html="YahooWin2('850','$page?add-popup=yes','$title');";
	echo $html;
	
}

function add_popup(){
	$page=CurrentPageName();