本文整理汇总了PHP中check_allow函数的典型用法代码示例。如果您正苦于以下问题:PHP check_allow函数的具体用法?PHP check_allow怎么用?PHP check_allow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_allow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ob_start
ob_start();
$title = "import_language";
include "header.php";
if ($proceed) {
if (isset($_REQUEST['lang_id']) && $_REQUEST['lang_id']) {
$lang_id = $_REQUEST['lang_id'];
} else {
$lang_id = '';
}
$languages = get_languages();
if (!$lang_id || !in_array($lang_id, $languages)) {
redirect("admin/lang_main.php");
}
}
if ($proceed) {
$allow = check_allow('lang_lang_export', 'lang_lang_edit.php?elang=' . $lang_id);
}
if ($proceed) {
$tlang_name = load_language_symbol('lang_name', $lang_id);
if (isset($_REQUEST['upload']) && $_REQUEST['upload']) {
if (!isset($_REQUEST['action'])) {
$_REQUEST['action'] = "";
}
switch ($_REQUEST['action']) {
case 'upgrade':
$do_upgrade = true;
$do_update = false;
break;
case 'update':
$do_upgrade = false;
$do_update = true;
示例2: lang
echo ' <tr class="small"';
if ($shade) {
echo ' bgcolor="' . $color['list_shade1'] . '"';
} else {
echo ' bgcolor="' . $color['list_shade2'] . '"';
}
if (!$line['enabled']) {
echo ' style="font-style: italic;"';
}
echo '>
<TD>' . $line['budget_id'] . '</TD>
<TD>' . ($line['enabled'] ? lang('y') : lang('n')) . '</TD>
<td>' . $line['budget_name'] . '</td>
<td>' . experiment__list_experimenters($line['experimenter'], false, true) . '</td>
<td>' . $line['budget_limit'] . '</td>';
if (check_allow('payments_budget_edit')) {
echo '<td valign=top>';
echo '<A HREF="payments_budget_edit.php?budget_id=' . $line['budget_id'] . '">' . lang('edit') . '</A>';
echo '</td>';
}
echo '</tr>';
if ($shade) {
$shade = false;
} else {
$shade = true;
}
}
echo '</tbody></table>';
echo '<BR><BR>
<A href="options_main.php">' . icon('back') . ' ' . lang('back') . '</A><BR><BR>';
echo '</CENTER>';
示例3: ob_start
<?php
// part of orsee. see orsee.org
ob_start();
$old_versions = array('orsee2' => 'versions <3.0');
$title = "prepare_data_import";
$menu__area = "options_main";
include "header.php";
if ($proceed) {
check_allow('import_data', 'options_main.php');
}
if ($proceed) {
$continue = true;
echo '<center>';
if ($continue) {
$databases = array();
$query = "SELECT `SCHEMA_NAME`\n FROM `INFORMATION_SCHEMA`.`SCHEMATA`\n WHERE `SCHEMA_NAME` NOT IN ('information_schema','mysql')";
$result = or_query($query);
while ($line = pdo_fetch_assoc($result)) {
if ($line['SCHEMA_NAME'] != $site__database_database) {
$databases[] = $line['SCHEMA_NAME'];
}
}
// first step:
if (!isset($_REQUEST['old_version']) || !isset($old_versions[$_REQUEST['old_version']]) || !isset($_REQUEST['old_database']) || !in_array($_REQUEST['old_database'], $databases)) {
$continue = false;
echo '<FORM action="' . thisdoc() . '" method="POST">';
echo '<TABLE class="or_formtable">';
echo ' <TR><TD>From which ORSEE version do you want to import data?</TD>
<TD><SELECT name="old_version">';
foreach ($old_versions as $ov => $text) {
示例4: lang
<TD>
' . lang('answer_in_xxxlang') . ' ' . $language . '
</TD>
<TD>
<textarea name="answer[' . $language . ']" cols=40 rows=20 wrap=virtual>' . stripslashes($answer[$language]) . '</textarea>
</TD>
</TR>';
}
echo ' <TR>
<TD COLSPAN=2 align=center>
<INPUT class="button" name=edit type=submit value="';
if ($faq_id) {
echo lang('change');
} else {
echo lang('add');
}
echo '">
</TD>
</TR>
</table>
</FORM>
<BR>';
if ($faq_id && check_allow('faq_delete')) {
echo '<BR><BR>
' . button_link('faq_delete.php?faq_id=' . urlencode($faq_id), lang('delete'), 'trash-o');
}
echo '<BR><BR>
<A href="faq_main.php">' . icon('back') . ' ' . lang('back') . '</A><BR><BR>
</center>';
}
include "footer.php";
示例5: array
$jquery = array();
include "header.php";
if ($proceed) {
if (isset($_REQUEST['item_name'])) {
$item_name = $_REQUEST['item_name'];
} else {
redirect("admin/options_profile_template.php");
}
}
if ($proceed) {
if (!in_array($item_name, array('profile_form_public', 'profile_form_admin_part'))) {
redirect("admin/options_profile_template.php");
}
}
if ($proceed) {
$allow = check_allow('pform_templates_edit', 'options_main.php');
}
if ($proceed) {
$t = options__load_object('profile_form_template', $item_name);
}
if ($proceed) {
if (!isset($_REQUEST['subpool_id'])) {
$subpool_id = 1;
} else {
$subpool_id = $_REQUEST['subpool_id'];
}
$subpool = orsee_db_load_array("subpools", $subpool_id, "subpool_id");
if (!$subpool['subpool_id']) {
$subpool = orsee_db_load_array("subpools", 1, "subpool_id");
}
}
示例6: message
if (in_array($k, $fields)) {
$columns[] = $k;
}
}
}
if (count($columns) == 0) {
message(lang('no_data_columns_selected'));
redirect('admin/' . thisdoc());
} else {
$query = "SELECT count(*) as num_matches, " . implode(', ', $columns) . "\n FROM " . table('participants') . "\n GROUP BY " . implode(', ', $columns) . "\n HAVING num_matches>1\n ORDER BY num_matches DESC";
$result = or_query($query);
$dupvals = array();
while ($line = pdo_fetch_assoc($result)) {
$dupvals[] = $line;
}
if (check_allow('participants_edit')) {
echo javascript__edit_popup();
}
$part_statuses = participant_status__get_statuses();
$cols = participant__get_result_table_columns('result_table_search_duplicates');
echo '<TABLE class="or_listtable"><thead>';
echo '<TR style="background: ' . $color['list_header_background'] . '; color: ' . $color['list_header_textcolor'] . ';">';
echo '<TD> </TD>';
echo participant__get_result_table_headcells($cols, false);
echo '</TR></thead>
<tbody>';
$num_cols = count($cols) + 1;
foreach ($dupvals as $dv) {
$mvals = array();
$pars = array();
$qclause = array();
示例7: orsee_db_load_array
$titem = orsee_db_load_array("lang", $id, "lang_id");
$done = false;
$formfields = participantform__load();
$allow_cat = $item;
foreach ($formfields as $f) {
if (preg_match("/(select_lang|radioline_lang)/", $f['type']) && $item == $f['mysql_column_name']) {
$done = true;
$header = isset($lang[$f['name_lang']]) ? $lang[$f['name_lang']] : $f['name_lang'];
$headervar = lang('lang');
$reset_part_field = $f['mysql_column_name'];
$deletion_message = lang('symbol_deleted');
$allow_cat = 'pform_lang_field';
break;
}
}
$allow = check_allow($allow_cat . '_delete', 'lang_item_edit.php?id=' . $id . '&item=' . $item);
}
if ($proceed) {
switch ($item) {
case 'experimentclass':
$header = lang('delete_experiment_class');
$headervar = lang('lang');
$reset_part_field = "";
$deletion_message = lang('experiment_class_deleted');
break;
case 'public_content':
$header = lang('delete_public_content');
$headervar = "content_name";
$reset_part_field = "";
$deletion_message = lang('public_content_deleted');
break;
示例8: redirect
} else {
redirect("admin/");
}
}
if ($proceed) {
if (isset($_REQUEST['betternot']) && $_REQUEST['betternot']) {
redirect('admin/events_edit.php?event_id=' . $event_id);
}
}
if ($proceed) {
if (isset($_REQUEST['reallydelete']) && $_REQUEST['reallydelete']) {
$reallydelete = true;
} else {
$reallydelete = false;
}
$allow = check_allow('events_delete', 'events_edit.php?event_id=' . $event_id);
}
if ($proceed) {
$space = orsee_db_load_array("events", $event_id, "event_id");
if ($reallydelete) {
$pars = array('event_id' => $event_id);
$query = "DELETE FROM " . table('events') . "\n WHERE event_id= :event_id";
$result = or_query($query, $pars);
log__admin("events_delete", "event_id:" . $event_id);
message(lang('lab_reservation_deleted'));
redirect('admin/calendar_main.php');
}
}
if ($proceed) {
// form
echo ' <CENTER>
示例9: lang
</TR>';
if ($session_id) {
echo '
<TR>
<TD COLSPAN=2 align="right">
<INPUT class="button" name="copy" type="submit" value="' . lang('copy_as_new_session') . '">
</TD>
</TR>';
}
echo '
</table>
</FORM>
<BR>';
if ($session_id) {
$reg = experiment__count_participate_at($edit['experiment_id'], $session_id);
if ($reg == 0 && check_allow('session_empty_delete') || check_allow('session_nonempty_delete')) {
echo '
<table>
<TR>
<TD>
' . button_link('session_delete.php?session_id=' . $edit['session_id'], lang('delete'), 'trash-o') . '
</TD>
</TR>
</table>';
}
}
if ($session_id) {
$experiment_id = $edit['experiment_id'];
} else {
$experiment_id = $_REQUEST['experiment_id'];
}
示例10: ob_start
<?php
// part of orsee. see orsee.org
ob_start();
$menu__area = "statistics";
$title = "budget_reports";
include "header.php";
if ($proceed) {
if (!(check_allow('payments_budget_view_my') || check_allow('payments_budget_view_all'))) {
redirect('admin/statistics_main.php');
}
}
if ($proceed) {
if (check_allow('payments_budget_view_all')) {
$restriction = "";
$pars = array();
} else {
$pars = array(':adminname' => '%|' . $expadmindata['adminname']) . '|%';
$restriction = " experimenter LIKE :adminname ";
}
// get budgets
$query = "SELECT * FROM " . table('budgets') . " " . $restriction . "\n ORDER BY enabled DESC, budget_name";
$result = or_query($query, $pars);
$shade = false;
$budgets = array();
$budget_ids = array();
while ($line = pdo_fetch_assoc($result)) {
$budgets[$line['budget_id']] = $line;
$budget_ids[] = $line['budget_id'];
}
if (count($budgets) == 0) {
示例11: orsee_db_load_array
if ($proceed) {
if ($experiment_id > 0) {
$experiment = orsee_db_load_array("experiments", $experiment_id, "experiment_id");
if (!isset($experiment['experiment_id'])) {
$experiment_id = 0;
}
}
}
if ($proceed) {
if ($experiment_id > 0) {
$experimenters = db_string_to_id_array($experiment['experimenter']);
if (!(in_array($expadmindata['admin_id'], $experimenters) && check_allow('file_download_experiment_my') || check_allow('file_download_experiment_all'))) {
redirect('admin/experiment_show.php?experiment_id=' . $experiment_id);
}
} else {
$allow = check_allow('file_download_general', 'download_main.php');
}
}
if ($proceed) {
// load file specification
$filedata = orsee_db_load_array("uploads_data", $upload_id, "upload_id");
// mime type
$mime_type = $upload['upload_mimetype'];
if (!$mime_type) {
$mime_type = downloads__mime_type($upload['upload_suffix']);
}
if (!$mime_type) {
$mime_type = "text/*";
}
$filename = str_replace(" ", "_", $upload['upload_name']) . "." . $upload['upload_suffix'];
ob_end_clean();
示例12: ob_start
ob_start();
$menu__area = "options";
$title = "delete_symbol";
include "header.php";
if ($proceed) {
if (isset($_REQUEST['lang_id']) && $_REQUEST['lang_id']) {
$lang_id = $_REQUEST['lang_id'];
} else {
$lang_id = "";
}
if (!$lang_id) {
redirect("admin/lang_main.php");
}
}
if ($proceed) {
$allow = check_allow('lang_symbol_delete', 'lang_symbol_edit.php?lang_id=' . $lang_id);
}
if ($proceed) {
if (isset($_REQUEST['betternot']) && $_REQUEST['betternot']) {
redirect('admin/lang_symbol_edit.php?lang_id=' . $lang_id);
}
}
if ($proceed) {
if (isset($_REQUEST['reallydelete']) && $_REQUEST['reallydelete']) {
$reallydelete = true;
} else {
$reallydelete = false;
}
$symbol = orsee_db_load_array("lang", $lang_id, "lang_id");
if (!isset($symbol['lang_id'])) {
redirect("admin/lang_main.php");
示例13: redirect
$lang_icons_prepare = true;
include "header.php";
if ($proceed) {
if (!$_REQUEST['experiment_id']) {
redirect("admin/");
} else {
$experiment_id = $_REQUEST['experiment_id'];
}
}
if ($proceed) {
$allow = check_allow('experiment_recruitment_report_show', 'experiment_show.php?experiment_id=' . $experiment_id);
}
if ($proceed) {
// load experiment data into array experiment
$experiment = orsee_db_load_array("experiments", $experiment_id, "experiment_id");
if (!check_allow('experiment_restriction_override')) {
check_experiment_allowed($experiment, "admin/experiment_show.php?experiment_id=" . $experiment_id);
}
}
if ($proceed) {
$alllangs = get_languages();
if (isset($_REQUEST['replang']) && in_array($_REQUEST['replang'], $alllangs) && $_REQUEST['replang'] != lang('lang')) {
$replang = $_REQUEST['replang'];
} else {
$replang = lang('lang');
}
$lang_names = lang__get_language_names();
$switchlang_text = '';
foreach ($alllangs as $thislang) {
if ($thislang != $replang) {
$switchlang_text .= '<A HREF="' . thisdoc() . '?experiment_id=' . $experiment_id . '&replang=' . $thislang . '"><span class="languageicon langicon-' . $thislang . '">';
示例14: ob_start
<?php
// part of orsee. see orsee.org
ob_start();
$menu__area = "options";
$title = "edit_language";
include "header.php";
if ($proceed) {
$allow = check_allow('lang_symbol_edit', 'lang_main.php');
}
if ($proceed) {
echo '<center>';
// load languages
$languages = get_languages();
if (isset($_REQUEST['el']) && $_REQUEST['el'] && in_array($_REQUEST['el'], $languages)) {
$el = $_REQUEST['el'];
} else {
$el = $settings['admin_standard_language'];
}
if (isset($_REQUEST['search']) && $_REQUEST['search']) {
$search = $_REQUEST['search'];
} else {
$search = '';
}
if (isset($_REQUEST['letter']) && $_REQUEST['letter']) {
$letter = $_REQUEST['letter'];
} else {
$letter = 'a';
}
if (isset($_REQUEST['alter_lang']) && $_REQUEST['alter_lang'] && isset($_REQUEST['symbols']) && is_array($_REQUEST['symbols'])) {
$pars = array();
示例15: html__header
}
if ($hide_header) {
include "nonoutputheader.php";
html__header();
echo '<basefont face="Arial,Helvetica,sans-serif"><center><BR>';
echo '<TABLE width="90%" border="0"><TR><TD style="border-radius: 20px 20px 20px 20px; background: ' . $color['content_background_color'] . ';"><BR>';
} else {
include "header.php";
}
if ($proceed) {
if (isset($_REQUEST['participant_id']) && $_REQUEST['participant_id']) {
$participant_id = $_REQUEST['participant_id'];
} else {
$participant_id = "";
}
$allow = check_allow('participants_edit', 'participants_main.php');
}
if ($proceed) {
$statuses = participant_status__get_statuses();
$continue = true;
$errors__dataform = array();
if (isset($_REQUEST['add']) && $_REQUEST['add']) {
// checks and errors
foreach ($_REQUEST as $k => $v) {
if (!is_array($v)) {
$_REQUEST[$k] = trim($v);
}
}
$errors__dataform = participantform__check_fields($_REQUEST, true);
$error_count = count($errors__dataform);
if ($error_count > 0) {