當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Permission_Check函數代碼示例

本文整理匯總了PHP中Permission_Check函數的典型用法代碼示例。如果您正苦於以下問題:PHP Permission_Check函數的具體用法?PHP Permission_Check怎麽用?PHP Permission_Check使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Permission_Check函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: gException

     return ERROR | @Trigger_Error(500);
 case 'exception':
     return new gException('ROWS_NOT_FOUND', 'Записи не найдены');
 case 'array':
     #-------------------------------TRANSACTION---------------------------------
     if (Is_Error(DB_Transaction($TransactionID = UniqID('Delete')))) {
         return ERROR | @Trigger_Error(500);
     }
     #---------------------------------------------------------------------------
     $Trigger = System_Element(SPrintF('comp/%s.comp.php', $Path = SPrintF('Triggers/OnDelete/%s', $TableID)));
     #---------------------------------------------------------------------------
     $RowsIDs = array();
     #---------------------------------------------------------------------------
     foreach ($Rows as $Row) {
         #-------------------------------------------------------------------------
         $IsPermission = Permission_Check(SPrintF('%sDelete', $TableID), (int) $GLOBALS['__USER']['ID'], (int) $Row['UserID']);
         #-------------------------------------------------------------------------
         switch (ValueOf($IsPermission)) {
             case 'error':
                 return ERROR | @Trigger_Error(500);
             case 'exception':
                 return ERROR | @Trigger_Error(400);
             case 'false':
                 return ERROR | @Trigger_Error(700);
             case 'true':
                 #---------------------------------------------------------------------
                 if (!Is_Error($Trigger)) {
                     #-------------------------------------------------------------------
                     $OnDelete = Comp_Load($Path, $Row, COMP_ALL_HOSTS);
                     #-------------------------------------------------------------------
                     switch (ValueOf($OnDelete)) {
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:Delete.comp.php

示例2: switch

#-------------------------------------------------------------------------------
switch (ValueOf($ISPswOrder)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return new gException('HOSTING_ORDER_NOT_FOUND', 'Выбранный заказ не найден');
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$__USER = $GLOBALS['__USER'];
#-------------------------------------------------------------------------------
$IsPermission = Permission_Check('ISPswOrdersSchemeChange', (int) $__USER['ID'], (int) $ISPswOrder['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsPermission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:ISPswOrderSchemeChange.comp.php

示例3: switch

    #-------------------------------------------------------------------------------
    switch (ValueOf($Order)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            return ERROR | @Trigger_Error(400);
        case 'array':
            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$IsPermission = Permission_Check('ServiceAutoProlongation', (int) $GLOBALS['__USER']['ID'], (int) $Order['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsPermission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return new gException('NO_PERMISSION', 'У вас отсутствуют права на изменение настроек автопродления');
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:ServiceAutoProlong.comp.php

示例4: DB_Select

if (Is_Error(System_Load('modules/Authorisation.mod', 'classes/DOM.class.php', 'libs/Upload.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Profile = DB_Select('Profiles', array('ID', 'UserID', 'CreateDate', 'TemplateID', 'StatusID', 'StatusDate'), array('UNIQ', 'ID' => $ProfileID));
#-------------------------------------------------------------------------------
switch (ValueOf($Profile)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $__USER = $GLOBALS['__USER'];
        #---------------------------------------------------------------------------
        $IsPermission = Permission_Check('ProfileRead', (int) $__USER['ID'], (int) $Profile['UserID']);
        #---------------------------------------------------------------------------
        switch (ValueOf($IsPermission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-----------------------------------------------------------------------
                $DOM = new DOM();
                #-----------------------------------------------------------------------
                $Links =& Links();
                # Коллекция ссылок
                $Links['DOM'] =& $DOM;
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:ProfileInfo.comp.php

示例5: switch

#-------------------------------------------------------------------------------
switch (ValueOf($Ticket)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$__USER = $GLOBALS['__USER'];
#-------------------------------------------------------------------------------
$IsPermission = Permission_Check('TicketRead', (int) $__USER['ID'], (int) $Ticket['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsPermission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:TicketRead.comp.php

示例6: array

$Columns = array('ID', 'OrderID', 'ServiceID', 'IP', 'StatusID', 'UserID', 'SchemeID', 'DaysRemainded', '(SELECT `TypeID` FROM `Contracts` WHERE `DSOrdersOwners`.`ContractID` = `Contracts`.`ID`) as `ContractTypeID`', '(SELECT `Balance` FROM `Contracts` WHERE `DSOrdersOwners`.`ContractID` = `Contracts`.`ID`) as `ContractBalance`', '(SELECT `GroupID` FROM `Users` WHERE `DSOrdersOwners`.`UserID` = `Users`.`ID`) as `GroupID`', '(SELECT `IsPayed` FROM `Orders` WHERE `Orders`.`ID` = `DSOrdersOwners`.`OrderID`) as `IsPayed`', '(SELECT SUM(`DaysReserved`*`Cost`*(1-`Discont`)) FROM `OrdersConsider` WHERE `OrderID`=`DSOrdersOwners`.`OrderID`) AS PayedSumm');
#-------------------------------------------------------------------------------
$Where = $DSOrderID ? SPrintF('`ID` = %u', $DSOrderID) : SPrintF('`OrderID` = %u', $OrderID);
#-------------------------------------------------------------------------------
$DSOrder = DB_Select('DSOrdersOwners', $Columns, array('UNIQ', 'Where' => $Where));
#-------------------------------------------------------------------------------
switch (ValueOf($DSOrder)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $UserID = (int) $DSOrder['UserID'];
        #---------------------------------------------------------------------------
        $IsPermission = Permission_Check('DSOrdersRead', (int) $GLOBALS['__USER']['ID'], $UserID);
        #---------------------------------------------------------------------------
        switch (ValueOf($IsPermission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-----------------------------------------------------------------------
                $DOM = new DOM();
                #-----------------------------------------------------------------------
                $Links =& Links();
                # Коллекция ссылок
                $Links['DOM'] =& $DOM;
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:DSOrderPay.comp.php

示例7: array

        case 'array':
            break;
        default:
            return ERROR | @Trigger_Error(101);
    }
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $ExtraIPDepend = array('Login' => '', 'Address' => '');
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$__USER = $GLOBALS['__USER'];
#-------------------------------------------------------------------------------
$IsPermission = Permission_Check('ExtraIPOrdersRead', (int) $__USER['ID'], (int) $ExtraIPOrder['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsPermission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$DOM = new DOM();
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:ExtraIPOrderInfo.comp.php

示例8: array

#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Columns = array('ID', 'UserID', 'SchemeID', '(SELECT `ServersGroupID` FROM `Servers` WHERE `Servers`.`ID` = (SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `HostingOrdersOwners`.`OrderID`)) AS `ServersGroupID`', '(SELECT `Params` FROM `Servers` WHERE `Servers`.`ID` = (SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `HostingOrdersOwners`.`OrderID`)) AS `Params`', 'StatusID');
#-------------------------------------------------------------------------------
$HostingOrder = DB_Select('HostingOrdersOwners', $Columns, array('UNIQ', 'ID' => $HostingOrderID));
#-------------------------------------------------------------------------------
switch (ValueOf($HostingOrder)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #-------------------------------------------------------------------------------
        $__USER = $GLOBALS['__USER'];
        #-------------------------------------------------------------------------------
        $IsPermission = Permission_Check('HostingOrdersRead', (int) $__USER['ID'], (int) $HostingOrder['UserID']);
        #-------------------------------------------------------------------------------
        switch (ValueOf($IsPermission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-------------------------------------------------------------------------------
                if (!In_Array($HostingOrder['StatusID'], array('Active', 'Suspended'))) {
                    return new gException('ORDER_NOT_ACTIVE', 'Тариф можно изменить только для активного или заблокированного заказа');
                }
                #-------------------------------------------------------------------------------
                $OldScheme = DB_Select('HostingSchemes', array('IsSchemeChange', 'IsReselling'), array('UNIQ', 'ID' => $HostingOrder['SchemeID']));
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:HostingOrderSchemeChange.comp.php

示例9: gException

        return new gException('CONTRACT_NOT_FOUND', 'Договор не найден');
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# проверяем наличие файла
if (!GetUploadedFileSize('Contracts', $Contract['ID'])) {
    return new gException('DOCUMENT_NOT_BUILDED', 'Документ не сформирован');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# проверяем разрешения на скачивание файла
$Permission = Permission_Check('ContractRead', (int) $GLOBALS['__USER']['ID'], (int) $Contract['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($Permission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:ContractDownload.comp.php

示例10: DB_Select

if (Is_Error(System_Load('modules/Authorisation.mod', 'classes/DOM.class.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$MotionDocument = DB_Select('MotionDocumentsOwners', '*', array('UNIQ', 'ID' => $MotionDocumentID));
#-------------------------------------------------------------------------------
switch (ValueOf($MotionDocument)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $__USER = $GLOBALS['__USER'];
        #---------------------------------------------------------------------------
        $IsPermission = Permission_Check('MotionDocumentRead', (int) $__USER['ID'], $MotionDocument['UserID'] ? (int) $MotionDocument['UserID'] : 100);
        #---------------------------------------------------------------------------
        switch (ValueOf($IsPermission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-----------------------------------------------------------------------
                $DOM = new DOM();
                #-----------------------------------------------------------------------
                $Links =& Links();
                # Коллекция ссылок
                $Links['DOM'] =& $DOM;
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:MotionDocumentInfo.comp.php

示例11: switch

#-------------------------------------------------------------------------------
switch (ValueOf($DNSmanagerOrder)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$__USER = $GLOBALS['__USER'];
#-------------------------------------------------------------------------------
$IsPermission = Permission_Check('DNSmanagerOrdersRead', (int) $__USER['ID'], (int) $DNSmanagerOrder['UserID']);
#-------------------------------------------------------------------------------
switch (ValueOf($IsPermission)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'false':
        return ERROR | @Trigger_Error(700);
    case 'true':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:DNSmanagerOrderInfo.comp.php

示例12: Tag

             #-------------------------------------------------------------------------------
         }
         #-------------------------------------------------------------------------------
     } else {
         #-------------------------------------------------------------------------------
         $Span->AddChild(new Tag('SPAN', '-'));
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     #-------------------------------------------------------------------------------
 } else {
     # $IsAdmin false->true
     #-------------------------------------------------------------------------------
     # дополнительно проверяем - не сотрудник ли это, для сотрудников не надо линки в подпись лепить
     #Debug("[comp/Edesks/Message]: check for links, user id = " . (integer)$User['ID']);
     $IsPermission = Permission_Check('/Administrator/', (int) $User['ID']);
     switch (ValueOf($IsPermission)) {
         case 'error':
             return ERROR | @Trigger_Error(500);
         case 'exception':
             return ERROR | @Trigger_Error(400);
         case 'false':
             #-------------------------------------------------------------------------------
             # не сотрудник, выводим всё
             #-------------------------------------------------------------------------------
             # шукаем его заказы на услуги
             $Columns = array('Item', 'Code', 'Name');
             $Where = array('`Services`.`ID`=`OrdersOwners`.`ServiceID`', SPrintF('`OrdersOwners`.`UserID`=%s', $UserID));
             $Items = DB_Select(array('OrdersOwners', 'Services'), $Columns, array('Where' => $Where, 'GroupBy' => 'Code', 'SortOn' => '`Services`.`SortID`'));
             #-------------------------------------------------------------------------------
             switch (ValueOf($Items)) {
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:Message.comp.php

示例13: DB_Select

if ($UserID) {
    #-----------------------------------------------------------------------------
    $User = DB_Select('Users', array('ID', 'IsActive'), array('UNIQ', 'ID' => $UserID));
    #-----------------------------------------------------------------------------
    switch (ValueOf($User)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            return ERROR | @Trigger_Error(400);
        case 'array':
            #-------------------------------------------------------------------------
            $UserID = $User['ID'];
            #-------------------------------------------------------------------------
            if (!In_Array($UserID, $UsersIDs)) {
                #-----------------------------------------------------------------------
                $IsPermission = Permission_Check('UserSwitch', (int) $__USER['ID'], (int) $UserID);
                #-----------------------------------------------------------------------
                switch (ValueOf($IsPermission)) {
                    case 'error':
                        return ERROR | @Trigger_Error(500);
                    case 'exception':
                        return ERROR | @Trigger_Error(400);
                    case 'false':
                        return new gException('USER_MANAGMENT_DISABLED', 'Управление пользователем запрещено');
                    case 'true':
                        Array_UnShift($UsersIDs, $UserID);
                        break;
                    default:
                        return ERROR | @Trigger_Error(101);
                }
            } else {
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:UserSwitch.comp.php

示例14: DB_Select

if (Is_Error(System_Load('modules/Authorisation.mod', 'classes/DOM.class.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Invoice = DB_Select('InvoicesOwners', array('ID', 'UserID', 'CreateDate', 'ContractID', 'PaymentSystemID', 'Summ', 'StatusID', 'StatusDate'), array('UNIQ', 'ID' => $InvoiceID));
#-------------------------------------------------------------------------------
switch (ValueOf($Invoice)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $__USER = $GLOBALS['__USER'];
        #---------------------------------------------------------------------------
        $IsPermission = Permission_Check('InvoiceRead', (int) $__USER['ID'], (int) $Invoice['UserID']);
        #---------------------------------------------------------------------------
        switch (ValueOf($IsPermission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-----------------------------------------------------------------------
                $DOM = new DOM();
                #-----------------------------------------------------------------------
                $Links =& Links();
                # Коллекция ссылок
                $Links['DOM'] =& $DOM;
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:InvoiceInfo.comp.php

示例15: DB_Escape

if (Is_Error(System_Load('modules/Authorisation.mod', 'libs/HTMLDoc.php', 'libs/Upload.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$TypeID = DB_Escape($TypeID);
#-------------------------------------------------------------------------------
$FileData = DB_Select($TypeID, '*', array('UNIQ', 'ID' => $FileID));
#-------------------------------------------------------------------------------
switch (ValueOf($FileData)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $Permission = Permission_Check('EdeskRead', (int) $GLOBALS['__USER']['ID'], (int) $FileData['UserID']);
        #---------------------------------------------------------------------------
        switch (ValueOf($Permission)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'false':
                return ERROR | @Trigger_Error(700);
            case 'true':
                #-----------------------------------------------------------------------
                $Length = GetUploadedFileSize($TypeID, $FileID);
                #-----------------------------------------------------------------------
                if (!$Length) {
                    return new gException('CANNOT_GET_FILE_SIZE', 'Не удалось получить размер файла');
                }
開發者ID:carriercomm,項目名稱:jbs,代碼行數:31,代碼來源:FileDownload.comp.php


注:本文中的Permission_Check函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。