Exemplo n.º 1
0
 /**
  * Функция, аналогичная CMain::GetCurPageParam, только умеет работать с любой переданной ссылкой и умеет удалять массивы параметров.
  */
 public static function getPageParam($strParam = '', $arParamKill = array(), $get_index_page = NULL, $uri = FALSE)
 {
     if (NULL === $get_index_page) {
         if (defined('BX_DISABLE_INDEX_PAGE')) {
             $get_index_page = !BX_DISABLE_INDEX_PAGE;
         } else {
             $get_index_page = TRUE;
         }
     }
     $sUrlPath = GetPagePath($uri, $get_index_page);
     $strNavQueryString = deleteParam($arParamKill, $uri);
     if ($strNavQueryString != '' && $strParam != '') {
         $strNavQueryString = '&' . $strNavQueryString;
     }
     if ($strNavQueryString == '' && $strParam == '') {
         return $sUrlPath;
     } else {
         return $sUrlPath . '?' . $strParam . $strNavQueryString;
     }
 }
Exemplo n.º 2
0
 protected function authorizeUser()
 {
     if ((!defined("NOT_CHECK_PERMISSIONS") || NOT_CHECK_PERMISSIONS !== true) && (!defined("NOT_CHECK_FILE_PERMISSIONS") || NOT_CHECK_FILE_PERMISSIONS !== true)) {
         ////////////////////////////////////
         //  $this->page->authorize();
         $arAuthResult = $GLOBALS["APPLICATION"]->arAuthResult;
         $real_path = $GLOBALS["APPLICATION"]->getCurPage(true);
         if (isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "") {
             $real_path = $_SERVER["REAL_FILE_PATH"];
         }
         if (!$GLOBALS["USER"]->canDoFileOperation('fm_view_file', array(SITE_ID, $real_path)) || defined("NEED_AUTH") && NEED_AUTH && !$GLOBALS["USER"]->isAuthorized()) {
             if ($GLOBALS["USER"]->isAuthorized() && strlen($arAuthResult["MESSAGE"]) <= 0) {
                 $arAuthResult = array("MESSAGE" => GetMessage("ACCESS_DENIED") . ' ' . GetMessage("ACCESS_DENIED_FILE", array("#FILE#" => $real_path)), "TYPE" => "ERROR");
             }
             if (defined("ADMIN_SECTION") && ADMIN_SECTION == true) {
                 if ($_REQUEST["mode"] == "list" || $_REQUEST["mode"] == "settings") {
                     echo "<script>top.location='" . $GLOBALS["APPLICATION"]->getCurPage() . "?" . deleteParam(array("mode")) . "';</script>";
                     die;
                 } elseif ($_REQUEST["mode"] == "frame") {
                     echo "<script type=\"text/javascript\">\n\t\t\t\t\tvar w = (opener? opener.window:parent.window);\n\t\t\t\t\tw.location.href='" . $GLOBALS["APPLICATION"]->getCurPage() . "?" . deleteParam(array("mode")) . "';\n\t\t\t\t</script>";
                     die;
                 }
             }
             /** @var $request HttpRequest */
             $request = $this->context->getRequest();
             //LocalRedirect("/auth_new.php?back_url=".urlencode($request->getRequestedPage()));
             $GLOBALS["APPLICATION"]->authForm($arAuthResult);
         }
     }
 }
Exemplo n.º 3
0
//---------------------------
// programmer:	Jafarkhani
// create Date:	89.03
//---------------------------
require_once '../../../header.inc.php';
require_once '../class/salary_params.class.php';
require_once inc_response;
require_once inc_dataReader;
$task = isset($_POST["task"]) ? $_POST["task"] : (isset($_GET["task"]) ? $_GET["task"] : "");
switch ($task) {
    case "selectAll":
        selectAll();
    case "saveParam":
        saveParam();
    case "deleteParam":
        deleteParam();
}
function selectAll()
{
    $temp = manage_salary_params::GetAll($_GET["person_type"], $_GET["param_type"], dataReader::makeOrder());
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
function saveParam()
{
    $obj = new manage_salary_params();
    PdoDataAccess::FillObjectByJsonData($obj, $_POST["record"]);
    $obj->param_type = $_POST["param_type"];
    $obj->person_type = 3;