当前位置: 首页>>代码示例>>PHP>>正文


PHP permitted函数代码示例

本文整理汇总了PHP中permitted函数的典型用法代码示例。如果您正苦于以下问题:PHP permitted函数的具体用法?PHP permitted怎么用?PHP permitted使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了permitted函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: trigger_liveports

function trigger_liveports()
{
    $breed = detectDeviceBreed(getBypassValue());
    foreach (array('getportstatus', 'getmaclist') as $command) {
        if (validBreedFunction($breed, $command) and permitted(NULL, 'liveports', $command)) {
            return 'std';
        }
    }
    return '';
}
开发者ID:rhysm,项目名称:racktables,代码行数:10,代码来源:triggers.php

示例2: renderConfigMainpage

function renderConfigMainpage()
{
    global $pageno, $page;
    echo '<ul>';
    foreach ($page as $cpageno => $cpage) {
        if (isset($cpage['parent']) and $cpage['parent'] == $pageno && permitted($cpageno)) {
            echo "<li><a href='index.php?page={$cpageno}'>" . $cpage['title'] . "</li>\n";
        }
    }
    echo '</ul>';
}
开发者ID:spartak-radchenko,项目名称:racktables,代码行数:11,代码来源:interface-config.php

示例3: must_allow

/**
 * Checks current user's permissions against the given action, exiting if user
 * isn't allowed to perform the given action
 */
function must_allow($action)
{
    // Tell the renderer we've checked auth
    global $renderer;
    $renderer->authorize();
    // Special case to allow for fully public pages
    if ($action == NULL) {
        return;
    }
    if (!permitted(get_user(), $action)) {
        header("HTTP/1.0 403 Forbidden");
        $renderer->render("forbidden");
        exit;
    }
}
开发者ID:uoregon-libraries,项目名称:pdf-to-chronam-admin,代码行数:19,代码来源:root.php

示例4: renderInterfacesStats

function renderInterfacesStats($object_id)
{
    global $nextorder;
    global $port_use_age;
    addCSS("/* Live Interfaces */\n\t\t.text_green  { color: #00cc00; }\n\t\t.text_yellow { color: #ff9900; }\n\t\t.text_red    { color: #ff0000; }", TRUE);
    startPortlet('Interfaces statistics');
    //get data: show version
    try {
        $uptime = queryDevice($object_id, 'getuptime');
    } catch (RackTablesError $e) {
    }
    echo "<table width='100%'><tr>";
    if (permitted(NULL, NULL, 'get_link_status')) {
        //get data: show interfaces
        try {
            $interfaces = queryDevice($object_id, 'getinterfaces');
        } catch (RackTablesError $e) {
        }
        if (!empty($interfaces)) {
            $last_reboot = time_convert($uptime);
            echo "<td";
            echo $last_reboot < $port_use_age ? " class='text_red'>" : $last_reboot > 262080 ? " class='text_green'>" : ">";
            echo $uptime . "</tr>";
            echo "<table width='80%' class='widetable' cellspacing=0 cellpadding='5px' align='center'><tr><th>Port<th>Link status<th>Last input<th>Last clear<th>Input packets<th>Output packets<th>Description</tr>";
            $order = 'even';
            foreach ($interfaces as $pn => $int) {
                echo "<tr class='row_{$order}'>";
                $order = $nextorder[$order];
                echo '<td>' . $pn . '<td';
                echo $int['status'] == "connected" ? " class='text_green'>" : ">";
                echo $int['status'] . '<td';
                echo time_convert($int['last']) > $port_use_age ? " class='text_yellow'>" : ">";
                echo $int['last'] . '<td';
                echo time_convert($int['clear']) > 0 ? time_convert($int['clear']) < $port_use_age ? " class='text_red'>" : ">" : ">";
                echo $int['clear'];
                echo '<td>' . $int['in_pkts'];
                echo '<td>' . $int['out_pkts'];
                echo '<td>' . $int['desc'];
                echo '</tr>';
            }
            echo "</table></td>";
        }
    }
    echo "</td></tr></table>";
    finishPortlet();
}
开发者ID:cengn-tao,项目名称:racktables-contribs,代码行数:46,代码来源:liveinterfaces.php

