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


PHP Access::check_function方法代码示例

本文整理汇总了PHP中Access::check_function方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::check_function方法的具体用法?PHP Access::check_function怎么用?PHP Access::check_function使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Access的用法示例。


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

示例1:

}
if (AmpConfig::get('userflags')) {
    ?>
<td class="cel_userflag" id="userflag_<?php 
    echo $artist->id;
    ?>
_artist"><?php 
    Userflag::show($artist->id, 'artist');
    ?>
</td>
<?php 
}
?>
<td class="cel_action">
<?php 
if (Access::check_function('batch_download')) {
    ?>
    <a href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/batch.php?action=artist&amp;id=<?php 
    echo $artist->id;
    ?>
">
            <?php 
    echo UI::get_icon('batch_download', '', T_('Batch Download'));
    ?>
        </a>
<?php 
}
if (Access::check('interface', '50')) {
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:show_artist_row.inc.php

示例2:

        }
        ?>
            <?php 
        if (AmpConfig::get('share')) {
            ?>
                <?php 
            Share::display_ui('album', $c_album->id, false);
            ?>
            <?php 
        }
        ?>
        <?php 
    }
    ?>
        <?php 
    if (Access::check_function('batch_download') && check_can_zip('album')) {
        ?>
            <a rel="nohtml" href="<?php 
        echo $web_path;
        ?>
/batch.php?action=album&<?php 
        echo $c_album->get_http_album_query_ids('id');
        ?>
"><?php 
        echo UI::get_icon('batch_download', T_('Download'));
        ?>
</a>
        <?php 
    }
    ?>
        <?php 
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_album_group_disks.inc.php

示例3:

    if (AmpConfig::get('userflags')) {
        ?>
    <td class="cel_userflag" id="userflag_<?php 
        echo $libitem->id;
        ?>
_playlist"><?php 
        Userflag::show($libitem->id, 'playlist');
        ?>
</td>
    <?php 
    }
}
?>
<td class="cel_action">
<?php 
if (Access::check_function('batch_download') && check_can_zip('playlist')) {
    ?>
        <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/batch.php?action=playlist&amp;id=<?php 
    echo $libitem->id;
    ?>
">
            <?php 
    echo UI::get_icon('batch_download', T_('Batch Download'));
    ?>
        </a>
<?php 
}
if (Access::check('interface', '25')) {
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_playlist_row.inc.php

示例4: T_

        echo UI::get_icon('comment', T_('Post Shout'));
        ?>
</a>
    <?php 
    }
    ?>
    <?php 
    if (AmpConfig::get('share')) {
        ?>
        <?php 
        Share::display_ui('video', $libitem->id, false);
        ?>
    <?php 
    }
}
if (Access::check_function('download')) {
    ?>
    <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/stream.php?action=download&video_id=<?php 
    echo $libitem->id;
    ?>
"><?php 
    echo UI::get_icon('download', T_('Download'));
    ?>
</a>
<?php 
}
if (Access::check('interface', '50')) {
    ?>
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_video_row.inc.php

示例5: createshare

 /**
  * createShare
  * Create a public url that can be used by anyone to stream media.
  * Takes the file id with optional description and expires parameters.
  */
 public static function createshare($input)
 {
     self::check_version($input, "1.6.0");
     $id = self::check_parameter($input, 'id');
     $description = $input['description'];
     if (AmpConfig::get('share')) {
         if (isset($input['expires'])) {
             $expires = $input['expires'];
             // Parse as a string to work on 32-bit computers
             if (strlen($expires) > 3) {
                 $expires = intval(substr($expires, 0, -3));
             }
             $expire_days = round(($expires - time()) / 86400, 0, PHP_ROUND_HALF_EVEN);
         } else {
             $expire_days = AmpConfig::get('share_expire');
         }
         $object_id = Subsonic_XML_Data::getAmpacheId($id);
         if (Subsonic_XML_Data::isAlbum($id)) {
             $object_type = 'album';
         } else {
             if (Subsonic_XML_Data::isSong($id)) {
                 $object_type = 'song';
             }
         }
         if (!empty($object_type)) {
             $r = Subsonic_XML_Data::createSuccessResponse();
             $shares = array();
             $shares[] = Share::create_share($object_type, $object_id, true, Access::check_function('download'), $expire_days, Share::generate_secret(), 0, $description);
             Subsonic_XML_Data::addShares($r, $shares);
         } else {
             $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_DATA_NOTFOUND);
         }
     } else {
         $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_UNAUTHORIZED);
     }
     self::apiOutput($input, $r);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:42,代码来源:subsonic_api.class.php

