本文整理汇总了PHP中auth_quickaclcheck函数的典型用法代码示例。如果您正苦于以下问题:PHP auth_quickaclcheck函数的具体用法?PHP auth_quickaclcheck怎么用?PHP auth_quickaclcheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了auth_quickaclcheck函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: convert
/**
* Do article(s) to ODT conversion work
*
* @param Doku_Event $event
* @param array $param
* @return bool
*/
public function convert(Doku_Event $event, $param)
{
global $ACT;
global $ID;
// our event?
if ($ACT != 'export_odtbook' && $ACT != 'export_odt' && $ACT != 'export_odtns') {
return false;
}
// check user's rights
if (auth_quickaclcheck($ID) < AUTH_READ) {
return false;
}
if ($data = $this->collectExportPages($event)) {
list($title, $this->list) = $data;
} else {
return false;
}
// it's ours, no one else's
$event->preventDefault();
// prepare cache and its dependencies
$depends = array();
$cache = $this->prepareCache($title, $depends);
// hard work only when no cache available
if (!$this->getConf('usecache') || !$cache->useCache($depends)) {
$this->generateODT($cache->cache, $title);
}
// deliver the file
$this->sendODTFile($cache->cache, $title);
return true;
}
开发者ID:RnBConsulting,项目名称:dokuwiki-plugin-odt,代码行数:37,代码来源:export.php
示例2: handle_start
/**
* handle event
*/
function handle_start(&$event, $param)
{
global $ID;
global $ACT;
if ($ACT != 'show') {
return;
}
$redirects = confToHash($this->getsavedir() . '/shorturl.conf');
if ($redirects[$ID]) {
if (preg_match('/^https?:\\/\\//', $redirects[$ID])) {
send_redirect($redirects[$ID]);
} else {
if ($this->getConf('showmsg')) {
msg(sprintf($this->getLang('redirected'), hsc($ID)));
}
send_redirect(wl($redirects[$ID], '', true));
}
exit;
} else {
if ($_GET['generateShortURL'] != "" && auth_quickaclcheck($ID) >= AUTH_READ) {
$shorturl =& plugin_load('helper', 'shorturl');
if ($shorturl) {
$shortID = $shorturl->autoGenerateShortUrl($ID);
}
}
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:action.php
示例3: render_xhtml
private function render_xhtml(&$renderer, $file)
{
global $version_file;
global $changelog;
global $ID;
if (auth_quickaclcheck($ID) == AUTH_ADMIN && $this->getConf('check updates')) {
include dirname(__FILE__) . '/../version.php';
$new_version = file_get_contents($version_file);
if (strcmp($new_version, $version) > 0) {
msg('A new version ' . $new_version . ' of the projects plugin is available. See the <a href="' . $changelog . '">change log</a>');
}
if (!$file) {
return;
}
}
$project = Project::project(NULL, true);
$renderer->nocache();
switch ($file->type()) {
case SOURCE:
$layout = new ProjectFileLayout($project, $ID, $file);
break;
case TARGET:
$layout = new TargetLayout($project, $ID, $file);
break;
case CROSSLINK:
$layout = new CrosslinkLayout($project, $ID, $file);
break;
}
$layout->render($renderer);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:projectfile.php
示例4: handle_ajax_call
function handle_ajax_call(&$event, $param)
{
if ($event->data == 'plugin_do') {
$id = cleanID($_REQUEST['do_page']);
if (auth_quickaclcheck($id) < AUTH_EDIT) {
echo -1;
$event->preventDefault();
$event->stopPropagation();
return false;
}
// toggle status of a single task
$hlp = plugin_load('helper', 'do');
$status = $hlp->toggleTaskStatus($id, $_REQUEST['do_md5'], $_REQUEST['do_commit']);
// rerender the page
p_get_metadata(cleanID($_REQUEST['do_page']), '', true);
header('Content-Type: text/plain; charset=utf-8');
echo $status;
$event->preventDefault();
$event->stopPropagation();
return false;
} elseif ($event->data == 'plugin_do_status') {
// read status for a bunch of tasks
require_once DOKU_INC . 'inc/JSON.php';
$JSON = new JSON();
$hlp = plugin_load('helper', 'do');
$status = $hlp->getAllPageStatuses(cleanID($_REQUEST['do_page']));
$status = $JSON->encode($status);
header('Content-Type: text/plain; charset=utf-8');
echo $status;
$event->preventDefault();
$event->stopPropagation();
return false;
}
return true;
}
开发者ID:rauschen,项目名称:do,代码行数:35,代码来源:action.php
示例5: saved
function saved(&$event, $param)
{
global $ID;
global $PROJECTS_REMAKE;
if (auth_quickaclcheck($ID) <= AUTH_READ) {
return;
}
$project = Project::project();
if ($project == NULL) {
return;
}
$file = $event->data['current']['ProjectFile'];
$name = noNS($ID);
if ($file == NULL) {
// check whether the file is deleted
if ($project->file($name) == NULL) {
return;
}
// it was int he project
if (!$project->remove_file($name)) {
msg('Other users are currently updating the project. Please save this page later.');
$evemt->data['current']['internal']['cache'] = false;
}
return;
}
if (!$project->update_file($file)) {
msg('Other users are currently updating the project. Please save this page later.');
$evemt->data['current']['internal']['cache'] = false;
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:metadata.php
示例6: white_pageinfo
function white_pageinfo($ret = false)
{
global $conf;
global $lang;
global $INFO;
global $ID;
// return if we are not allowed to view the page
if (!auth_quickaclcheck($ID)) {
return false;
}
$date = dformat($INFO['lastmod']);
// print it
if ($INFO['exists']) {
$out = '';
$out .= $lang['lastmod'];
$out .= ' ';
$out .= $date;
if ($ret) {
return $out;
} else {
echo $out;
return true;
}
}
return false;
}
开发者ID:ipari,项目名称:dokuwiki-template-white,代码行数:26,代码来源:tpl_functions.php
示例7: init_blocked_graphs
/**
* Initializes SQL filter of blocked graphs (no page permission by ACL rules).
*/
function init_blocked_graphs()
{
if ($this->getConf('use_acl') and self::$blocked_graphs_sql == '') {
$sql = "SELECT DISTINCT graph FROM " . self::$readable;
// prepare query
$query = $this->_db->prepare($sql);
if ($query == false) {
return;
}
// execute query
$res = $query->execute($values);
if ($res === false) {
$error = $query->errorInfo();
msg(sprintf($this->getLang('error_graphs_fetch'), hsc($error[2])), -1);
}
// fetch results and return them
$result = $query->fetchAll(PDO::FETCH_ASSOC);
$query->closeCursor();
// a list of graphs reachable by the current user is generated
$blocked_graphs = array();
foreach ($result as $row) {
if (auth_quickaclcheck($row['graph']) < AUTH_READ) {
array_push($blocked_graphs, "'" . $row['graph'] . "'");
}
}
// result set is additionally filtered by graphs the user is enabled for
self::$blocked_graphs_sql = " AND graph NOT IN (" . implode(",", $blocked_graphs) . ")";
}
}
开发者ID:pbruneck,项目名称:dokuwiki-strata,代码行数:32,代码来源:triples.php
示例8: _hookdo
function _hookdo(Doku_Event $event, $param)
{
global $ID;
if ($event->data === 'export_svg' && auth_quickaclcheck($ID) >= AUTH_READ) {
header('Content-type: image/svg+xml');
die(rawWiki($ID));
}
}
开发者ID:michitux,项目名称:DokuWiki-Plugin-SVGEdit,代码行数:8,代码来源:action.php
示例9: get_template
/**
* Handler to load page template.
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function get_template(Doku_Event &$event, $param)
{
if (strlen($_REQUEST['copyfrom']) > 0) {
$template_id = $_REQUEST['copyfrom'];
if (auth_quickaclcheck($template_id) >= AUTH_READ) {
$tpl = io_readFile(wikiFN($template_id));
$event->data['tpl'] = $tpl;
$event->preventDefault();
}
}
}
开发者ID:Grahack,项目名称:dokuwiki-copypage-plugin,代码行数:19,代码来源:action.php
示例10: indexmenu_search_index
function indexmenu_search_index(&$data, $base, $file, $type, $lvl, $opts)
{
global $conf;
$ret = true;
$item = array();
if ($type == 'f' && !preg_match('#\\.txt$#', $file)) {
// don't add
return false;
}
// get page id by filename
$id = pathID($file);
// check hiddens
if ($type == 'f' && isHiddenPage($id)) {
return false;
}
// bugfix for the
// /ns/
// /<ns>.txt
// case, need to force the 'directory' type
if ($type == 'f' && file_exists(dirname(wikiFN($id . ":" . noNS($id))))) {
$type = 'd';
}
// page target id = global id
$target = $id;
if ($type == 'd') {
// this will check 3 kinds of headpage:
// 1. /<ns>/<ns>.txt
// 2. /<ns>/
// /<ns>.txt
// 3. /<ns>/
// /<ns>/<start_page>
$nsa = array($id . ":" . noNS($id), $id, $id . ":" . $conf['start']);
$nspage = false;
foreach ($nsa as $nsp) {
if (@file_exists(wikiFN($nsp)) && auth_quickaclcheck($nsp) >= AUTH_READ) {
$nspage = $nsp;
break;
}
}
//headpage exists
if ($nspage) {
$target = $nspage;
} else {
// open namespace index, if headpage does not exists
$target = $target . ':';
}
}
$data[] = array('id' => $id, 'date' => @filectime(wikiFN($target)), 'type' => $type, 'target' => $target, 'title' => $conf['useheading'] && ($title = p_get_first_heading($target)) ? $title : $id, 'level' => $lvl);
if (substr_count($id, ":") > 2) {
$ret = 0;
}
return $ret;
}
开发者ID:jacobbates,项目名称:Help-Desk-Wiki-Theme,代码行数:53,代码来源:generate_index.php
示例11: saveData
/**
* Saves data for a given page (creates a new revision)
*
* If this call succeeds you can assume your data has either been saved or it was
* not necessary to save it because the data already existed in the wanted form or
* the given schemas are no longer assigned to that page.
*
* @param string $page
* @param array $data ('schema' => ( 'fieldlabel' => 'value', ...))
* @param string $summary
* @return bool returns always true
* @throws RemoteAccessDeniedException
* @throws RemoteException
*/
public function saveData($page, $data, $summary)
{
$page = cleanID($page);
if (!auth_quickaclcheck($page) < AUTH_EDIT) {
throw new RemoteAccessDeniedException('no permissions to save data for that page');
}
try {
$this->hlp->saveData($page, $data, $summary);
return true;
} catch (StructException $e) {
throw new RemoteException($e->getMessage(), 0, $e);
}
}
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:27,代码来源:remote.php
示例12: handle_ajax_call_unknown
public function handle_ajax_call_unknown(Doku_Event &$event, $param)
{
if ($event->data != 'plugin_imgpaste') {
return;
}
global $lang;
// get data
global $INPUT;
$data = $INPUT->post->str('data');
list($type, $data) = explode(';', $data);
if (!$data) {
$this->fail(400, $this->getLang('e_nodata'));
}
// process data encoding
$type = strtolower(substr($type, 5));
// strip 'data:' prefix
$data = substr($data, 7);
// strip 'base64,' prefix
$data = base64_decode($data);
// check for supported mime type
$mimetypes = array_flip(getMimeTypes());
if (!isset($mimetypes[$type])) {
$this->fail(415, $lang['uploadwrong']);
}
// prepare file names
$tempname = $this->storetemp($data);
$filename = $this->getConf('filename');
$filename = str_replace(array('@NS@', '@ID@', '@USER@'), array(getNS($INPUT->post->str('id')), $INPUT->post->str('id'), $_SERVER['REMOTE_USER']), $filename);
$filename = strftime($filename);
$filename .= '.' . $mimetypes[$type];
$filename = cleanID($filename);
// check ACLs
$auth = auth_quickaclcheck($filename);
if ($auth < AUTH_UPLOAD) {
$this->fail(403, $lang['uploadfail']);
}
// do the actual saving
$result = media_save(array('name' => $tempname, 'mime' => $type, 'ext' => $mimetypes[$type]), $filename, false, $auth, 'copy');
if (is_array($result)) {
$this->fail(500, $result[0]);
}
//Still here? We had a successful upload
$this->clean();
header('Content-Type: application/json');
$json = new JSON();
echo $json->encode(array('message' => $lang['uploadsucc'], 'id' => $result));
$event->preventDefault();
$event->stopPropagation();
}
开发者ID:araname,项目名称:dokuwiki-plugin-imgpaste,代码行数:49,代码来源:action.php
示例13: checkPage
/**
* @param string $pageId wiki page ID to check
* @throws Exception exception on error or nothing
*/
protected function checkPage($pageId)
{
if (empty($pageId)) {
throw new Exception('No page ID was sent to delete.');
}
if (auth_quickaclcheck($pageId) < AUTH_DELETE) {
throw new Exception("You do not have permissions to delete page <b>{$pageId}</b>. You need AUTH_DELETE or higher rights");
}
if (checklock($pageId)) {
throw new Exception('Page is locked by another user');
}
if (!checklock($pageId) && file_exists(wikiLockFN($pageId))) {
throw new Exception('Page is locked by You. You cannot delete page during edit.');
}
}
开发者ID:yurii-github,项目名称:dokuwiki-plugin-yktools,代码行数:19,代码来源:Edit.php
示例14: getBarFN
function getBarFN($ns, $file)
{
// check for wiki page = $ns:$file (or $file where no namespace)
$nsFile = $ns ? "{$ns}:{$file}" : $file;
if (file_exists(wikiFN($nsFile)) && auth_quickaclcheck($nsFile)) {
return $nsFile;
}
// remove deepest namespace level and call function recursively
// no namespace left, exit with no file found
if (!$ns) {
return '';
}
$i = strrpos($ns, ":");
$ns = $i ? substr($ns, 0, $i) : false;
return getBarFN($ns, $file);
}
开发者ID:pombredanne,项目名称:bayes-swarm,代码行数:16,代码来源:tplfn_sidebar.php
示例15: print_overlay
function print_overlay(&$event, $param)
{
global $ID;
$overlay = '';
$paths = $this->getConf('nsoverlays');
$namespace = getNS($ID);
$sort_paths = $this->_natsort_ns($paths);
$sort_paths = explode(',', $sort_paths);
$overlays = $this->_get_overlays($sort_paths);
$parent_ns = $this->_get_parent_ns($namespace);
foreach ($overlays as $key => $val) {
// first check if was specified an overlay for a specific namespace
if ($val[1] != '') {
if ($val[1] == ':') {
$overlay = $overlays[$key][0];
} elseif (strpos($namespace, $val[1]) === 0) {
$overlay = $overlays[$key][0];
break;
}
} else {
if ($overlay == '') {
if ('' == $val[1]) {
foreach ($parent_ns as $ns) {
$wikifile = wikiFN($ns . ':' . $val[0]);
if (file_exists($wikifile)) {
$overlay = str_replace('/', ':', $ns) . ':' . $val[0];
break 2;
}
}
}
}
}
}
if (auth_quickaclcheck($ID) >= AUTH_READ) {
$insert = p_wiki_xhtml($overlay);
}
if (!$insert) {
return;
}
$close = trim($this->getLang('close'));
$text = <<<TEXT
<div id='overlay'><div class = "close">
<a href="javascript:jQuery('#overlay').toggle();void(0);" rel="nofollow" title="{$close}">{$close}</a>
</div> {$insert}</div>
TEXT;
echo $text;
}
开发者ID:TorMec,项目名称:Dokuwiki-Nav-Overlay,代码行数:47,代码来源:action.php
示例16: tpl_topbar
/**
* Renders the topbar
*
* @author Michael Klier <[email protected]>
* @author Louis Wolf <[email protected]>
*/
function tpl_topbar()
{
global $ID;
$found = false;
$tbar = '';
$path = explode(':', $ID);
while (!$found && count($path) >= 0) {
$tbar = implode(':', $path) . ':' . 'topbar';
$found = @file_exists(wikiFN($tbar));
array_pop($path);
// check if nothing was found
if (!$found && $tbar == ':topbar') {
return;
}
}
if ($found && auth_quickaclcheck($tbar) >= AUTH_READ) {
$toolbar = p_wiki_xhtml($tbar, '', false);
$lines = explode("\n", $toolbar);
$nr = count($lines);
$open_ul = 0;
$primary_ul = 0;
$positions = array();
for ($i = 0; $i < $nr; $i++) {
if (trim($lines[$i]) == '<ul>') {
$open_ul = $open_ul + 1;
if ($open_ul == 1) {
$primary_ul++;
$lines[$i] = '<ul class="primary">' . "\n";
array_push($positions, $i);
}
} else {
if (strpos($lines[$i], '</ul>') !== false) {
$open_ul = $open_ul - 1;
}
}
}
$first_position = $positions[0];
$last_position = $positions[count($positions) - 1];
$lines[$first_position] = '<ul class="primary start">' . "\n";
$lines[$last_position] = '<ul class="primary end">' . "\n";
$width = $primary_ul * 150;
print '<div id="tpl_simple_navi" style="width:' . $width . 'px;">';
print implode($lines);
print '</div>';
}
}
开发者ID:hannesdorn,项目名称:newday,代码行数:52,代码来源:tpl_functions.php
示例17: handle_action_act_preprocess
/**
* This is the main function, call at every action.
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function handle_action_act_preprocess(Doku_Event &$event, $param)
{
// first check if it's a texit event
if ($event->data != "texit" && $event->data != "texitns") {
return false;
}
// check user's rights
if (auth_quickaclcheck(getID()) < AUTH_READ) {
return false;
}
$this->loadConfig();
// we need to get the usual plugin config
$pdfurl = $this->generate_pdf($event->data);
$this->redirect_to_pdf($pdfurl);
$event->preventDefault();
$event->stopPropagation();
exit;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:26,代码来源:action.php
示例18: test_getLastApproved
/**
* Blackbox integration test of action_plugin_publish_mail::getLastApproved
*
* @coversNothing
*/
public function test_getLastApproved()
{
global $ID;
$ID = 'foo';
saveWikiText('foo', 'bar old', 'foobar');
saveWikiText('foo', 'bar approved', 'foobar');
$data = pageinfo();
$expected_revision = $data['currentrev'];
//Make sure we have the rights to actully approve a revision
$this->assertSame(255, auth_quickaclcheck('foo'));
$request = new TestRequest();
$request->get(array(), '/doku.php?id=foo&publish_approve');
saveWikiText('foo', 'bar new', 'foobar');
/** @var helper_plugin_publish $helper */
$helper = plugin_load('helper', 'publish');
$actual_lastapproved_helper = $helper->getLatestApprovedRevision($ID);
$this->assertSame($expected_revision, $actual_lastapproved_helper);
}
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:23,代码来源:mail.test.php
示例19: handle_tpl_act_unknown
public function handle_tpl_act_unknown(Doku_Event &$event, $param)
{
if ($event->data != 'pageproperties') {
return;
}
$event->preventDefault();
global $lang;
global $ID;
// check user's rights
if (auth_quickaclcheck($ID) < AUTH_READ) {
print $lang['accessdenied'];
} else {
if ($this->getConf('use_simple_treeview') == 1) {
$this->render_simple_treeview();
} else {
$this->render_complex();
}
}
}
开发者ID:LeutenmayrS,项目名称:dokuwiki-pageproperties,代码行数:19,代码来源:action.php
示例20: handle_act_preprocess
/**
* Checks if 'newentry' was given as action, if so we
* do handle the event our self and no further checking takes place
*/
function handle_act_preprocess(&$event, $param)
{
//if ($event->data != 'newentry') return; // nothing to do for us
global $ACT;
global $ID;
echo "param={$param}";
return;
// we can handle it -> prevent others
$event->stopPropagation();
$event->preventDefault();
$ns = $_REQUEST['ns'];
$title = str_replace(':', '', $_REQUEST['title']);
$id = ($ns ? $ns . ':' : '') . cleanID($title);
// check if we are allowed to create this file
if (auth_quickaclcheck($id) >= AUTH_CREATE) {
$back = $ID;
$ID = $id;
$file = wikiFN($ID);
//check if locked by anyone - if not lock for my self
if (checklock($ID)) {
$ACT = 'locked';
} else {
lock($ID);
}
// prepare the new thread file with default stuff
if (!@file_exists($file)) {
global $TEXT;
global $INFO;
global $conf;
$TEXT = pageTemplate($ns . ':' . $title);
if (!$TEXT) {
$TEXT = "====== {$title} ======\n\n\n\n" . "~~DISCUSSION~~\n";
}
$ACT = 'preview';
} else {
$ACT = 'edit';
}
} else {
$ACT = 'show';
}
}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:45,代码来源:action.php
注:本文中的auth_quickaclcheck函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论