示例5: content_5778b6e53bcf54_59272631

    function content_5778b6e53bcf54_59272631($_smarty_tpl)
    {
        if (!is_callable('smarty_block_m')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/block.m.php';
        }
        ?>
<div class="fldTitle"><?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('m', array());
        $_block_repeat = true;
        echo smarty_block_m(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
Fax<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_m(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
 #</div>
            <input type="text" readonly="readonly" style="width:90px" value="<?php 
        echo $_smarty_tpl->tpl_vars['value']->value;
        ?>
" />
            
            <?php 
        if ($_smarty_tpl->tpl_vars['value']->value) {
            ?>
<a href="/leadsmail.php?cmd=compose&lead_id=<?php 
            echo $_smarty_tpl->tpl_vars['lead_id']->value;
            ?>
&fax=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value;
            ?>
" <?php 
            if (!permitted('allowFax')) {
                ?>
onclick="alert('You must configure your Fax settings in your user profile page first before you can use this feature.');return false;"<?php 
            }
            ?>
>
            <img style="vertical-align:middle" src="/assets/images/fax_icon.jpg" width="21" height="21" border="0"></a>
			<?php 
        }
    }
开发者ID:doronl456,项目名称:TestGit,代码行数:46,代码来源:2e094a0ff0fff7f7eb342352d9984666a3bbccfb.file.Fax.html.php

示例6: content_5778b6e52b7705_27809830

    function content_5778b6e52b7705_27809830($_smarty_tpl)
    {
        ?>
  <div class="fldTitle"><?php 
        echo $_smarty_tpl->getSubTemplate('fields/req.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>
 <?php 
        if (permitted('confEnableCanada')) {
            ?>
 (Postal Code)<?php 
        }
        ?>
</div>
<input type="text" readonly="readonly" class="inpWide" value="<?php 
        echo $_smarty_tpl->tpl_vars['value']->value;
        ?>
"/>
<?php 
    }
开发者ID:doronl456,项目名称:TestGit,代码行数:20,代码来源:cce2e75fe3d86cf3f9c006387a5cbc7473558135.file.TaxID.html.php

示例7: __construct

 public function __construct()
 {
     $this->loader = new Twig_Loader_Filesystem(__DIR__ . '/../templates');
     $this->twig = new Twig_Environment($this->loader, array("debug" => true));
     $this->variables = array();
     $this->twig->addExtension(new Twig_Extension_Debug());
     $this->authorized = FALSE;
     $this->add_function('permitted', function ($user, $action) {
         return permitted($user, $action);
     });
     $this->add_function('can_give_role', function ($user, $role) {
         return can_give_role($user, $role);
     });
     $this->add_function('iiif_page_top_url', 'iiif_page_top_url');
     $this->add_function('iiif_page_bottom_url', 'iiif_page_bottom_url');
     $this->add_function('iiif_info_url', 'iiif_info_url');
     $this->twig->addGlobal("ROLE_ADMIN", ROLE_ADMIN);
     $this->twig->addGlobal("ROLE_TITLE_MANAGER", ROLE_TITLE_MANAGER);
     $this->twig->addGlobal("ROLE_ISSUE_CURATOR", ROLE_ISSUE_CURATOR);
     $this->twig->addGlobal("ROLE_ISSUE_REVIEWER", ROLE_ISSUE_REVIEWER);
     $this->twig->addGlobal("ROLE_USER_MANAGER", ROLE_USER_MANAGER);
     $this->twig->addGlobal("ROLE_MOC_MANAGER", ROLE_MOC_MANAGER);
 }
开发者ID:uoregon-libraries,项目名称:pdf-to-chronam-admin,代码行数:23,代码来源:render.php

示例8: content_5778b6e5271ea7_87612051

    function content_5778b6e5271ea7_87612051($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date.php';
        }
        ?>
  <div class="fldTitle"><?php 
        echo $_smarty_tpl->getSubTemplate('fields/req.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>
 <?php 
        if (permitted('confEnableCanada')) {
            ?>
 (Postal Code)<?php 
        }
        ?>
</div>
<input type="text" readonly="readonly" class="inpWide" value="<?php 
        echo smarty_modifier_date($_smarty_tpl->tpl_vars['value']->value);
        ?>
"/>
<?php 
    }
开发者ID:doronl456,项目名称:TestGit,代码行数:23,代码来源:241de59f5dbcbcfdfc3f458df78c0506fd100f4d.file.DOB.html.php

示例9: content_5778b6e577b464_23448108

    function content_5778b6e577b464_23448108($_smarty_tpl)
    {
        ?>
<div  class="d1" >
  <div class="fldTitle"><?php 
        echo $_smarty_tpl->getSubTemplate('fields/req.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>
 <?php 
        if (permitted('confEnableCanada')) {
            ?>
 (Postal Code)<?php 
        }
        ?>
</div>
    <input name="<?php 
        echo $_smarty_tpl->tpl_vars['name']->value;
        ?>
" type="text" class="fieldInputZip" value="<?php 
        echo $_smarty_tpl->tpl_vars['value']->value;
        ?>
" maxlength="9"  maxlength_="" />
    &nbsp;<span class="fieldComments">(xxxxx) <?php 
        if (permitted('confEnableCanada')) {
            ?>
 / (xxx xxx)<?php 
        }
        ?>
</span>
  <?php 
        echo $_smarty_tpl->getSubTemplate('fields/note.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>

</div>
<?php 
    }
开发者ID:doronl456,项目名称:TestGit,代码行数:36,代码来源:ad7eb660074a08731166162a145a733d84472c27.file.field_zip.html.php

示例10: formatPortReservation

function formatPortReservation($port)
{
    $ret = array();
    $ret[] = '<td class=tdleft>' . (strlen($port['reservation_comment']) ? formatLoggedSpan($port['last_log'], 'Reserved:', 'strong underline') : '') . '</td>';
    $editable = permitted('object', 'ports', 'editPort') ? 'editable' : '';
    $ret[] = '<td class=tdleft>' . formatLoggedSpan($port['last_log'], $port['reservation_comment'], "rsvtext {$editable} id-{$port['id']} op-upd-reservation-port") . '</td>';
    return $ret;
}
开发者ID:xtha,项目名称:salt,代码行数:8,代码来源:interface.php

示例11: authorize8021QChangeRequests

function authorize8021QChangeRequests($before, $changes)
{
    global $script_mode;
    if (isset($script_mode) and $script_mode) {
        return $changes;
    }
    $ret = array();
    foreach ($changes as $pn => $change) {
        foreach (array_diff($before[$pn]['allowed'], $change['allowed']) as $removed_id) {
            if (!permitted(NULL, NULL, NULL, array(array('tag' => '$fromvlan_' . $removed_id), array('tag' => '$vlan_' . $removed_id)))) {
                continue 2;
            }
        }
        // next port
        foreach (array_diff($change['allowed'], $before[$pn]['allowed']) as $added_id) {
            if (!permitted(NULL, NULL, NULL, array(array('tag' => '$tovlan_' . $added_id), array('tag' => '$vlan_' . $added_id)))) {
                continue 2;
            }
        }
        // next port
        $ret[$pn] = $change;
    }
    return $ret;
}
开发者ID:rhysm,项目名称:racktables,代码行数:24,代码来源:functions.php

示例12: content_5778b6e5db1a50_97898098

    function content_5778b6e5db1a50_97898098($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_block_mybox')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/block.mybox.php';
        }
        if (!is_callable('smarty_modifier_cut')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.cut.php';
        }
        if (!is_callable('smarty_modifier_money')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.money.php';
        }
        if (!is_callable('smarty_function_html_options')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.html_options.php';
        }
        if (!is_callable('smarty_modifier_num')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.num.php';
        }
        if (!is_callable('smarty_function_my_call')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.my_call.php';
        }
        ?>
<style>
	.statBlock em { 
		color:blue;
	}
	.statBlock a {
		font-weight:bold;
	}
</style>

<!--add tehila -->
<?php 
        echo smarty_function_js_include(array('src' => '/js/form_validator.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/css/jquery.fileupload-ui.css'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/vendor/jquery.ui.widget.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/jquery.iframe-transport.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/uploader/js/jquery.fileupload.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/upload.css'), $_smarty_tpl);
        ?>

<!--end tehila -->

<?php 
        echo smarty_function_js_include(array('src' => '/js/lead.js'), $_smarty_tpl);
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate('calendar.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
        ?>



<?php 
        echo smarty_function_js_include(array('src' => '/js/form_validator.js'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_data(array('approveValidationErr' => $_smarty_tpl->tpl_vars['approveValidationErr']->value, 'tab' => $_smarty_tpl->tpl_vars['tab']->value, 'jsFundingProduct' => $_smarty_tpl->tpl_vars['FundingProduct']->value, 'totalPerc' => $_smarty_tpl->tpl_vars['totalPerc']->value, 'cntLenders' => $_smarty_tpl->tpl_vars['cntLenders']->value, 'BusinessEmail' => $_smarty_tpl->tpl_vars['BusinessEmail']->value, 'cashadv_id' => $_smarty_tpl->tpl_vars['cashadv_id']->value, 'cntMissingDocs' => $_smarty_tpl->tpl_vars['cntMissingDocs']->value, 'permittedSA' => $_smarty_tpl->tpl_vars['permittedSA']->value), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/statusColorBox.css'), $_smarty_tpl);
        ?>



<style>
.notesTable .v1{color:#3282e6}
</style>



<style>
.inpMinimal{background:#DDFFFF}
input.decFld{width:95%}

.HLred{color:red;}
.HLgreen{color:green;}

//.........这里部分代码省略.........
开发者ID:doronl456,项目名称:TestGit,代码行数:101,代码来源:e1c35e93a771c0b3c46e65c7a6e3b729db0bdf04.file.cashadv_dba.html.php

示例13: handleNetworkStickerClear

function handleNetworkStickerClear()
{
    global $sic, $pageno;
    assertUIntArg('attr_id');
    if (permitted(NULL, NULL, NULL, array(array('tag' => '$attr_' . $sic['attr_id'])))) {
        commitUpdateAttrForNetwork(spotEntity($pageno === 'ipv4net' ? 'ipv4net' : 'ipv6net', getBypassValue()), $sic['attr_id']);
        showSuccess("Attribute value cleared successfully");
    } else {
        $oldvalues = getAttrValues(getBypassValue());
        showError('Permission denied, "' . $oldvalues[$sic['attr_id']]['name'] . '" left unchanged');
    }
}
开发者ID:epx998,项目名称:racktables-contribs,代码行数:12,代码来源:network-attrs.php

示例14: getCommentsOfFriends

function getCommentsOfFriends()
{
    $comments_of_friends = array();
    $stmt = db_execute('SELECT * FROM comments ORDER BY created_at DESC LIMIT 1000');
    while ($comment = $stmt->fetch()) {
        if (!is_friend($comment['user_id'])) {
            continue;
        }
        $entry = getEntry($comment['entry_id']);
        $entry['is_private'] = $entry['private'] == 1;
        if ($entry['is_private'] && !permitted($entry['user_id'])) {
            continue;
        }
        $comments_of_friends[] = $comment;
        if (sizeof($comments_of_friends) >= 10) {
            break;
        }
    }
    return $comments_of_friends;
}
开发者ID:kuma-san,项目名称:isucon5,代码行数:20,代码来源:index.php

示例15: content_5778af8a051997_20571009

    function content_5778af8a051997_20571009($_smarty_tpl)
    {
        if (!is_callable('smarty_function_js_include')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_include.php';
        }
        if (!is_callable('smarty_block_mybox')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/block.mybox.php';
        }
        if (!is_callable('smarty_function_js_data')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.js_data.php';
        }
        if (!is_callable('smarty_function_cycle')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/function.cycle.php';
        }
        if (!is_callable('smarty_modifier_ucwords')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.ucwords.php';
        }
        if (!is_callable('smarty_modifier_money')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.money.php';
        }
        if (!is_callable('smarty_modifier_truncate')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.truncate.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_modifier_date')) {
            include '/homepages/37/d619410358/htdocs/developer/ext/smarty3/plugins/modifier.date.php';
        }
        echo smarty_function_js_include(array('src' => '/css/calendar.css'), $_smarty_tpl);
        ?>

<?php 
        echo smarty_function_js_include(array('src' => '/css/homepage.css'), $_smarty_tpl);
        ?>


<?php 
        echo '<script';
        ?>
 language="javascript">
	function statAppChange(){
		var statApp=getCtrlValue('statApp');
		el('tblAppProf').style.display= statApp=='Prof'?'':'none';
		el('tblAppVol').style.display= statApp=='Vol'?'':'none';
		el('tblAppNumtrans').style.display= statApp=='Numtrans'?'':'none';

		var statAgent=getCtrlValue('statAgent');
		el('tblAgentAccSub').style.display= statAgent=='AccSub'?'':'none';
		el('tblAgentAcc').style.display= statAgent=='Acc'?'':'none';
		el('tblAgentRes').style.display= statAgent=='Res'?'':'none';
		el('tblAgentCom').style.display= statAgent=='Com'?'':'none';

		var statMca=getCtrlValue('statMca');
		el('tblMcaAmount').style.display= statMca=='Amount'?'':'none';
		el('tblMcaBal').style.display= statMca=='Bal'?'':'none';
		el('tblMcaProf').style.display= statMca=='Prof'?'':'none';

// top 10
		var statTeamleader=getCtrlValue('statTeamleader');
		el('tblTeamleaderLead').style.display= statTeamleader=='Lead'?'':'none';
		el('tblTeamleaderAppt').style.display= statTeamleader=='Appt'?'':'none';
		el('tblTeamleaderSold').style.display= statTeamleader=='Sold'?'':'none';

		var statTm=getCtrlValue('statTm');
		el('tblTmLead').style.display= statTm=='Lead'?'':'none';
		el('tblTmAppt').style.display= statTm=='Appt'?'':'none';
		el('tblTmSold').style.display= statTm=='Sold'?'':'none';

		var statLeadcloser=getCtrlValue('statLeadcloser');
		el('tblLeadcloserLead').style.display= statLeadcloser=='Lead'?'':'none';
		el('tblLeadcloserAppt').style.display= statLeadcloser=='Appt'?'':'none';
		el('tblLeadcloserSold').style.display= statLeadcloser=='Sold'?'':'none';
	}


    $(document).ready(function() {



    });

<?php 
        echo '</script';
        ?>
>
<style>
</style>



<div class="mySortable HomePage">



<?php 
        if (permitted('HOME-DailyQuotes')) {
            ?>
	<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('mybox', array('node' => 'HOME-DailyQuotes', 'title' => 'Daily Sales & Motivational Quotes', 'class' => 'box-one box-blue'));
//.........这里部分代码省略.........
开发者ID:doronl456,项目名称:TestGit,代码行数:101,代码来源:ed7b0d1e461f7d26ae87909f3b57800fa8d06b51.file.home.html.php


注:本文中的permitted函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。