本文整理汇总了PHP中WT\Auth::isMember方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::isMember方法的具体用法?PHP Auth::isMember怎么用?PHP Auth::isMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT\Auth
的用法示例。
在下文中一共展示了Auth::isMember方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
$WT_TREE = $tree;
if ($WT_TREE->tree_name == $GEDCOM && ($WT_TREE->imported || Auth::isAdmin())) {
break;
}
}
// These attributes of the currently-selected tree are used frequently
if ($WT_TREE) {
define('WT_GEDCOM', $WT_TREE->tree_name);
define('WT_GED_ID', $WT_TREE->tree_id);
define('WT_GEDURL', $WT_TREE->tree_name_url);
define('WT_TREE_TITLE', $WT_TREE->tree_title_html);
define('WT_IMPORTED', $WT_TREE->imported);
define('WT_USER_GEDCOM_ADMIN', Auth::isManager($WT_TREE));
define('WT_USER_CAN_ACCEPT', Auth::isModerator($WT_TREE));
define('WT_USER_CAN_EDIT', Auth::isEditor($WT_TREE));
define('WT_USER_CAN_ACCESS', Auth::isMember($WT_TREE));
define('WT_USER_GEDCOM_ID', $WT_TREE->userPreference(WT_USER_ID, 'gedcomid'));
define('WT_USER_ROOT_ID', $WT_TREE->userPreference(WT_USER_ID, 'rootid') ? $WT_TREE->userPreference(WT_USER_ID, 'rootid') : WT_USER_GEDCOM_ID);
define('WT_USER_PATH_LENGTH', $WT_TREE->userPreference(WT_USER_ID, 'RELATIONSHIP_PATH_LENGTH'));
if (WT_USER_GEDCOM_ADMIN) {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_NONE);
} elseif (WT_USER_CAN_ACCESS) {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_USER);
} else {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_PUBLIC);
}
load_gedcom_settings(WT_GED_ID);
} else {
define('WT_GEDCOM', '');
define('WT_GED_ID', null);
define('WT_GEDURL', '');
示例2:
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'editnews.php');
require './includes/session.php';
$controller = new WT_Controller_Simple();
$controller->setPageTitle(WT_I18N::translate('Add/edit a journal/news entry'))->restrictAccess(Auth::isMember())->pageHeader();
$action = WT_Filter::get('action', 'compose|save|delete', 'compose');
$news_id = WT_Filter::getInteger('news_id');
$user_id = WT_Filter::get('user_id', WT_REGEX_INTEGER, WT_Filter::post('user_id', WT_REGEX_INTEGER));
$gedcom_id = WT_Filter::get('gedcom_id', WT_REGEX_INTEGER, WT_Filter::post('gedcom_id', WT_REGEX_INTEGER));
$date = WT_Filter::postInteger('date', 0, PHP_INT_MAX, WT_TIMESTAMP);
$title = WT_Filter::post('title');
$text = WT_Filter::post('text');
switch ($action) {
case 'compose':
if (array_key_exists('ckeditor', WT_Module::getActiveModules())) {
ckeditor_WT_Module::enableEditor($controller);
}
echo '<h3>' . WT_I18N::translate('Add/edit a journal/news entry') . '</h3>';
echo '<form style="overflow: hidden;" name="messageform" method="post" action="editnews.php?action=save&news_id=' . $news_id . '">';
if ($news_id) {
示例3: foreach
if (array_key_exists($module_name, $all_blocks)) {
$class_name = $module_name . '_WT_Module';
$module = new $class_name();
$module->getBlock($block_id);
}
if (WT_DEBUG) {
echo execution_stats();
}
if (WT_DEBUG_SQL) {
echo WT_DB::getQueryLog();
}
exit;
}
$controller = new WT_Controller_Page();
if ($ctype == 'user') {
$controller->restrictAccess(Auth::isMember());
}
$controller->setPageTitle($ctype == 'user' ? WT_I18N::translate('My page') : WT_TREE_TITLE)->setMetaRobots('index,follow')->setCanonicalUrl(WT_SCRIPT_NAME . '?ctype=' . $ctype . '&ged=' . WT_GEDCOM)->pageHeader()->addInlineJavascript('jQuery.ajaxSetup({cache:true});');
if ($ctype == 'user') {
echo '<div id="my-page">';
echo '<h1 class="center">', WT_I18N::translate('My page'), '</h1>';
} else {
echo '<div id="home-page">';
}
if ($blocks['main']) {
if ($blocks['side']) {
echo '<div id="index_main_blocks">';
} else {
echo '<div id="index_full_blocks">';
}
foreach ($blocks['main'] as $block_id => $module_name) {
示例4:
require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$pid = WT_Filter::get('pid', WT_REGEX_XREF, WT_Filter::post('pid', WT_REGEX_XREF));
// edit this media object
$linktoid = WT_Filter::get('linktoid', WT_REGEX_XREF, WT_Filter::post('linktoid', WT_REGEX_XREF));
// create a new media object, linked to this record
$action = WT_Filter::get('action', null, WT_Filter::post('action'));
$filename = WT_Filter::get('filename', null, WT_Filter::post('filename'));
$text = WT_Filter::postArray('text');
$tag = WT_Filter::postArray('tag', WT_REGEX_TAG);
$islink = WT_Filter::postArray('islink');
$glevels = WT_Filter::postArray('glevels', '[0-9]');
$folder = WT_Filter::post('folder');
$update_CHAN = !WT_Filter::postBool('preserve_last_changed');
$controller = new WT_Controller_Simple();
$controller->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->restrictAccess(Auth::isMember());
$disp = true;
$media = WT_Media::getInstance($pid);
if ($media) {
$disp = $media->canShow();
}
if ($action == 'update' || $action == 'create') {
if ($linktoid) {
$disp = WT_GedcomRecord::getInstance($linktoid)->canShow();
}
}
if (!WT_USER_CAN_EDIT || !$disp) {
$controller->pageHeader()->addInlineJavascript('closePopupAndReloadParent();');
exit;
}
// TODO - there is a lot of common code in the create and update cases....