示例6: display_ui_links

 public static function display_ui_links($object_type, $object_id)
 {
     echo "<ul>";
     echo "<li><a onclick=\"handleShareAction('" . AmpConfig::get('web_path') . "/share.php?action=show_create&type=" . $object_type . "&id=" . $object_id . "')\">" . UI::get_icon('share', T_('Advanced Share')) . " &nbsp;" . T_('Advanced Share') . "</a></li>";
     if (AmpConfig::get('download')) {
         $dllink = "";
         if ($object_type == "song" || $object_type == "video") {
             $dllink = AmpConfig::get('web_path') . "/play/index.php?action=download&type=" . $object_type . "&oid=" . $object_id . "&uid=-1";
         } else {
             if (Access::check_function('batch_download') && check_can_zip($object_type)) {
                 $dllink = AmpConfig::get('web_path') . "/batch.php?action=" . $object_type . "&id=" . $object_id;
             }
         }
         if (!empty($dllink)) {
             if (AmpConfig::get('require_session')) {
                 // Add session information to the link to avoid authentication
                 $dllink .= "&ssid=" . Stream::get_session();
             }
             echo "<li><a rel=\"nohtml\" href=\"" . $dllink . "\">" . UI::get_icon('download', T_('Temporary direct link')) . " &nbsp;" . T_('Temporary direct link') . "</a></li>";
         }
     }
     echo "<li style='padding-top: 8px; text-align: right;'>";
     $plugins = Plugin::get_plugins('external_share');
     foreach ($plugins as $plugin_name) {
         echo "<a onclick=\"handleShareAction('" . AmpConfig::get('web_path') . "/share.php?action=external_share&plugin=" . $plugin_name . "&type=" . $object_type . "&id=" . $object_id . "')\" target=\"_blank\">" . UI::get_icon('share_' . strtolower($plugin_name), $plugin_name) . "</a>&nbsp;";
     }
     echo "</li>";
     echo "</ul>";
 }
开发者ID:cheese1,项目名称:ampache,代码行数:29,代码来源:share.class.php

示例7: T_

</td>
<td class="cel_random"><?php 
echo $libitem->random ? T_('Yes') : T_('No');
?>
</td>
<td class="cel_limit"><?php 
echo $libitem->limit > 0 ? $libitem->limit : T_('None');
?>
</td>
<td class="cel_owner"><?php 
echo scrub_out($libitem->f_user);
?>
</td>
<td class="cel_action">
        <?php 
