Ejemplo n.º 1
0
    exit;
}
if (isset($_GET["profile-tabs"])) {
    profile_tabs();
    exit;
}
if (isset($_GET["profile-popup"])) {
    profile_popup();
    exit;
}
if (isset($_GET["delete-profile-js"])) {
    profile_delete_js();
    exit;
}
if (isset($_POST["rulename"])) {
    profile_save();
    exit;
}
if (isset($_POST["delete-profile"])) {
    profile_delete();
    exit;
}
if (isset($_GET["enable-profile-js"])) {
    profile_enable_js();
    exit;
}
if (isset($_POST["enable-profile"])) {
    profile_enable();
    exit;
}
if (isset($_GET["profile-category"])) {
                #Condition check
                $condition = 'AND';
                if ($values['condition'] == '1') {
                    $condition = 'OR';
                }
                $rules_build .= $rule . ' ' . $operation . ' ' . $option . ' ' . $condition . ' ';
            }
        }
        #Remove last OR/AND
        $last_OR_pos = strrpos($rules_build, "OR");
        $last_AND_pos = strrpos($rules_build, "AND");
        $rules = $last_AND_pos > $last_OR_pos ? substr($rules_build, 0, $last_AND_pos - 1) : substr($rules_build, 0, $last_OR_pos - 1);
        #$rules.=';';
    }
    //echo "profile_save_name=$profile_save_name<br>\n";
    profile_save($profile_save_name, $_POST['profile'], $checked_ids, $rules);
    $messageStack->add('Profile saved', 'ready');
}
if ($_GET['del_sel_profile'] != '') {
    // del profile
    profile_delete($_GET['del_sel_profile']);
}
$profile_name = $_GET['profile_name'];
if ($profile_name == '') {
    if ($profile_save_name != '') {
        $profile_name = $profile_save_name;
    } else {
        $profile_name = 'default';
    }
}
$p = profile_load_n($profile_name);