if (Access::check_function('batch_download') && check_can_zip('search')) {
    ?>
                <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/batch.php?action=search&amp;id=<?php 
    echo $libitem->id;
    ?>
">
                    <?php 
    echo UI::get_icon('batch_download', T_('Batch Download'));
    ?>
                </a>
        <?php 
}
if ($libitem->has_access()) {
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_search_row.inc.php

示例8:

if (Access::check('interface', '25')) {
    ?>
            <?php 
    if (AmpConfig::get('share')) {
        ?>
                <?php 
        Share::display_ui('podcast_episode', $episode->id, false);
        ?>
            <?php 
    }
    ?>
        <?php 
}
?>
        <?php 
if (Access::check_function('download') && !empty($episode->file)) {
    ?>
            <a rel="nohtml" href="<?php 
    echo Podcast_Episode::play_url($episode->id);
    ?>
"><?php 
    echo UI::get_icon('link', T_('Link'));
    ?>
</a>
            <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/stream.php?action=download&amp;podcast_episode_id=<?php 
    echo $episode->id;
    ?>
"><?php 
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_podcast_episode.inc.php

示例9: Plugin

        UI::show_footer();
        exit;
    case 'external_share':
        if (AmpConfig::get('demo_mode')) {
            UI::access_denied();
            exit;
        }
        $plugin = new Plugin($_GET['plugin']);
        if (!$plugin) {
            UI::access_denied('Access Denied - Unkown external share plugin.');
            exit;
        }
        $plugin->load($GLOBALS['user']);
        $type = $_REQUEST['type'];
        $id = $_REQUEST['id'];
        $allow_download = $type == 'song' && Access::check_function('download') || Access::check_function('batch_download');
        $secret = Share::generate_secret();
        $share_id = Share::create_share($type, $id, true, $allow_download, AmpConfig::get('share_expire'), $secret, 0);
        $share = new Share($share_id);
        $share->format(true);
        header("Location: " . $plugin->_plugin->external_share($share->public_url, $share->f_name));
        exit;
}
/**
 * If Access Control is turned on then we don't
 * even want them to be able to get to the login
 * page if they aren't in the ACL
 */
if (AmpConfig::get('access_control')) {
    if (!Access::check_network('interface', '', '5')) {
        debug_event('UI::access_denied', 'Access Denied:' . $_SERVER['REMOTE_ADDR'] . ' is not in the Interface Access list', '3');
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:share.php

示例10: T_

    </td>
</tr>
<tr>
    <td><?php 
echo T_('Allow Stream');
?>
</td>
    <td>
        <input type="checkbox" name="allow_stream" value="1" <?php 
echo $_REQUEST['allow_stream'] || $_SERVER['REQUEST_METHOD'] === 'GET' ? 'checked' : '';
?>
 />
    </td>
</tr>
<?php 
if (($_REQUEST['type'] == 'song' || $_REQUEST['type'] == 'video') && Access::check_function('download') || Access::check_function('batch_download')) {
    ?>
<tr>
    <td><?php 
    echo T_('Allow Download');
    ?>
</td>
    <td>
        <input type="checkbox" name="allow_download" value="1" <?php 
    echo $_REQUEST['allow_download'] || $_SERVER['REQUEST_METHOD'] === 'GET' ? 'checked' : '';
    ?>
 />
    </td>
</tr>
<?php 
}
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_add_share.inc.php

示例11: define

 */
if (!defined('NO_SESSION')) {
    if (isset($_REQUEST['ssid'])) {
        define('NO_SESSION', 1);
        require_once 'lib/init.php';
        if (!Session::exists('stream', $_REQUEST['ssid'])) {
            UI::access_denied();
            exit;
        }
    } else {
        require_once 'lib/init.php';
    }
}
ob_end_clean();
//test that batch download is permitted
if (!defined('NO_SESSION') && !Access::check_function('batch_download')) {
    UI::access_denied();
    exit;
}
/* Drop the normal Time limit constraints, this can take a while */
set_time_limit(0);
$media_ids = array();
$default_name = "Unknown.zip";
$object_type = scrub_in($_REQUEST['action']);
$name = $default_name;
if ($object_type == 'browse') {
    $object_type = $_REQUEST['type'];
}
if (!check_can_zip($object_type)) {
    debug_event('batch', 'Object type `' . $object_type . '` is not allowed to be zipped.', 1);
    UI::access_denied();
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:batch.php

示例12: scrub_out

echo scrub_out($libitem->expire_days);
?>
" /></td>
            </tr>
            <tr>
                <td class="edit_dialog_content_header"></td>
                <td><input type="checkbox" name="allow_stream" value="1" <?php 
echo $libitem->allow_stream ? 'checked' : '';
?>
 /> <?php 
echo T_('Allow Stream');
?>
</td>
            </tr>
            <?php 
if (($libitem->object_type == 'song' || $libitem->object_type == 'video') && Access::check_function('download') || Access::check_function('batch_download')) {
    ?>
                    <tr>
                        <td class="edit_dialog_content_header"></td>
                        <td><input type="checkbox" name="allow_download" value="1" <?php 
    echo $libitem->allow_download ? 'checked' : '';
    ?>
 /> <?php 
    echo T_('Allow Download');
    ?>
</td>
                    </tr>
                <?php 
}
?>
        </table>
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_edit_share_row.inc.php

示例13: T_

 *
 */
UI::show_box_top(T_('Options'), 'info-box');
?>
<div id="information_actions">
<ul>
<li>
    <?php 
echo Ajax::button('?action=basket&type=browse_set&browse_id=' . $browse->id, 'add', T_('Add Search Results'), 'add_search_results');
?>
    <?php 
echo T_('Add Search Results');
?>
</li>
    <?php 
if (Access::check_function('batch_download') && check_can_zip($_REQUEST['type'])) {
    ?>
<li>
    <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/batch.php?action=browse&amp;type=<?php 
    echo scrub_out($_REQUEST['type']);
    ?>
&amp;browse_id=<?php 
    echo $browse->id;
    ?>
"><?php 
    echo UI::get_icon('batch_download', T_('Batch Download'));
    ?>
</a>
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_search_options.inc.php

示例14:

        ?>
    <td class="cel_userflag" id="userflag_<?php 
        echo $libitem->id;
        ?>
_podcast_episode">
        <?php 
        Userflag::show($libitem->id, 'podcast_episode');
        ?>
    </td>
    <?php 
    }
}
?>
<td class="cel_action">
    <?php 
if (Access::check_function('download') && !empty($libitem->file)) {
    ?>
            <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/stream.php?action=download&amp;podcast_episode_id=<?php 
    echo $libitem->id;
    ?>
"><?php 
    echo UI::get_icon('download', T_('Download'));
    ?>
</a>
        <?php 
}
if (Access::check('interface', '50')) {
    ?>
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_podcast_episode_row.inc.php


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